diff --git a/.config/goldendict/config b/.config/goldendict/config index 6e01367..fe8be77 100644 --- a/.config/goldendict/config +++ b/.config/goldendict/config @@ -8,12 +8,13 @@ /mnt/Data/Documents/dict - concise encyclopedia of mathematics /home/hashirama/Downloads/Port /mnt/Data/Documents/english_dictionary - /mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0] + /mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0] /mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0] - + + /mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/accentAudio/accentAudio + - 00824c93f503c5d1680483abdf367948 968c3a374ef50d74e019560ae8f69488 41e48e169f3b09f5d08c9821aa0e88af 646c2fbd2278d23caf8bc5b44599f5aa @@ -119,70 +120,6 @@ 6dac50cdfb3265d22b966313a1d228b7 27ea5cfecf6d68fdf7dcbfd8df6f06f7 90259fffdd76764f7431170eeb89a0f9 - 29cc4b1fae1ee39411c691ecd1c00eb5 - 9f2d889846365f17d4d1f2c690996416 - 4452336dedfdbaa7bed0283317b85353 - aea83409a28a5830844e18d2bf7b3605 - 55a40fa62c52d35d1da84e22b482cad7 - 00a9ac5f0ee827e1556f14cf47e19d3d - ef768b427ba5d11925e7bfaa9c7e1d05 - 4aaedc0ae250b42bc8aaf2d735091565 - c516fc785c0241b43ed13e4e1e1caabc - b93665f7b1fc5dbd46b740d434c9fdba - a8c7d6e4e614d8ba5afff44b2000a133 - e138d3961665c48cefb39a45302bc83c - e9b0a26a8ad6cb82e7b8e6fc3158da03 - 7d39d07745b76d69665c09cbdb6e9d6e - a57af2b409324b63f8a480cacc7be75a - 86434219cff9e8d19a088608607c9c06 - c5cd1defbdf56b37788042d597d85586 - bc51b1f9b816c316eae12fdacf3e4ed8 - 66332bb70b8da80bf54cd4a0bed8eab6 - 2e03869cdf0661fedb9c62a7c18f3d3c - 1ada2fe066091f9a4359183fa853a82c - 2efba112cbf507a888ddacac197fc6e8 - 03d6d969418271df751af401bf2761db - 21bcd9dafb548fcade20f49cbc297ebc - 0aafbadc4551593b53f9b9725abb0a16 - 28ce5ef209eefa1d09867dcfe56f68b9 - 8c6bd976fd334b801e6ed183d62ca6af - b497d4ab65170af150b22df540d0a2a2 - 2cfdf122338dff2daf27afee627ef8bd - 59b128e529222bb6befc422142585545 - 92c8016b345793461ad75791a86a3d2f - ce47834eb965547d439f161c55c7f67f - 710eab1b84747b8a411884c2c57f9dbb - 885330a052380572d9dcbfd488e9e580 - 1798572e78293506e7a7fee523dd6b5c - 9c41547647e9443116cff925d644c8c6 - 0af6e512737d6c694ffda901b81ea20b - c1236cd9aae363b99b4e661ecbf8e58c - 418c3e0efd2f32ed5cf2a6c341f8cc01 - 0c6cbfc1abfb5cfaae79e9bf792d7c51 - e4485d143c300887097750993aa9d7da - 234f85adf2bddce704e6871b63bd125b - eea2f519124622e6fe36300893122aa2 - 0322a497dc6f9b186e481792ea2f7ca3 - 3d7fe64f59132114165d39e54d7f1224 - f7ffa4317e18421ad132877637b7982e - 459ec66d59cab903ab6c014f39a356ff - c8969efad9e74f6ae3dc50de12a571b1 - 2454fc825c8ec79d448bcec0fecabd1c - f9aca7a51be5e3082899c2c88a5fa467 - d0619669dd5186af6aef63b74f16fa9d - bbc68845c1e47c86efd0a93296f452eb - 101edc426d68a2343656c2c4676c101f - 323326cfb9904222ae062015dc3ce4c0 - bf9513ddc9e38c466d4898319079e255 - 383ac1096fe034bba3029634a6dcb455 - 164c42c7d50f31e445b1552dbb5f02bc - 5dc88fafe05b9696682f8fa6fe7fbf1c - 1fadaa784421b497436cd5ab50ff91fb - eafb82c84bad2a854f9b9658b35f23eb - 3ab498f8dd34af4b66a0cff5fbdea866 - 69b47be2470f1b77a2048d664ef777ba - 394cf7eae9a4046fefa1721d9750ac40 - 301ba3d3d6dbca257e6b701238e1e1f6 b072a05ab5a78a388aa6db2ae5131550 e2ecb75e6e785162b0aa2f3a94244031 4df26ca9d2ac13f6b427bb2b58711382 @@ -200,139 +137,6 @@ 8dd0aa4f4961c07eba109e6083f6e92e accb179c9ae61c64e574ae3907c3e3e4 7b6de7954354ed1558475674685d2139 - 2b72ecab5781f43b92fa61a95f70b44e - aa368196f1aa18a2aa00d7d90eb68d79 - 47723eaa989a140ae761a73ccef0ad74 - ab04767f78051ea72534ead167c46a7e - 43d3033b997cfb3b86ba41842c70d9bc - 0bbbb95c81efc0341f6be50b3dd07e0f - 0b7d3b7ab9ce129f8f1468199645b9fa - 76c29ce6488ef58f6fb59232e1c234f9 - 09c4d84b2cf5a9a18b6d67066b3c50e4 - d37bebac02fd8635d456a8e0ebee69f0 - a55513cc946f2bc065056d750ce3084b - 4a9a3d0091a7e6e4452c821484ef265c - 3239558cf13b5ed72adb871aa8a18ead - 4c09400bf0f4f24f9b0544fb05467b3d - 30c4224efb876ba21c6f5a1db22909f9 - 3bd60af5edb9a139ab4844ce5900d50d - 3ff8c47f8a7b655f54cba4923448074e - 6897ed5b058db74e575da6d1775a97bb - b10e50122f4642d845f2b1683f9e6fd9 - 8bdb718ed4030036946d1ca72f55002b - 5c1d863f7c7f671dfdd13dfc27df0f1e - 8eacc3113fb03d05607e85e8440dda66 - 9b5d3509deefc3a8a59332f33dc8ee28 - 3f7b5d783074ce39d51fadec9ecc13a5 - c172ecafbe36afc163313b1be856f090 - d874fff5195c853b3c0e4cb28a84ccd9 - 6555c429b526ea752b4952274822e978 - cc16a2a0d9a3a5d51ae501435ab63a6c - f84cff606a8fc794e79f6547badaddc2 - 5bbfb17ed1d2074c5319a6df09972e59 - db46db216048708cd1117d7c40c44903 - 226c1a378284bddbab006b58f2bed912 - e56e5730e20de70e2fdbcf3c0c75f6d2 - 1bf304efdcb8df8731229f3ce4e428e8 - 0706014ea3154a3f5cad140d5514da5b - 3a33eea57e761743d83c97260c632ff6 - 879631ffaa14328a6f61187780c8a3b3 - 5e8b7121d5340488cf23fb68476608c7 - 5b1575090dc44a089162111a4db83a2a - 8c445ed601d2249b4c825cdfff4e2352 - 842aedaaee2e4a98d7fe74bb28c70a3c - a66d5e4ce689d103ae50d48befb3e620 - 39be06a7dbe05c5fbd3d54ed36a2f1dc - be0d59795041d059517abfcae545030d - 63b4f589b0c48b00cc1800399ff0eb99 - 3fb08bd228ebd85ae4c6f7cc3974f204 - ce88287767a8cfd103f2e3a826ed5b18 - 84d3926350ba998c7ae4fc7dea933706 - fd24df18234ff107f54c03c2eb7a555c - 8147ebee0008c141c65be596f6a2c730 - 47c3848bbf0782065704e992583a588e - fa941f06f3ce424f92ce2d650c7c12c6 - 521ba4885dd059a0247d6b1fdc511762 - 5d95d144ed251ae7ab7d2d103fa9e7ee - b58f0eafb5ef458de194d566baa1e1d5 - dc4f126e01a2fbf4493717b3e2d28a63 - 24531cdbc7a749ab1d08f2c1a2e27df4 - 823ba1fbcdd1320f539ff73e47bbac6d - 68d823d00a85dbee59c610988a68aa21 - 137031dc413d3fee4efb5364436c1f06 - ca1d5c96cfdd27c2d09c263a086fcee0 - 9ce7acb57ab4a93560ef3c21b2548958 - a11a58202ef444f1440d38570f513e38 - 4cf2c0e0d583a092e87369015427e27d - 7428ae020e19a7a82a5eb26aa0687a3c - 80bf160f10f4650ebbd5a2c01914b445 - 52a4cc2fb1a0640ae18acf15bb3f36b7 - f3062ce86397e447199206d4bd3e8e7a - 146a0d00f75dcf6e0c4b1d92aad398bd - a74598d8d011a692124f4930529c5f00 - 0af974c012f64c3ad9e7bf0ec6892f2d - 9e5db1b303759525f198758ff5f382fe - e1ae71caec385e83c31ef7b419a1ff1a - cf896687b7d7662199c63e055c9f8201 - 047f16cc5bc5812cd0dad9ebccc8bb42 - 6dc733a38cada80e3735ac8f325d0aad - e0ef5582bc9d9f64613d9bc44f862fa6 - 1badd80dadef90f3cb1da0892db414b4 - d41561b0db7f60e344c8fdd0ec62eda7 - 2cd6ade57d818c51351adc4d399f6a32 - 1ac2464ef33d31ddfaac5db525a15f2e - ba4daf0175b1457297ad4ebe8504a690 - 3d951a2c57c9306658b07be28e714aed - cf5769b67c58027b2eddd174e78cbcb4 - 2a8509524dfba1ae3c78fd6da9443d10 - 73a92a4d952f7c6d621a0b23cf45f5f9 - 687de42ee8cd26a1857e5ddc37ace9f3 - d25231514b681b49c39d59c26ff3c0a1 - 1a273954b9caccaddef4c12797f5c67d - da25f08229b565857d6f66217721ac1b - e687e18e0422aeb3767e6b1d6f7f33e4 - da008cae049016579164b5c82273718f - 27ffb7fdb1d580f4bd750c86bba22320 - f08e58f48686a2c6da895e5f85bf0380 - 6aa34e6a3b560d9b49c11829e7df54d8 - 6ccd9806f72c8a16f7fed1ec57eb5ff0 - 122270a5d92707191454250859d425fe - 18b7db37e9f7a7dc203ac9a15825ed8a - fdc0288fded07a57ce4cd752c5f782fb - 11c97cac9f47c4535e8673900c554efe - 34a34d0936b5e4ea2245c9142c517e5e - 49a80b2c231e54f55c2b6673831a23be - 0d15c464ed6f47f23ebc2734f80266ec - a23a3bb5dba9eec8280573c7766619ef - 7c3a8e96a3b168cada45e29c49a2f055 - f63dc6ef338cc1fe1e03ea204b20c556 - 27496e15a6643e68ffe01bee2358eec6 - ee20cd730b59ad5f6c832f39ceb7e0c8 - f60a424d9b635ee9d1c54f1b6d3d2cd1 - 3ee608107ff1d1d39765c3e10b08bfd5 - 1a7c6fdac4f6c37e61e76e9c73b5951f - 4a43ac6ac9ca1a6235128a09eb686ba5 - 0df0c67aa159000bcb3e22522e504ce1 - 81d065e529ef15fef99f3314715a1fd3 - 4ce638e1f9f87481de9ec342440c1753 - 793c41bba28c8d324fc44df3ff42c8c8 - 8282abf3ea32251156a3933ac08b0a03 - a31eec2856e449558b0bd9576af7b36c - 0310d55ef013d5eb96846e6018a200e0 - 38aef41cd62e0cb8b19927511ad10243 - d2577d64470777ebe0a71dda1b0c1532 - 0a882f3f56a32244889e9188b63e6221 - fc48d1fd6efab5b9763a20d651d8a9a3 - 835186c537d860e65f29918d6fce8f2b - 847a695d4b6573f656a698e68e233f55 - 4491dc5b7b2bead2807e9efc95755f86 - 140fce261119cd8064d3c45be90cb11c - c00269d562de62d756d51b9e402e3a77 - fcf5ba6d7310b6a4711dfff841ddc7c1 - 88919fa89de8ed742eae06ba2c03246b - 8e135e0331c329e68f6bb7a819484772 - 6080d6865c3afa8f65bf6627486e6327 - aa7f5a27f1fa955899eb1611d4a91367 76920f4e8caf20bf370acb7fea5fc232 439501f369c57bb5d3f0933b088cb23f 7621ab8dbcc868868042cbbd3a012938 @@ -430,6 +234,13 @@ da98026eab06abf17ac40ed646749a6e ecd5393ffa5e194299db60b98d3bbf60 be6632714ae524d05bf09baf7c349776 + c05cc9bea6ab9ca5a7e4fd9bd485c294 + 662012b956932d0d060ba4a75bf50423 + 9dfe38c28e4eb0d417245e761da52517 + 8490c7e8849c0ef63a91bae96091df6d + aeab10aa786aa055cb6a23912d1ec041 + 26bbdd7c805ddebdf4042931c12d0550 + c7d8599a68f14979433d8708d185e232 @@ -437,7 +248,8 @@ - 00824c93f503c5d1680483abdf367948 + 9dfe38c28e4eb0d417245e761da52517 + c63783324ee9b8fc3309849bd8302845 7363ba2e34cddead0f19a4a2ec51304e 968c3a374ef50d74e019560ae8f69488 646c2fbd2278d23caf8bc5b44599f5aa @@ -450,7 +262,6 @@ 133436b45f37007263000dd395a5cb19 f2f3fca4482e832d2b39e39931f1861e f60affb79583cb692ba2bca6df57444d - b1e3f422135b95f15c0225ae27692050 71ac9bc6d781652a85341bcf5a7fd63c 2ada8c44aefb4c1d63d8b1f475790ff4 e43421f6039418916c33c309fe43f524 @@ -458,7 +269,6 @@ c3bba9ed1957c4d6553f24a97adf0202 f26420c7eb1d59c1076d59ccf790a337 8431bdd6831e3f351ad8799dc6d42d73 - c63783324ee9b8fc3309849bd8302845 d0e35c7d8c2b432d0a57cdf7941f912a fd22dd8651fc9f5383ca576b5ed6a3cf 304a839a02ce8080037171de2de2d336 @@ -474,86 +284,6 @@ 6d08802a63843c048824d298989b7148 68ea7837dab9dc82d592a7762c4e8092 23e549f189b1238b16b9c6a2fc2860f0 - aa368196f1aa18a2aa00d7d90eb68d79 - 47723eaa989a140ae761a73ccef0ad74 - ab04767f78051ea72534ead167c46a7e - 43d3033b997cfb3b86ba41842c70d9bc - 0b7d3b7ab9ce129f8f1468199645b9fa - 76c29ce6488ef58f6fb59232e1c234f9 - 09c4d84b2cf5a9a18b6d67066b3c50e4 - d37bebac02fd8635d456a8e0ebee69f0 - 4a9a3d0091a7e6e4452c821484ef265c - 3239558cf13b5ed72adb871aa8a18ead - 4c09400bf0f4f24f9b0544fb05467b3d - 30c4224efb876ba21c6f5a1db22909f9 - 3bd60af5edb9a139ab4844ce5900d50d - 3ff8c47f8a7b655f54cba4923448074e - 6897ed5b058db74e575da6d1775a97bb - b10e50122f4642d845f2b1683f9e6fd9 - 8bdb718ed4030036946d1ca72f55002b - 9b5d3509deefc3a8a59332f33dc8ee28 - d874fff5195c853b3c0e4cb28a84ccd9 - 6555c429b526ea752b4952274822e978 - cc16a2a0d9a3a5d51ae501435ab63a6c - db46db216048708cd1117d7c40c44903 - 226c1a378284bddbab006b58f2bed912 - e56e5730e20de70e2fdbcf3c0c75f6d2 - 1bf304efdcb8df8731229f3ce4e428e8 - 0706014ea3154a3f5cad140d5514da5b - 879631ffaa14328a6f61187780c8a3b3 - 5e8b7121d5340488cf23fb68476608c7 - 5b1575090dc44a089162111a4db83a2a - 8c445ed601d2249b4c825cdfff4e2352 - 842aedaaee2e4a98d7fe74bb28c70a3c - a66d5e4ce689d103ae50d48befb3e620 - 39be06a7dbe05c5fbd3d54ed36a2f1dc - be0d59795041d059517abfcae545030d - 63b4f589b0c48b00cc1800399ff0eb99 - 3fb08bd228ebd85ae4c6f7cc3974f204 - ce88287767a8cfd103f2e3a826ed5b18 - 84d3926350ba998c7ae4fc7dea933706 - fd24df18234ff107f54c03c2eb7a555c - 8147ebee0008c141c65be596f6a2c730 - 47c3848bbf0782065704e992583a588e - fa941f06f3ce424f92ce2d650c7c12c6 - 521ba4885dd059a0247d6b1fdc511762 - 5d95d144ed251ae7ab7d2d103fa9e7ee - b58f0eafb5ef458de194d566baa1e1d5 - dc4f126e01a2fbf4493717b3e2d28a63 - 24531cdbc7a749ab1d08f2c1a2e27df4 - 823ba1fbcdd1320f539ff73e47bbac6d - 68d823d00a85dbee59c610988a68aa21 - 137031dc413d3fee4efb5364436c1f06 - ca1d5c96cfdd27c2d09c263a086fcee0 - 9ce7acb57ab4a93560ef3c21b2548958 - a11a58202ef444f1440d38570f513e38 - 4cf2c0e0d583a092e87369015427e27d - 7428ae020e19a7a82a5eb26aa0687a3c - 80bf160f10f4650ebbd5a2c01914b445 - 52a4cc2fb1a0640ae18acf15bb3f36b7 - f3062ce86397e447199206d4bd3e8e7a - 146a0d00f75dcf6e0c4b1d92aad398bd - a74598d8d011a692124f4930529c5f00 - 0af974c012f64c3ad9e7bf0ec6892f2d - cf896687b7d7662199c63e055c9f8201 - 047f16cc5bc5812cd0dad9ebccc8bb42 - 6dc733a38cada80e3735ac8f325d0aad - e0ef5582bc9d9f64613d9bc44f862fa6 - 1badd80dadef90f3cb1da0892db414b4 - d41561b0db7f60e344c8fdd0ec62eda7 - 2cd6ade57d818c51351adc4d399f6a32 - 1ac2464ef33d31ddfaac5db525a15f2e - d25231514b681b49c39d59c26ff3c0a1 - 1a273954b9caccaddef4c12797f5c67d - da25f08229b565857d6f66217721ac1b - e687e18e0422aeb3767e6b1d6f7f33e4 - da008cae049016579164b5c82273718f - 27ffb7fdb1d580f4bd750c86bba22320 - f08e58f48686a2c6da895e5f85bf0380 - 6aa34e6a3b560d9b49c11829e7df54d8 - 18b7db37e9f7a7dc203ac9a15825ed8a - fdc0288fded07a57ce4cd752c5f782fb - 11c97cac9f47c4535e8673900c554efe 76920f4e8caf20bf370acb7fea5fc232 439501f369c57bb5d3f0933b088cb23f 7621ab8dbcc868868042cbbd3a012938 @@ -573,7 +303,15 @@ 8dda33ca157805525b1038e6fef3b56c 43bc82454c7f9962132daee50f10e63b 9106e7a93950af3f2f2d85639e8c3b52 + c05cc9bea6ab9ca5a7e4fd9bd485c294 + 16fc50393911f51f8fbdb884269e57c9 + b1e3f422135b95f15c0225ae27692050 + 27ea5cfecf6d68fdf7dcbfd8df6f06f7 + aeab10aa786aa055cb6a23912d1ec041 + 26bbdd7c805ddebdf4042931c12d0550 + c7d8599a68f14979433d8708d185e232 + 2ada8c44aefb4c1d63d8b1f475790ff4 6dac50cdfb3265d22b966313a1d228b7 @@ -595,7 +333,7 @@ - 00824c93f503c5d1680483abdf367948 + 9dfe38c28e4eb0d417245e761da52517 968c3a374ef50d74e019560ae8f69488 ec855a5ed10fb99483666514453d9bac b1e3f422135b95f15c0225ae27692050 @@ -605,7 +343,10 @@ 27ea5cfecf6d68fdf7dcbfd8df6f06f7 156e4c2d5407db4c7dc6af55617b6d87 23bf0ce06d2b68a076557b4c34cf1a74 + 8490c7e8849c0ef63a91bae96091df6d + 90259fffdd76764f7431170eeb89a0f9 + 968c3a374ef50d74e019560ae8f69488 27ea5cfecf6d68fdf7dcbfd8df6f06f7 6dac50cdfb3265d22b966313a1d228b7 @@ -635,74 +376,9 @@ - f7ffa4317e18421ad132877637b7982e - bf9513ddc9e38c466d4898319079e255 - 0c6cbfc1abfb5cfaae79e9bf792d7c51 - 29cc4b1fae1ee39411c691ecd1c00eb5 - 9f2d889846365f17d4d1f2c690996416 - 4452336dedfdbaa7bed0283317b85353 - aea83409a28a5830844e18d2bf7b3605 - 55a40fa62c52d35d1da84e22b482cad7 - 00a9ac5f0ee827e1556f14cf47e19d3d - ef768b427ba5d11925e7bfaa9c7e1d05 - 4aaedc0ae250b42bc8aaf2d735091565 - c516fc785c0241b43ed13e4e1e1caabc - b93665f7b1fc5dbd46b740d434c9fdba - a8c7d6e4e614d8ba5afff44b2000a133 - e138d3961665c48cefb39a45302bc83c - e9b0a26a8ad6cb82e7b8e6fc3158da03 - 7d39d07745b76d69665c09cbdb6e9d6e - a57af2b409324b63f8a480cacc7be75a - 86434219cff9e8d19a088608607c9c06 - c5cd1defbdf56b37788042d597d85586 - bc51b1f9b816c316eae12fdacf3e4ed8 - 66332bb70b8da80bf54cd4a0bed8eab6 - 2e03869cdf0661fedb9c62a7c18f3d3c - 1ada2fe066091f9a4359183fa853a82c - 2efba112cbf507a888ddacac197fc6e8 - 03d6d969418271df751af401bf2761db - 21bcd9dafb548fcade20f49cbc297ebc - 0aafbadc4551593b53f9b9725abb0a16 - 28ce5ef209eefa1d09867dcfe56f68b9 - 8c6bd976fd334b801e6ed183d62ca6af - b497d4ab65170af150b22df540d0a2a2 - 2cfdf122338dff2daf27afee627ef8bd - 59b128e529222bb6befc422142585545 - 92c8016b345793461ad75791a86a3d2f - ce47834eb965547d439f161c55c7f67f - 710eab1b84747b8a411884c2c57f9dbb - 885330a052380572d9dcbfd488e9e580 - 1798572e78293506e7a7fee523dd6b5c - 9c41547647e9443116cff925d644c8c6 - 0af6e512737d6c694ffda901b81ea20b - c1236cd9aae363b99b4e661ecbf8e58c - 418c3e0efd2f32ed5cf2a6c341f8cc01 - e4485d143c300887097750993aa9d7da - 234f85adf2bddce704e6871b63bd125b - eea2f519124622e6fe36300893122aa2 - 0322a497dc6f9b186e481792ea2f7ca3 - 3d7fe64f59132114165d39e54d7f1224 - 459ec66d59cab903ab6c014f39a356ff - c8969efad9e74f6ae3dc50de12a571b1 - 2454fc825c8ec79d448bcec0fecabd1c - f9aca7a51be5e3082899c2c88a5fa467 - d0619669dd5186af6aef63b74f16fa9d - bbc68845c1e47c86efd0a93296f452eb - 101edc426d68a2343656c2c4676c101f - 323326cfb9904222ae062015dc3ce4c0 - 383ac1096fe034bba3029634a6dcb455 - 164c42c7d50f31e445b1552dbb5f02bc - 5dc88fafe05b9696682f8fa6fe7fbf1c - 1fadaa784421b497436cd5ab50ff91fb - eafb82c84bad2a854f9b9658b35f23eb - 3ab498f8dd34af4b66a0cff5fbdea866 - 69b47be2470f1b77a2048d664ef777ba - 394cf7eae9a4046fefa1721d9750ac40 - 301ba3d3d6dbca257e6b701238e1e1f6 - 00824c93f503c5d1680483abdf367948 9d6cafda168708e7330eb9f936cd08b9 67dacc40639f15c1a9064a4c3924e768 8592dc5461e592f6e7b21210507c71d5 @@ -777,6 +453,7 @@ + @@ -785,10 +462,14 @@ - - + + + + + + @@ -798,7 +479,7 @@ Motomachi - Fusion + Default 0 1 0 @@ -808,13 +489,13 @@ 0 1 0 - 1 + 0 0 1 0 0 0 - 1 + 0.9 1 0 1 @@ -833,10 +514,10 @@ 1 0 500 - 0 - 0 + 1 + 1 0 - FFmpeg + Qt Multimedia mpv 0 0 @@ -889,7 +570,7 @@ 11 - 4294967294 + 3 0 @@ -897,9 +578,9 @@ 0 - AdnQywADAAAAAAVYAAABjgAAB/EAAAMZAAAFWQAAAY8AAAfwAAADGAAAAAEAAAAAAp4AAAVZAAABjwAAB/AAAAMY + AdnQywADAAAAAABTAAAAnAAAAt0AAAI1AAAAVAAAAJ0AAALcAAACNAAAAAAAAAAABKgAAABUAAAAnQAAAtwAAAI0 - AdnQywADAAAAAAEQAAAAcAAAA7wAAAIxAAABEQAAAHEAAAO7AAACMAAAAAAAAAAABKgAAAERAAAAcQAAA7sAAAIw + AdnQywADAAAAAABpAAAAkgAABC0AAAKIAAAAagAAAJMAAAQsAAAChwAAAAAAAAAABKgAAABqAAAAkwAABCwAAAKH 0 @@ -912,6 +593,6 @@ 0 0 - AdnQywADAAAAAAW/AAABSAAAB3sAAANhAAAFwAAAAUkAAAd6AAADYAAAAAEAAAAAAp4AAAXAAAABSQAAB3oAAANg + AdnQywADAAAAAAGrAAAAVwAAA3MAAAJ6AAABrAAAAFgAAANyAAACeQAAAAAAAAAABKgAAAGsAAAAWAAAA3IAAAJ5 diff --git a/.config/goldendict/config.20240403_131232.bad b/.config/goldendict/config.20240403_131232.bad new file mode 100644 index 0000000..1c777d5 --- /dev/null +++ b/.config/goldendict/config.20240403_131232.bad @@ -0,0 +1,921 @@ + + + /mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0] + /mnt/Data/Chinese caligraphy dictionaries + /mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts + /mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation + /mnt/Reading/Wikipedia Japa + /mnt/Data/Documents/dict - concise encyclopedia of mathematics + /home/hashirama/Downloads/Port + /mnt/Data/Documents/english_dictionary + /mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0] + /mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0] + + + + 00824c93f503c5d1680483abdf367948 + 968c3a374ef50d74e019560ae8f69488 + 41e48e169f3b09f5d08c9821aa0e88af + 646c2fbd2278d23caf8bc5b44599f5aa + 6eb6f7a1df225e1cfdcd4cf8e9e4771b + 9d6cafda168708e7330eb9f936cd08b9 + 67dacc40639f15c1a9064a4c3924e768 + 8592dc5461e592f6e7b21210507c71d5 + c5e660551a5aa09c39bccd22efcd33f4 + a653c558afc8656ade4867dabb11fe23 + 2fece8563645b6e84d4eaff99538ce6c + 0a98ab8c8af8ee7add8c7c2188eab136 + bf6dc5853179da9462dfb48e3f2157c4 + 2e19989a059f306e37ad2af41c00f001 + dedcc77d6724124a34bd121c13601f12 + 04ddceca24590030ee166b154a2873e4 + 51586f8e48722c3dab296ae05a1e85b6 + 1c2caf45ae4387068cce7e1e5afc90c3 + c7c620d442d51a270407f7a655248a51 + 9dbe76f02d379e39ce7382320d7c48e4 + 96a1d4b781dc3befed561a76522813cc + 02204a83f8428db2a9674eda41eaaf3d + 487ea1b7fc70da0bc46e9e2c5c2fbee8 + 4d67da435ba47d3b5cec1fb861e7ba4e + ebc3d5467f47494e4022f187d7c005f3 + efd7989ba3aa4e149c77f2c9b32ba99b + e1ab6da4925cc083efa278ee19fba898 + d62ca33bbc240732af410dfedc8f1b5d + 16fc50393911f51f8fbdb884269e57c9 + 7c3c69859105dff873194749b0ca63e5 + 54ab08e73a91ab848a6ec0f27b59ee63 + 30f97e954dc3797bdbad39df84875102 + 156e4c2d5407db4c7dc6af55617b6d87 + 23bf0ce06d2b68a076557b4c34cf1a74 + c65655147d60a509f4edce63a7169591 + 88fd65e7fb390f94d2e2132ac29710b4 + 611e7de6f07e22aaf2a4b1f44e25edc5 + 327360418636b4aa4974485570a99e4f + ec855a5ed10fb99483666514453d9bac + fe85e18196d9cb64642ccf1c9f33333e + 12b8d1dbd030f671273ded541eebc19f + 10a9d298bac0c2ee581b4f8797f5190a + c8fa743ffd9c188c97a12cad60baad00 + f2f3fca4482e832d2b39e39931f1861e + 801d9d764983e59ff24a926dec6aed4d + 659a04f15265eecf861aebcd3bcb083b + 133436b45f37007263000dd395a5cb19 + 25cd6f7de778d3cb74f7604d77d0bc7a + 88e488e9aacaa0c842cfee322cfac7f5 + 1eca02efa0448b68a84780a410e5a7bd + d344dd2f97338b9e8020b6c88f56bf8a + 1e8ccbb28db547c88e67070ce902f7a5 + 8e56f7f4a7cf2d91e415dfe6b490eea5 + 98479bfb2a40e89b234b3b6c94ec022a + 9e126bda563afb18d08442183bd92a66 + 37cb697218b572b43bc73514311a67eb + e495d7042e6ecb2328294b5b59a0571c + 11988100677cc48fed517ffcd3d82a93 + 75445d96d28b777f98d5371ccc07120a + 2f3154090fcbf868689b9e8d596f7640 + 824237c92510f7294dc3672aa8423fcb + a53e4d4d940e52cdb56af46b57bd72bf + 19b05bea6db191cb558db4217af4cb4f + 05610f70181e350f9eaa9ee282b000fa + 5e4fac63fe96ba7f73cf2d693dd93cac + 5a560bd16b0c6cbd714faf0c388ae098 + 8fbb723ac88692225ef86e8b25c7b69d + fecd70b8f6b8958fdb65d59e96fd2109 + a071cd9d1d67821448b4a1f053be2a6b + bc6d965f29984c6f91419f14e26c1c7c + 434c9e54dcc6c5813b06817ecb45ed84 + 27d8ae1cc3af4fedcc78dda7e9362dcd + a7b49e4da2f438d7b4412a944331b141 + ee9263e59da6180234ff87d21c6690c3 + 95e86b66e5f5653922d09621408a629b + 92333eb2e229dd9b6fc3b064664f2cc9 + caa6c874eeb0a03ee36a16151b3a37b1 + 9411e07e04102258992ed0217b836307 + b8a7f9ecfb83e986a60fb667c1507e92 + a230e0adecdd573e26ecc7a87a5860b8 + 48cd59f2af6d16bc6a484a0b67d2a506 + f5848fec21cb6b839ec0c990f70b0459 + 6ac085bf1fd55977dfd9bd18499a06f1 + a2ab4670535dbf0367ac3643efc21e95 + d87cfc3f8f494936be4954ef33e9ab63 + 6dbac71fcf856b7223fc14ebc93309d7 + fc009097e705f5b55e61c069c73bf1e5 + 90d725f67d1a3aa64176c4a3eb133bf0 + eb83cca7907655b3b21065501dc5bad9 + 13589349f11f72acd1bc9090608aa38e + 4d47d534c0682c8c4f8ac872e358bb80 + 18618033fa596e5143a6970fe838df3b + b6a3c79fee981a0eefbb035edfa67839 + a9d2fa586867636d8a5323331334863b + f60affb79583cb692ba2bca6df57444d + c1b569986545666c134e039ddae1519e + 2a62ae0388baa7d416f4c9fdde70a8a0 + 4acefa6a69683ad470f27a51236b4f8b + 0ff76e9321dbee16ff6c250577a30ef0 + 11870f92ae0b157a8422fc78be1741fd + 093064615fab8a67e58f9f3fda5e1ac9 + b1e3f422135b95f15c0225ae27692050 + 09190d717c47ac453bcd67489a622a86 + 6dac50cdfb3265d22b966313a1d228b7 + 27ea5cfecf6d68fdf7dcbfd8df6f06f7 + 90259fffdd76764f7431170eeb89a0f9 + 29cc4b1fae1ee39411c691ecd1c00eb5 + 9f2d889846365f17d4d1f2c690996416 + 4452336dedfdbaa7bed0283317b85353 + aea83409a28a5830844e18d2bf7b3605 + 55a40fa62c52d35d1da84e22b482cad7 + 00a9ac5f0ee827e1556f14cf47e19d3d + ef768b427ba5d11925e7bfaa9c7e1d05 + 4aaedc0ae250b42bc8aaf2d735091565 + c516fc785c0241b43ed13e4e1e1caabc + b93665f7b1fc5dbd46b740d434c9fdba + a8c7d6e4e614d8ba5afff44b2000a133 + e138d3961665c48cefb39a45302bc83c + e9b0a26a8ad6cb82e7b8e6fc3158da03 + 7d39d07745b76d69665c09cbdb6e9d6e + a57af2b409324b63f8a480cacc7be75a + 86434219cff9e8d19a088608607c9c06 + c5cd1defbdf56b37788042d597d85586 + bc51b1f9b816c316eae12fdacf3e4ed8 + 66332bb70b8da80bf54cd4a0bed8eab6 + 2e03869cdf0661fedb9c62a7c18f3d3c + 1ada2fe066091f9a4359183fa853a82c + 2efba112cbf507a888ddacac197fc6e8 + 03d6d969418271df751af401bf2761db + 21bcd9dafb548fcade20f49cbc297ebc + 0aafbadc4551593b53f9b9725abb0a16 + 28ce5ef209eefa1d09867dcfe56f68b9 + 8c6bd976fd334b801e6ed183d62ca6af + b497d4ab65170af150b22df540d0a2a2 + 2cfdf122338dff2daf27afee627ef8bd + 59b128e529222bb6befc422142585545 + 92c8016b345793461ad75791a86a3d2f + ce47834eb965547d439f161c55c7f67f + 710eab1b84747b8a411884c2c57f9dbb + 885330a052380572d9dcbfd488e9e580 + 1798572e78293506e7a7fee523dd6b5c + 9c41547647e9443116cff925d644c8c6 + 0af6e512737d6c694ffda901b81ea20b + c1236cd9aae363b99b4e661ecbf8e58c + 418c3e0efd2f32ed5cf2a6c341f8cc01 + 0c6cbfc1abfb5cfaae79e9bf792d7c51 + e4485d143c300887097750993aa9d7da + 234f85adf2bddce704e6871b63bd125b + eea2f519124622e6fe36300893122aa2 + 0322a497dc6f9b186e481792ea2f7ca3 + 3d7fe64f59132114165d39e54d7f1224 + f7ffa4317e18421ad132877637b7982e + 459ec66d59cab903ab6c014f39a356ff + c8969efad9e74f6ae3dc50de12a571b1 + 2454fc825c8ec79d448bcec0fecabd1c + f9aca7a51be5e3082899c2c88a5fa467 + d0619669dd5186af6aef63b74f16fa9d + bbc68845c1e47c86efd0a93296f452eb + 101edc426d68a2343656c2c4676c101f + 323326cfb9904222ae062015dc3ce4c0 + bf9513ddc9e38c466d4898319079e255 + 383ac1096fe034bba3029634a6dcb455 + 164c42c7d50f31e445b1552dbb5f02bc + 5dc88fafe05b9696682f8fa6fe7fbf1c + 1fadaa784421b497436cd5ab50ff91fb + eafb82c84bad2a854f9b9658b35f23eb + 3ab498f8dd34af4b66a0cff5fbdea866 + 69b47be2470f1b77a2048d664ef777ba + 394cf7eae9a4046fefa1721d9750ac40 + 301ba3d3d6dbca257e6b701238e1e1f6 + b072a05ab5a78a388aa6db2ae5131550 + e2ecb75e6e785162b0aa2f3a94244031 + 4df26ca9d2ac13f6b427bb2b58711382 + 3e7558b58a64e368cd421422435407b2 + a117e62d0161f73e5ccd2692da72d554 + 16727ea57afd44654955017259c465ee + 297372fa6e2373d7f55bf155952a9c83 + 0484aa1d2405cbf4084b6a0f2d758f38 + d5132c7e44e6ba65460e66312198cc4f + b223402d203c20a980efeab2fd3594cc + a857b5b8a009671eec93d5545a8633a2 + 9f51b6ab7dbb42d2d9e0f6645885f43b + 19b8dc1e55adffdf3553b5b45ef00517 + 5275312850f1068144272ce22fa53132 + 8dd0aa4f4961c07eba109e6083f6e92e + accb179c9ae61c64e574ae3907c3e3e4 + 7b6de7954354ed1558475674685d2139 + 2b72ecab5781f43b92fa61a95f70b44e + aa368196f1aa18a2aa00d7d90eb68d79 + 47723eaa989a140ae761a73ccef0ad74 + ab04767f78051ea72534ead167c46a7e + 43d3033b997cfb3b86ba41842c70d9bc + 0bbbb95c81efc0341f6be50b3dd07e0f + 0b7d3b7ab9ce129f8f1468199645b9fa + 76c29ce6488ef58f6fb59232e1c234f9 + 09c4d84b2cf5a9a18b6d67066b3c50e4 + d37bebac02fd8635d456a8e0ebee69f0 + a55513cc946f2bc065056d750ce3084b + 4a9a3d0091a7e6e4452c821484ef265c + 3239558cf13b5ed72adb871aa8a18ead + 4c09400bf0f4f24f9b0544fb05467b3d + 30c4224efb876ba21c6f5a1db22909f9 + 3bd60af5edb9a139ab4844ce5900d50d + 3ff8c47f8a7b655f54cba4923448074e + 6897ed5b058db74e575da6d1775a97bb + b10e50122f4642d845f2b1683f9e6fd9 + 8bdb718ed4030036946d1ca72f55002b + 5c1d863f7c7f671dfdd13dfc27df0f1e + 8eacc3113fb03d05607e85e8440dda66 + 9b5d3509deefc3a8a59332f33dc8ee28 + 3f7b5d783074ce39d51fadec9ecc13a5 + c172ecafbe36afc163313b1be856f090 + d874fff5195c853b3c0e4cb28a84ccd9 + 6555c429b526ea752b4952274822e978 + cc16a2a0d9a3a5d51ae501435ab63a6c + f84cff606a8fc794e79f6547badaddc2 + 5bbfb17ed1d2074c5319a6df09972e59 + db46db216048708cd1117d7c40c44903 + 226c1a378284bddbab006b58f2bed912 + e56e5730e20de70e2fdbcf3c0c75f6d2 + 1bf304efdcb8df8731229f3ce4e428e8 + 0706014ea3154a3f5cad140d5514da5b + 3a33eea57e761743d83c97260c632ff6 + 879631ffaa14328a6f61187780c8a3b3 + 5e8b7121d5340488cf23fb68476608c7 + 5b1575090dc44a089162111a4db83a2a + 8c445ed601d2249b4c825cdfff4e2352 + 842aedaaee2e4a98d7fe74bb28c70a3c + a66d5e4ce689d103ae50d48befb3e620 + 39be06a7dbe05c5fbd3d54ed36a2f1dc + be0d59795041d059517abfcae545030d + 63b4f589b0c48b00cc1800399ff0eb99 + 3fb08bd228ebd85ae4c6f7cc3974f204 + ce88287767a8cfd103f2e3a826ed5b18 + 84d3926350ba998c7ae4fc7dea933706 + fd24df18234ff107f54c03c2eb7a555c + 8147ebee0008c141c65be596f6a2c730 + 47c3848bbf0782065704e992583a588e + fa941f06f3ce424f92ce2d650c7c12c6 + 521ba4885dd059a0247d6b1fdc511762 + 5d95d144ed251ae7ab7d2d103fa9e7ee + b58f0eafb5ef458de194d566baa1e1d5 + dc4f126e01a2fbf4493717b3e2d28a63 + 24531cdbc7a749ab1d08f2c1a2e27df4 + 823ba1fbcdd1320f539ff73e47bbac6d + 68d823d00a85dbee59c610988a68aa21 + 137031dc413d3fee4efb5364436c1f06 + ca1d5c96cfdd27c2d09c263a086fcee0 + 9ce7acb57ab4a93560ef3c21b2548958 + a11a58202ef444f1440d38570f513e38 + 4cf2c0e0d583a092e87369015427e27d + 7428ae020e19a7a82a5eb26aa0687a3c + 80bf160f10f4650ebbd5a2c01914b445 + 52a4cc2fb1a0640ae18acf15bb3f36b7 + f3062ce86397e447199206d4bd3e8e7a + 146a0d00f75dcf6e0c4b1d92aad398bd + a74598d8d011a692124f4930529c5f00 + 0af974c012f64c3ad9e7bf0ec6892f2d + 9e5db1b303759525f198758ff5f382fe + e1ae71caec385e83c31ef7b419a1ff1a + cf896687b7d7662199c63e055c9f8201 + 047f16cc5bc5812cd0dad9ebccc8bb42 + 6dc733a38cada80e3735ac8f325d0aad + e0ef5582bc9d9f64613d9bc44f862fa6 + 1badd80dadef90f3cb1da0892db414b4 + d41561b0db7f60e344c8fdd0ec62eda7 + 2cd6ade57d818c51351adc4d399f6a32 + 1ac2464ef33d31ddfaac5db525a15f2e + ba4daf0175b1457297ad4ebe8504a690 + 3d951a2c57c9306658b07be28e714aed + cf5769b67c58027b2eddd174e78cbcb4 + 2a8509524dfba1ae3c78fd6da9443d10 + 73a92a4d952f7c6d621a0b23cf45f5f9 + 687de42ee8cd26a1857e5ddc37ace9f3 + d25231514b681b49c39d59c26ff3c0a1 + 1a273954b9caccaddef4c12797f5c67d + da25f08229b565857d6f66217721ac1b + e687e18e0422aeb3767e6b1d6f7f33e4 + da008cae049016579164b5c82273718f + 27ffb7fdb1d580f4bd750c86bba22320 + f08e58f48686a2c6da895e5f85bf0380 + 6aa34e6a3b560d9b49c11829e7df54d8 + 6ccd9806f72c8a16f7fed1ec57eb5ff0 + 122270a5d92707191454250859d425fe + 18b7db37e9f7a7dc203ac9a15825ed8a + fdc0288fded07a57ce4cd752c5f782fb + 11c97cac9f47c4535e8673900c554efe + 34a34d0936b5e4ea2245c9142c517e5e + 49a80b2c231e54f55c2b6673831a23be + 0d15c464ed6f47f23ebc2734f80266ec + a23a3bb5dba9eec8280573c7766619ef + 7c3a8e96a3b168cada45e29c49a2f055 + f63dc6ef338cc1fe1e03ea204b20c556 + 27496e15a6643e68ffe01bee2358eec6 + ee20cd730b59ad5f6c832f39ceb7e0c8 + f60a424d9b635ee9d1c54f1b6d3d2cd1 + 3ee608107ff1d1d39765c3e10b08bfd5 + 1a7c6fdac4f6c37e61e76e9c73b5951f + 4a43ac6ac9ca1a6235128a09eb686ba5 + 0df0c67aa159000bcb3e22522e504ce1 + 81d065e529ef15fef99f3314715a1fd3 + 4ce638e1f9f87481de9ec342440c1753 + 793c41bba28c8d324fc44df3ff42c8c8 + 8282abf3ea32251156a3933ac08b0a03 + a31eec2856e449558b0bd9576af7b36c + 0310d55ef013d5eb96846e6018a200e0 + 38aef41cd62e0cb8b19927511ad10243 + d2577d64470777ebe0a71dda1b0c1532 + 0a882f3f56a32244889e9188b63e6221 + fc48d1fd6efab5b9763a20d651d8a9a3 + 835186c537d860e65f29918d6fce8f2b + 847a695d4b6573f656a698e68e233f55 + 4491dc5b7b2bead2807e9efc95755f86 + 140fce261119cd8064d3c45be90cb11c + c00269d562de62d756d51b9e402e3a77 + fcf5ba6d7310b6a4711dfff841ddc7c1 + 88919fa89de8ed742eae06ba2c03246b + 8e135e0331c329e68f6bb7a819484772 + 6080d6865c3afa8f65bf6627486e6327 + aa7f5a27f1fa955899eb1611d4a91367 + 76920f4e8caf20bf370acb7fea5fc232 + 439501f369c57bb5d3f0933b088cb23f + 7621ab8dbcc868868042cbbd3a012938 + 7363ba2e34cddead0f19a4a2ec51304e + ab6643336366d243d73d1ce4b7fd8b8d + 71ac9bc6d781652a85341bcf5a7fd63c + 246877bcee272e7cfeb9be1aba1d90a8 + 727597d1015ede1f019990d436029401 + f2d2b922b18e2aca15d9393432e55acf + 3104730a87f22520c663a5e19bfb43d7 + 5095eebb92b67c625681e279a9ddb956 + 7d1e3222760093eb3b23e9be3132db7e + df57c33b50fc1616bd9760f202d931dc + f046ad91797591ce8423c7fec8244a48 + 2ada8c44aefb4c1d63d8b1f475790ff4 + c925dba17d4c08afef46d3a9babfe6aa + 0119199a882067160524c7c8346f5b5f + e43421f6039418916c33c309fe43f524 + 5f54be670d573a44786b279f1054afd9 + 1f2c9fe9cf455222c55744698939e5be + de8539d9b8d3b118527c1109263cbc5c + 369fcfe4bca53efbe0f2aecb705fbfe9 + bb678a0887728b5c8583f9945b223de0 + 45c23686533e619591a88c9563d2bd9f + 32d1e9b63bfa50c100fa10b5c01bcfd2 + 24e8e5ab864abb4aa3312bb40ce9317d + 88aa7a1d6baf45f61b0e85c88d8821de + e3752504166f5cf60a37838c15ffb6e1 + 4b3ccc63bda5eb2b07c93a42e5645752 + eb8c7ff3f23870e9357f78350cd33409 + b4a86d673ae98888463926f0fe0eb93c + 06440efa3e7784a4b3b075664ce10aca + 00b7200ae63a27020604b8ed2be51413 + 76350919762e82534a7c06cfd235b29c + 88c823c125f75f4b39fbd6632049c335 + ede8d80c3eb1c2bf8d48b32714295b89 + 69012e49a9b1bb44848ace9b2ec951d0 + d78f5c2a5b4be4c16fdd7d076b2c36e7 + 69c86ae87d4c77c3a5313897450438b6 + 1037eb14e49cf4d92df113cf7195ad9c + 03dd5fea11851b84367d56812d9e937b + ec671d028899377bc49e4b985152fac8 + 2c1f5e5fc32dd0013f7a7b503d8e0fe7 + 750cf26a0f906131e82c911d30d69817 + e3b2c615bb4b96b895fd7305e63d4eb8 + cd7d685c29628608ffe8e8412d333c3b + 86b6642d85e0e7dbc751a2da0180cc92 + 742458ef15221270478f17f6ad101349 + d15bab594e3c37d1b9a24a0f0fc826c6 + 131dd1a7f052829fa8d5c5d027ecabff + 7209deeae810d9ce419042c3741bbc6b + 0621d7a04e9bd24cb67fbffa9dfdf255 + 5672141bb28e74f28e750058bfca0956 + c3bba9ed1957c4d6553f24a97adf0202 + f26420c7eb1d59c1076d59ccf790a337 + 8431bdd6831e3f351ad8799dc6d42d73 + 304a839a02ce8080037171de2de2d336 + fd22dd8651fc9f5383ca576b5ed6a3cf + c63783324ee9b8fc3309849bd8302845 + d0e35c7d8c2b432d0a57cdf7941f912a + 38386df88d70b0c53b53e9b70967bf8e + 0c31f468bbb31b720212d9a43bb8e0e6 + fb4e6f53358b387157bec73b6cbe4c8c + 5d65d1ab328015eb653aee967473bd74 + 36a7df6c1b1d19a4e7df65b79fa98a67 + 0dc93d9e25edee78f80b6c12013b4d9a + 888d7bb796756084542d33d9c6e0685f + 0a5c32cda34c580f09fd0b5fc015e1b3 + cb8bfcfc5c40f1be931fb77ea3d87a35 + 97295be38a11d07b041a97b8144cb152 + 6d08802a63843c048824d298989b7148 + 68ea7837dab9dc82d592a7762c4e8092 + 23e549f189b1238b16b9c6a2fc2860f0 + 9555ad75cc71bb2fae65d727461d9491 + 57580e9510eff07fbfadf18ab38bfff9 + 51d0aca38b7daa3af4bce0ffb80c9a05 + 77635cf22dadc58222f44f3c4f281c1f + f6038dc4737356a34acc5a0c8a194f4a + 8dda33ca157805525b1038e6fef3b56c + 43bc82454c7f9962132daee50f10e63b + 1ff8c16f062c3594bf3a2b7731ed6b3a + 9106e7a93950af3f2f2d85639e8c3b52 + 9a781282093a2876df59abcc93211a8c + bf3e39f961140a032bf1ce5c2ccb5f2e + c04d948475cdcdc9d67bb55c3a3a9f97 + beff7e27e1524488737863670baf6a02 + 2aad2f4bde96c08dfcd3f74a3c059c47 + c19e2efac3997ad6526397871b17ed64 + be16270962d0b2bed8c4cdd17c2f3fba + 5753225f03ba34f569607f3c478f4640 + 6be5a60aca51661940ab7d1ea6bb3eb0 + fa29e7508eb48174bffbf1136626272e + 2b8fd1ec21f696a7555fc79ddab11c46 + 15dc6c2ceb8fad91d2c5108e769ee975 + da98026eab06abf17ac40ed646749a6e + ecd5393ffa5e194299db60b98d3bbf60 + be6632714ae524d05bf09baf7c349776 + 6a6a5c52d6d649f9acc717191cb1f3fd + + + + + + + + 00824c93f503c5d1680483abdf367948 + 7363ba2e34cddead0f19a4a2ec51304e + 6a6a5c52d6d649f9acc717191cb1f3fd + 968c3a374ef50d74e019560ae8f69488 + 646c2fbd2278d23caf8bc5b44599f5aa + d344dd2f97338b9e8020b6c88f56bf8a + 41e48e169f3b09f5d08c9821aa0e88af + 5095eebb92b67c625681e279a9ddb956 + 3104730a87f22520c663a5e19bfb43d7 + f2d2b922b18e2aca15d9393432e55acf + 246877bcee272e7cfeb9be1aba1d90a8 + 133436b45f37007263000dd395a5cb19 + f2f3fca4482e832d2b39e39931f1861e + f60affb79583cb692ba2bca6df57444d + b1e3f422135b95f15c0225ae27692050 + 71ac9bc6d781652a85341bcf5a7fd63c + 2ada8c44aefb4c1d63d8b1f475790ff4 + e43421f6039418916c33c309fe43f524 + 5672141bb28e74f28e750058bfca0956 + c3bba9ed1957c4d6553f24a97adf0202 + f26420c7eb1d59c1076d59ccf790a337 + 8431bdd6831e3f351ad8799dc6d42d73 + c63783324ee9b8fc3309849bd8302845 + d0e35c7d8c2b432d0a57cdf7941f912a + fd22dd8651fc9f5383ca576b5ed6a3cf + 304a839a02ce8080037171de2de2d336 + 38386df88d70b0c53b53e9b70967bf8e + 0c31f468bbb31b720212d9a43bb8e0e6 + fb4e6f53358b387157bec73b6cbe4c8c + 36a7df6c1b1d19a4e7df65b79fa98a67 + 0dc93d9e25edee78f80b6c12013b4d9a + 0a5c32cda34c580f09fd0b5fc015e1b3 + cb8bfcfc5c40f1be931fb77ea3d87a35 + 888d7bb796756084542d33d9c6e0685f + 97295be38a11d07b041a97b8144cb152 + 6d08802a63843c048824d298989b7148 + 68ea7837dab9dc82d592a7762c4e8092 + 23e549f189b1238b16b9c6a2fc2860f0 + aa368196f1aa18a2aa00d7d90eb68d79 + 47723eaa989a140ae761a73ccef0ad74 + ab04767f78051ea72534ead167c46a7e + 43d3033b997cfb3b86ba41842c70d9bc + 0b7d3b7ab9ce129f8f1468199645b9fa + 76c29ce6488ef58f6fb59232e1c234f9 + 09c4d84b2cf5a9a18b6d67066b3c50e4 + d37bebac02fd8635d456a8e0ebee69f0 + 4a9a3d0091a7e6e4452c821484ef265c + 3239558cf13b5ed72adb871aa8a18ead + 4c09400bf0f4f24f9b0544fb05467b3d + 30c4224efb876ba21c6f5a1db22909f9 + 3bd60af5edb9a139ab4844ce5900d50d + 3ff8c47f8a7b655f54cba4923448074e + 6897ed5b058db74e575da6d1775a97bb + b10e50122f4642d845f2b1683f9e6fd9 + 8bdb718ed4030036946d1ca72f55002b + 9b5d3509deefc3a8a59332f33dc8ee28 + d874fff5195c853b3c0e4cb28a84ccd9 + 6555c429b526ea752b4952274822e978 + cc16a2a0d9a3a5d51ae501435ab63a6c + db46db216048708cd1117d7c40c44903 + 226c1a378284bddbab006b58f2bed912 + e56e5730e20de70e2fdbcf3c0c75f6d2 + 1bf304efdcb8df8731229f3ce4e428e8 + 0706014ea3154a3f5cad140d5514da5b + 879631ffaa14328a6f61187780c8a3b3 + 5e8b7121d5340488cf23fb68476608c7 + 5b1575090dc44a089162111a4db83a2a + 8c445ed601d2249b4c825cdfff4e2352 + 842aedaaee2e4a98d7fe74bb28c70a3c + a66d5e4ce689d103ae50d48befb3e620 + 39be06a7dbe05c5fbd3d54ed36a2f1dc + be0d59795041d059517abfcae545030d + 63b4f589b0c48b00cc1800399ff0eb99 + 3fb08bd228ebd85ae4c6f7cc3974f204 + ce88287767a8cfd103f2e3a826ed5b18 + 84d3926350ba998c7ae4fc7dea933706 + fd24df18234ff107f54c03c2eb7a555c + 8147ebee0008c141c65be596f6a2c730 + 47c3848bbf0782065704e992583a588e + fa941f06f3ce424f92ce2d650c7c12c6 + 521ba4885dd059a0247d6b1fdc511762 + 5d95d144ed251ae7ab7d2d103fa9e7ee + b58f0eafb5ef458de194d566baa1e1d5 + dc4f126e01a2fbf4493717b3e2d28a63 + 24531cdbc7a749ab1d08f2c1a2e27df4 + 823ba1fbcdd1320f539ff73e47bbac6d + 68d823d00a85dbee59c610988a68aa21 + 137031dc413d3fee4efb5364436c1f06 + ca1d5c96cfdd27c2d09c263a086fcee0 + 9ce7acb57ab4a93560ef3c21b2548958 + a11a58202ef444f1440d38570f513e38 + 4cf2c0e0d583a092e87369015427e27d + 7428ae020e19a7a82a5eb26aa0687a3c + 80bf160f10f4650ebbd5a2c01914b445 + 52a4cc2fb1a0640ae18acf15bb3f36b7 + f3062ce86397e447199206d4bd3e8e7a + 146a0d00f75dcf6e0c4b1d92aad398bd + a74598d8d011a692124f4930529c5f00 + 0af974c012f64c3ad9e7bf0ec6892f2d + cf896687b7d7662199c63e055c9f8201 + 047f16cc5bc5812cd0dad9ebccc8bb42 + 6dc733a38cada80e3735ac8f325d0aad + e0ef5582bc9d9f64613d9bc44f862fa6 + 1badd80dadef90f3cb1da0892db414b4 + d41561b0db7f60e344c8fdd0ec62eda7 + 2cd6ade57d818c51351adc4d399f6a32 + 1ac2464ef33d31ddfaac5db525a15f2e + d25231514b681b49c39d59c26ff3c0a1 + 1a273954b9caccaddef4c12797f5c67d + da25f08229b565857d6f66217721ac1b + e687e18e0422aeb3767e6b1d6f7f33e4 + da008cae049016579164b5c82273718f + 27ffb7fdb1d580f4bd750c86bba22320 + f08e58f48686a2c6da895e5f85bf0380 + 6aa34e6a3b560d9b49c11829e7df54d8 + 18b7db37e9f7a7dc203ac9a15825ed8a + fdc0288fded07a57ce4cd752c5f782fb + 11c97cac9f47c4535e8673900c554efe + 76920f4e8caf20bf370acb7fea5fc232 + 439501f369c57bb5d3f0933b088cb23f + 7621ab8dbcc868868042cbbd3a012938 + ab6643336366d243d73d1ce4b7fd8b8d + 6dac50cdfb3265d22b966313a1d228b7 + 69012e49a9b1bb44848ace9b2ec951d0 + 727597d1015ede1f019990d436029401 + df57c33b50fc1616bd9760f202d931dc + 7d1e3222760093eb3b23e9be3132db7e + c925dba17d4c08afef46d3a9babfe6aa + f046ad91797591ce8423c7fec8244a48 + 9555ad75cc71bb2fae65d727461d9491 + 57580e9510eff07fbfadf18ab38bfff9 + 77635cf22dadc58222f44f3c4f281c1f + 51d0aca38b7daa3af4bce0ffb80c9a05 + f6038dc4737356a34acc5a0c8a194f4a + 8dda33ca157805525b1038e6fef3b56c + 43bc82454c7f9962132daee50f10e63b + 9106e7a93950af3f2f2d85639e8c3b52 + + 6dac50cdfb3265d22b966313a1d228b7 + + + + ecd5393ffa5e194299db60b98d3bbf60 + 9a781282093a2876df59abcc93211a8c + bf3e39f961140a032bf1ce5c2ccb5f2e + c04d948475cdcdc9d67bb55c3a3a9f97 + beff7e27e1524488737863670baf6a02 + 2aad2f4bde96c08dfcd3f74a3c059c47 + c19e2efac3997ad6526397871b17ed64 + be16270962d0b2bed8c4cdd17c2f3fba + 5753225f03ba34f569607f3c478f4640 + 6be5a60aca51661940ab7d1ea6bb3eb0 + fa29e7508eb48174bffbf1136626272e + 2b8fd1ec21f696a7555fc79ddab11c46 + 15dc6c2ceb8fad91d2c5108e769ee975 + da98026eab06abf17ac40ed646749a6e + + + + 00824c93f503c5d1680483abdf367948 + 968c3a374ef50d74e019560ae8f69488 + ec855a5ed10fb99483666514453d9bac + b1e3f422135b95f15c0225ae27692050 + 6dac50cdfb3265d22b966313a1d228b7 + 5a560bd16b0c6cbd714faf0c388ae098 + 90259fffdd76764f7431170eeb89a0f9 + 27ea5cfecf6d68fdf7dcbfd8df6f06f7 + 156e4c2d5407db4c7dc6af55617b6d87 + 23bf0ce06d2b68a076557b4c34cf1a74 + + 27ea5cfecf6d68fdf7dcbfd8df6f06f7 + 6dac50cdfb3265d22b966313a1d228b7 + + + + 8dd0aa4f4961c07eba109e6083f6e92e + e2ecb75e6e785162b0aa2f3a94244031 + 9f51b6ab7dbb42d2d9e0f6645885f43b + 0484aa1d2405cbf4084b6a0f2d758f38 + 16727ea57afd44654955017259c465ee + 5275312850f1068144272ce22fa53132 + 297372fa6e2373d7f55bf155952a9c83 + 19b8dc1e55adffdf3553b5b45ef00517 + 4df26ca9d2ac13f6b427bb2b58711382 + 3e7558b58a64e368cd421422435407b2 + a117e62d0161f73e5ccd2692da72d554 + b072a05ab5a78a388aa6db2ae5131550 + d5132c7e44e6ba65460e66312198cc4f + b223402d203c20a980efeab2fd3594cc + a857b5b8a009671eec93d5545a8633a2 + 7b6de7954354ed1558475674685d2139 + accb179c9ae61c64e574ae3907c3e3e4 + + + + 09190d717c47ac453bcd67489a622a86 + + + + f7ffa4317e18421ad132877637b7982e + bf9513ddc9e38c466d4898319079e255 + 0c6cbfc1abfb5cfaae79e9bf792d7c51 + 29cc4b1fae1ee39411c691ecd1c00eb5 + 9f2d889846365f17d4d1f2c690996416 + 4452336dedfdbaa7bed0283317b85353 + aea83409a28a5830844e18d2bf7b3605 + 55a40fa62c52d35d1da84e22b482cad7 + 00a9ac5f0ee827e1556f14cf47e19d3d + ef768b427ba5d11925e7bfaa9c7e1d05 + 4aaedc0ae250b42bc8aaf2d735091565 + c516fc785c0241b43ed13e4e1e1caabc + b93665f7b1fc5dbd46b740d434c9fdba + a8c7d6e4e614d8ba5afff44b2000a133 + e138d3961665c48cefb39a45302bc83c + e9b0a26a8ad6cb82e7b8e6fc3158da03 + 7d39d07745b76d69665c09cbdb6e9d6e + a57af2b409324b63f8a480cacc7be75a + 86434219cff9e8d19a088608607c9c06 + c5cd1defbdf56b37788042d597d85586 + bc51b1f9b816c316eae12fdacf3e4ed8 + 66332bb70b8da80bf54cd4a0bed8eab6 + 2e03869cdf0661fedb9c62a7c18f3d3c + 1ada2fe066091f9a4359183fa853a82c + 2efba112cbf507a888ddacac197fc6e8 + 03d6d969418271df751af401bf2761db + 21bcd9dafb548fcade20f49cbc297ebc + 0aafbadc4551593b53f9b9725abb0a16 + 28ce5ef209eefa1d09867dcfe56f68b9 + 8c6bd976fd334b801e6ed183d62ca6af + b497d4ab65170af150b22df540d0a2a2 + 2cfdf122338dff2daf27afee627ef8bd + 59b128e529222bb6befc422142585545 + 92c8016b345793461ad75791a86a3d2f + ce47834eb965547d439f161c55c7f67f + 710eab1b84747b8a411884c2c57f9dbb + 885330a052380572d9dcbfd488e9e580 + 1798572e78293506e7a7fee523dd6b5c + 9c41547647e9443116cff925d644c8c6 + 0af6e512737d6c694ffda901b81ea20b + c1236cd9aae363b99b4e661ecbf8e58c + 418c3e0efd2f32ed5cf2a6c341f8cc01 + e4485d143c300887097750993aa9d7da + 234f85adf2bddce704e6871b63bd125b + eea2f519124622e6fe36300893122aa2 + 0322a497dc6f9b186e481792ea2f7ca3 + 3d7fe64f59132114165d39e54d7f1224 + 459ec66d59cab903ab6c014f39a356ff + c8969efad9e74f6ae3dc50de12a571b1 + 2454fc825c8ec79d448bcec0fecabd1c + f9aca7a51be5e3082899c2c88a5fa467 + d0619669dd5186af6aef63b74f16fa9d + bbc68845c1e47c86efd0a93296f452eb + 101edc426d68a2343656c2c4676c101f + 323326cfb9904222ae062015dc3ce4c0 + 383ac1096fe034bba3029634a6dcb455 + 164c42c7d50f31e445b1552dbb5f02bc + 5dc88fafe05b9696682f8fa6fe7fbf1c + 1fadaa784421b497436cd5ab50ff91fb + eafb82c84bad2a854f9b9658b35f23eb + 3ab498f8dd34af4b66a0cff5fbdea866 + 69b47be2470f1b77a2048d664ef777ba + 394cf7eae9a4046fefa1721d9750ac40 + 301ba3d3d6dbca257e6b701238e1e1f6 + + + + 00824c93f503c5d1680483abdf367948 + 5d65d1ab328015eb653aee967473bd74 + 888d7bb796756084542d33d9c6e0685f + 9d6cafda168708e7330eb9f936cd08b9 + 67dacc40639f15c1a9064a4c3924e768 + 8592dc5461e592f6e7b21210507c71d5 + c5e660551a5aa09c39bccd22efcd33f4 + a653c558afc8656ade4867dabb11fe23 + 2fece8563645b6e84d4eaff99538ce6c + 0a98ab8c8af8ee7add8c7c2188eab136 + bf6dc5853179da9462dfb48e3f2157c4 + 2e19989a059f306e37ad2af41c00f001 + dedcc77d6724124a34bd121c13601f12 + 04ddceca24590030ee166b154a2873e4 + 51586f8e48722c3dab296ae05a1e85b6 + 1c2caf45ae4387068cce7e1e5afc90c3 + 9dbe76f02d379e39ce7382320d7c48e4 + 96a1d4b781dc3befed561a76522813cc + 02204a83f8428db2a9674eda41eaaf3d + + + + + + 0 + 0 + 0 + 0 + + 0 + 1 + 1 + 1 + + + 0 + 1 + 0 + 0 + 1 + 1 + + + 0 + + + + + 1 + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Motomachi + + + Fusion + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 0 + 1 + Ctrl+F11, F11 + 1 + Ctrl+C, C + 1 + 0 + 0 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 500 + 0 + 0 + 0 + FFmpeg + mpv + 0 + 0 + 0 + 1 + 1 + + 0 + + 3128 + + + + + + + 127.0.0.1 + 8765 + + + selected_text + word + marked_sentence + + 1 + 0 + 0 + 50 + 1 + 0 + 500 + 1 + 1 + + 0 + 2000 + 0 + 1000 + 20 + 1 + 0 + 0 + + 0 + + + 0 + 0 + 0 + 32 + + + 5 + 0 + + + 0 + 0 + + + AdnQywADAAAAAAVYAAABjgAAB/EAAAMZAAAFWQAAAY8AAAfwAAADGAAAAAEAAAAAAp4AAAVZAAABjwAAB/AAAAMY + + AdnQywADAAAAAAVYAAABQwAACEsAAAM5AAAFWQAAAUQAAAhKAAADOAAAAAEAAAAAAp4AAAVZAAABRAAACEoAAAM4 + + + 0 + 0 + + 256 + 0 + + 0 + 0 + 0 + + AdnQywADAAAAAAW/AAABSQAAB3oAAANgAAAFwAAAAUoAAAd5AAADXwAAAAEAAAAAAp4AAAXAAAABSgAAB3kAAANf + + diff --git a/.config/goldendict/favorites b/.config/goldendict/favorites index 5fdac45..0e72e1a 100644 --- a/.config/goldendict/favorites +++ b/.config/goldendict/favorites @@ -4,4 +4,19 @@ 悔しい reproductible 転生したら剣でした + 違和感 + ゆっくり + + 地獄の苦しみ + 納得が行く + 意識 + 猿猴捉月。 + 煽情的 + 道徳 + うらめ + パコる + かかりきり + 掛りっ切り + 気管支喘息 + ちいっと diff --git a/.config/goldendict/gd_log.txt b/.config/goldendict/gd_log.txt new file mode 100644 index 0000000..d48cc8e --- /dev/null +++ b/.config/goldendict/gd_log.txt @@ -0,0 +1,13568 @@ +Warning: 05-18 11:47:23 Path override failed for key base::DIR_APP_DICTIONARIES and path '/gnu/store/rfavr4qpam329q0qyp4zmjkavvlkzplj-goldendict-ng-24.05.05/bin/qtwebengine_dictionaries' +Debug: 05-18 11:47:23 handle path: "/mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 11:47:23 handle path: "/mnt/Data/Chinese caligraphy dictionaries" +Debug: 05-18 11:47:23 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts" +Debug: 05-18 11:47:23 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 11:47:23 Epwing: found "EIDAI6" +Warning: 05-18 11:47:23 "Epwing dictionary initializing failed: , error: EB library report error EB \"eb_set_subbook\" function error: EB_ERR_FAIL_OPEN_TEXT (failed to open a text file)\n" +Debug: 05-18 11:47:23 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 11:47:23 Epwing: found "HYOGEN" +Debug: 05-18 11:47:23 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 11:47:23 Epwing: found "RUIGIGO" +Debug: 05-18 11:47:24 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 11:47:24 Epwing: found "RUIGIGO" +Debug: 05-18 11:47:25 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 11:47:25 Epwing: found "ENCY" +Debug: 05-18 11:47:25 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 11:47:25 Epwing: found "Snmkg99" +Debug: 05-18 11:47:25 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 11:47:25 Epwing: found "BODY" +Debug: 05-18 11:47:25 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 11:47:25 Epwing: found "MEIKYOJJ" +Debug: 05-18 11:47:25 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation" +Debug: 05-18 11:47:25 handle path: "/mnt/Reading/Wikipedia Japa" +Debug: 05-18 11:47:25 handle path: "/mnt/Data/Documents/dict - concise encyclopedia of mathematics" +Debug: 05-18 11:47:25 handle path: "/home/hashirama/Downloads/Port" +Debug: 05-18 11:47:25 handle path: "/mnt/Data/Documents/english_dictionary" +Debug: 05-18 11:47:25 handle path: "/mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0]" +Debug: 05-18 11:47:25 handle path: "/mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 11:47:25 Load done + +Debug: 05-18 11:47:25 Loading 198 abbrv + +Debug: 05-18 11:47:25 Loading 210 abbrv + +Debug: 05-18 11:47:25 Loading 183 abbrv + +Debug: 05-18 11:47:25 Loading 200 abbrv + +Debug: 05-18 11:47:25 starting create the fts with thread: 11 +Debug: 05-18 11:47:25 waiting for all the fts creation to finish. +Debug: 05-18 11:47:25 finished/cancel all the fts creation +Debug: 05-18 11:47:25 Reloading all the tabs... +Debug: 05-18 11:47:25 Reloading all the tabs... +Debug: 05-18 11:47:25 reset inspector +Debug: 05-18 11:47:25 getResource: "gdlookup://localhost/?word=Welcome!&group=4294967295" +Debug: 05-18 11:47:25 scheme: "gdlookup" +Debug: 05-18 11:47:25 host: "localhost" +Debug: 05-18 11:47:25 In-place finish. + +Debug: 05-18 11:47:25 ====reading 2517 of (2517) bytes . Finished: 1 +Debug: 05-18 11:47:25 article view loaded url: "data:text/html;charset=UTF-8,%3C%21DOCTYPE html%3E%0A%3Chtml%3E%3Chead%3E%0A%3Cmeta charset%3D%22utf-8%22%3E%0A%3Cscript src%3D%22qrc%3A%2F%2F%2Fscripts%2Fjquery-3.6.0.slim.min.js%22%3E%3C%2Fscript%3E" true +Debug: 05-18 11:47:25 article view loaded url: "gdlookup://localhost/?word=Welcome!&group=4294967295" true +Debug: 05-18 11:47:25 received: "220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <311858854.5575.1716047245@dict.dict.org>\r\n" +Debug: 05-18 11:47:25 received: "110 166 databases present\r\n" +Debug: 05-18 11:47:25 receive db: "gcide \"The Collaborative International Dictionary of English v.0.48\"" +Debug: 05-18 11:47:25 receive db: "wn \"WordNet (r) 3.0 (2006)\"" +Debug: 05-18 11:47:25 receive db: "moby-thesaurus \"Moby Thesaurus II by Grady Ward, 1.0\"" +Debug: 05-18 11:47:25 receive db: "elements \"The Elements (07Nov00)\"" +Debug: 05-18 11:47:25 receive db: "vera \"V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\"" +Debug: 05-18 11:47:25 receive db: "jargon \"The Jargon File (version 4.4.7, 29 Dec 2003)\"" +Debug: 05-18 11:47:25 receive db: "foldoc \"The Free On-line Dictionary of Computing (30 December 2018)\"" +Debug: 05-18 11:47:25 receive db: "easton \"Easton's 1897 Bible Dictionary\"" +Debug: 05-18 11:47:25 receive db: "hitchcock \"Hitchcock's Bible Names Dictionary (late 1800's)\"" +Debug: 05-18 11:47:25 receive db: "bouvier \"Bouvier's Law Dictionary, Revised 6th Ed (1856)\"" +Debug: 05-18 11:47:25 receive db: "devil \"The Devil's Dictionary (1881-1906)\"" +Debug: 05-18 11:47:25 receive db: "world02 \"CIA World Factbook 2002\"" +Debug: 05-18 11:47:25 receive db: "gaz2k-counties \"U.S. Gazetteer Counties (2000)\"" +Debug: 05-18 11:47:25 receive db: "gaz2k-places \"U.S. Gazetteer Places (2000)\"" +Debug: 05-18 11:47:25 receive db: "gaz2k-zips \"U.S. Gazetteer Zip Code Tabulation Areas (2000)\"" +Debug: 05-18 11:47:25 receive db: "fd-hrv-eng \"Croatian-English FreeDict Dictionary ver. 0.1.2\"" +Debug: 05-18 11:47:25 receive db: "fd-fin-por \"suomi-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 11:47:25 receive db: "fd-fin-bul \"suomi-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 11:47:25 receive db: "fd-fra-bul \"fran\xC3\xA7""ais-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 11:47:25 receive db: "fd-deu-swe \"Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 11:47:25 receive db: "fd-fin-swe \"suomi-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 11:47:25 receive db: "fd-jpn-rus \"Japanese-Russian FreeDict Dictionary ver. 0.1\"" +Debug: 05-18 11:47:25 receive db: "fd-wol-fra \"Wolof - French FreeDict dictionary ver. 0.1\"" +Debug: 05-18 11:47:25 receive db: "fd-fra-pol \"fran\xC3\xA7""ais-j\xC4\x99zyk" +Debug: 05-18 11:47:25 received: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-deu \"English-German FreeDict Dictionary ver. 0.3.7\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-nld \"German-Dutch FreeDict Dictionary ver. 0.1.4\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-por-eng \"Portuguese-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-spa-deu \"Spanish-German FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ces-eng \"Czech-English FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-fin \"Svenska-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-pol \"English - Polish Piotrowski+Saloni/FreeDict dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-nor \"j\xC4\x99zyk polski-Norsk FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-rom \"English-Romanian FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-fra \"English-French FreeDict Dictionary ver. 0.1.6\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fin-ell \"suomi-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-lit \"English-Lithuanian FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ckb-kmr \"Sorani-Kurmanji Ferheng/FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-eng \"Italian-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-eng \"j\xC4\x99zyk polski-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-gle-eng \"Irish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-tur \"English-Turkish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-gle-pol \"Irish-Polish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-deu \"j\xC4\x99zyk polski-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-spa \"fran\xC3\xA7""ais-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-lit-eng \"Lithuanian-English FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-jpn \"English-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ara-eng \"Arabic-English FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-nld-ita \"Nederlands-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-lat \"English-Latin FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-hun \"English-Hungarian FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-jpn \"italiano-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-dan-eng \"Danish-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-hun-eng \"Hungarian-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-gle \"Polish-Irish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-fin \"fran\xC3\xA7""ais-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-nld-swe \"Nederlands-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-nld-eng \"Dutch-English Freedict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-kur \"German-Kurdish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-spa \"Deutsch-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-afr \"English-Afrikaans FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-swe \"English-Swedish FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-jpn-deu \"Japanese-German FreeDict Dictionary ver. 0.2.0\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-epo-eng \"Esperanto-English FreeDict dictionary ver. 1.0.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-nld \"j\xC4\x99zyk polski-Nederlands FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-lat-deu \"Lateinisch-Deutsch FreeDict-W\xC3\xB6rterbuch ver. 1.0.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-cym \"Eurfa Saesneg, English-Welsh Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-por-spa \"portugu\xC3\xAAs-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-spa \"English-Spanish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-tur \"Svenska-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-tur-eng \"Turkish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-tur-deu \"Turkish-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-fra \"j\xC4\x99zyk polski-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-por \"English-Portuguese FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-pol \"italiano-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-ces \"English-Czech dicts.info/FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-tur \"German-Turkish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-jpn \"fran\xC3\xA7""ais-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-cym-eng \"Eurfa Cymraeg, Welsh-English Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-bre-fra \"Breton-French FreeDict Dictionary (Geriadur Tomaz) ver. 0.8.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-jpn-fra \"Japanese-French FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-nld-deu \"Dutch-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-nld \"English-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-por \"German-Portuguese FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-hrv \"English-Croatian FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-mkd-bul \"Macedonian - Bulgarian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-eng \"Swedish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-spa \"j\xC4\x99zyk polski-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-jpn-eng \"Japanese-English FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-ell \"English - Modern Greek XDXF/FreeDict dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-por \"italiano-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-swe \"j\xC4\x99zyk polski-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-fin \"j\xC4\x99zyk polski-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-kur-tur \"Kurdish-Turkish Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-swe \"italiano-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-swh \"English-Swahili xFried/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-kha-eng \"Khasi-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fin-eng \"suomi-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-hin \"English-Hindi FreeDict Dictionary ver. 1.6\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-spa-eng \"Spanish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-afr-eng \"Afrikaans-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-fin \"italiano-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-fin \"English-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-ita \"fran\xC3\xA7""ais-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-rus \"Deutsch-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-bul \"Deutsch-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-pol \"Deutsch-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-kur-deu \"Kurdish-German Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-spa-por \"Spanish-Portuguese FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-pol \"Svenska-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-rus \"Svenska-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-nld-spa \"Nederlands-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swh-pol \"Swahili-Polish SSSP/FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-oci-cat \"Lenga d'\xC3\xB2""c - Catal\xC3\xA0 FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-rus \"italiano-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-ell \"fran\xC3\xA7""ais-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-srp \"English-Serbian FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-tur \"fran\xC3\xA7""ais-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-eng \"French-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-ita-ell \"italiano-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-kur-eng \"Kurdish-English Ferheng/FreeDict Dictionary ver. 1.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-deu \"Svenska-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-fra \"Svenska-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-lat \"Svenska-latine FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-ell \"Svenska-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-rus \"English-Russian FreeDict Dictionary ver. 0.3.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-por \"j\xC4\x99zyk polski-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-gla-deu \"Scottish Gaelic-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-ita \"English-Italian FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-pol-ita \"j\xC4\x99zyk polski-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-swe \"fran\xC3\xA7""ais-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-isl-eng \"\xC3\xADslenska - English FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-spa \"Svenska-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-nno-nob \"Norwegian Nynorsk-Norwegian Bokm\xC3\xA5l FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swe-ita \"Svenska-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-deu \"fran\xC3\xA7""ais-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fin-ita \"suomi-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-nld-fra \"Nederlands-French FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-eng-ara \"English-Arabic FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-slk-eng \"Slovak-English FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fra-por \"fran\xC3\xA7""ais-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-spa-ast \"Spanish - Asturian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fin-jpn \"suomi-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-deu-ita \"German-Italian FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-swh-eng \"Swahili-English xFried/FreeDict Dictionary ver. 0.4.4\"\r\n" +Debug: 05-18 11:47:25 receive db: "fd-fin-nor \"suomi-Norsk FreeDict+WikDict dictionary ver. 2018" +Debug: 05-18 11:47:25 received: ".09.13\"\r\n" +Debug: 05-18 11:47:25 receive db: ".09.13\"\r\n" +Debug: 05-18 11:47:26 received: "fd-fra-nld \"French-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 11:47:35 getResource: "gdlookup://localhost/?word=取&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 11:47:35 scheme: "gdlookup" +Debug: 05-18 11:47:35 host: "localhost" +Debug: 05-18 11:47:35 clear current dictionaries: "取" +Debug: 05-18 11:47:35 some body finished +Debug: 05-18 11:47:35 one not finished. +Debug: 05-18 11:47:35 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 11:47:35 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 11:47:35 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 11:47:35 some body finished +Debug: 05-18 11:47:35 one finished. +Debug: 05-18 11:47:35 erasing.. +Debug: 05-18 11:47:35 erase done.. +Debug: 05-18 11:47:35 send dicts(finished): "groupId:1,word:取,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 11:47:35 ====reading 1292 of (2698) bytes . Finished: 1 +Debug: 05-18 11:47:35 receive dicts, current word: "取" "取" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 11:47:35 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 11:47:35 scheme: "gico" +Debug: 05-18 11:47:35 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 11:47:35 article view loaded url: "gdlookup://localhost/?word=取&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a" true +Debug: 05-18 11:57:25 socket error message: QAbstractSocket::RemoteHostClosedError +Debug: 05-18 12:34:24 translating from clipboard or selection +Debug: 05-18 12:34:24 clipboard data: "https://ajattix.loophole.site/hashirama/Hakurei.git" +Debug: 05-18 12:34:24 Current state: true true false true +Debug: 05-18 12:34:24 getResource: "gdlookup://localhost/?word=https://ajattix.loophole.site/hashirama/Hakurei.git&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:34:24 scheme: "gdlookup" +Debug: 05-18 12:34:24 host: "localhost" +Debug: 05-18 12:34:24 clear current dictionaries: "https://ajattix.loophole.site/hashirama/Hakurei.git" +Debug: 05-18 12:34:24 some body finished +Debug: 05-18 12:34:24 one not finished. +Debug: 05-18 12:34:24 ====reading 1454 of (1454) bytes . Finished: 0 +Debug: 05-18 12:34:24 ====reading 0 of (1454) bytes . Finished: 0 +Debug: 05-18 12:34:24 ====reading 0 of (1454) bytes . Finished: 0 +Debug: 05-18 12:34:24 some body finished +Debug: 05-18 12:34:24 one finished. +Debug: 05-18 12:34:24 erasing.. +Debug: 05-18 12:34:24 erase done.. +Debug: 05-18 12:34:24 send dicts(finished): "groupId:1,word:https://ajattix.loophole.site/hashirama/Hakurei.git,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:34:24 ====reading 1292 of (2746) bytes . Finished: 1 +Debug: 05-18 12:34:24 receive dicts, current word: "https://ajattix.loophole.site/hashirama/Hakurei.git" "https://ajattix.loophole.site/hashirama/Hakurei.git" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 12:34:24 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 12:34:24 scheme: "gico" +Debug: 05-18 12:34:24 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:34:24 article view loaded url: "gdlookup://localhost/?word=https://ajattix.loophole.site/hashirama/Hakurei.git&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-18 12:35:16 translating from clipboard or selection +Debug: 05-18 12:35:16 clipboard data: "http://localhost:3000/hashirama/Hakurei.git" +Debug: 05-18 12:35:16 Current state: true false false true +Debug: 05-18 12:35:16 getResource: "gdlookup://localhost/?word=http://localhost:3000/hashirama/Hakurei.git&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:35:16 scheme: "gdlookup" +Debug: 05-18 12:35:16 host: "localhost" +Debug: 05-18 12:35:16 clear current dictionaries: "http://localhost:3000/hashirama/Hakurei.git" +Debug: 05-18 12:35:16 some body finished +Debug: 05-18 12:35:16 one not finished. +Debug: 05-18 12:35:16 ====reading 1446 of (1446) bytes . Finished: 0 +Debug: 05-18 12:35:16 ====reading 0 of (1446) bytes . Finished: 0 +Debug: 05-18 12:35:16 ====reading 0 of (1446) bytes . Finished: 0 +Debug: 05-18 12:35:16 some body finished +Debug: 05-18 12:35:16 one finished. +Debug: 05-18 12:35:16 erasing.. +Debug: 05-18 12:35:16 erase done.. +Debug: 05-18 12:35:16 send dicts(finished): "groupId:1,word:http://localhost:3000/hashirama/Hakurei.git,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:35:16 receive dicts, current word: "http://localhost:3000/hashirama/Hakurei.git" "http://localhost:3000/hashirama/Hakurei.git" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 12:35:16 ====reading 1292 of (2738) bytes . Finished: 1 +Debug: 05-18 12:35:16 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 12:35:16 scheme: "gico" +Debug: 05-18 12:35:16 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:35:16 article view loaded url: "gdlookup://localhost/?word=http://localhost:3000/hashirama/Hakurei.git&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f1" true +Debug: 05-18 12:36:00 getResource: "gdlookup://localhost/?word=reproductible&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:36:00 scheme: "gdlookup" +Debug: 05-18 12:36:00 host: "localhost" +Debug: 05-18 12:36:00 clear current dictionaries: "reproductible" +Debug: 05-18 12:36:00 some body finished +Debug: 05-18 12:36:00 one not finished. +Debug: 05-18 12:36:00 ====reading 1416 of (1416) bytes . Finished: 0 +Debug: 05-18 12:36:00 ====reading 0 of (1416) bytes . Finished: 0 +Debug: 05-18 12:36:00 ====reading 0 of (1416) bytes . Finished: 0 +Debug: 05-18 12:36:01 getResource: "gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:36:01 scheme: "gdlookup" +Debug: 05-18 12:36:01 host: "localhost" +Debug: 05-18 12:36:01 clear current dictionaries: "誇る" +Debug: 05-18 12:36:01 some body finished +Debug: 05-18 12:36:01 one not finished. +Debug: 05-18 12:36:01 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 12:36:01 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:36:01 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 12:36:01 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:36:02 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:36:02 scheme: "gdlookup" +Debug: 05-18 12:36:02 host: "localhost" +Debug: 05-18 12:36:02 clear current dictionaries: "悔しい" +Debug: 05-18 12:36:02 some body finished +Debug: 05-18 12:36:02 one not finished. +Debug: 05-18 12:36:02 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:36:02 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:36:02 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 12:36:02 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:37:11 translating from clipboard or selection +Debug: 05-18 12:37:11 clipboard data: "" +Debug: 05-18 12:38:27 translating from clipboard or selection +Debug: 05-18 12:38:27 clipboard data: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/OPSXBaluTvwUvbDYfpAwkHnf?allow_redirect=true" +Debug: 05-18 12:38:27 Current state: true true false true +Debug: 05-18 12:38:27 getResource: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/OPSXBaluTvwUvbDYfpAwkHnf?allow_redirect%3Dtrue&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:38:27 scheme: "gdlookup" +Debug: 05-18 12:38:27 host: "localhost" +Debug: 05-18 12:38:27 clear current dictionaries: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/OPSXBaluTvwUvbDYfpAwkHnf?allow_redirect=true" +Debug: 05-18 12:38:27 some body finished +Debug: 05-18 12:38:27 one not finished. +Debug: 05-18 12:38:27 ====reading 1511 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:27 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:27 ====reading 0 of (1511) bytes . Finished: 0 +Warning: 05-18 12:38:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:38:27 translating from clipboard or selection +Debug: 05-18 12:38:27 clipboard data: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/OPSXBaluTvwUvbDYfpAwkHnf?allow_redirect=true" +Debug: 05-18 12:38:27 Current state: true false false true +Debug: 05-18 12:38:27 getResource: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/OPSXBaluTvwUvbDYfpAwkHnf?allow_redirect%3Dtrue&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:38:27 scheme: "gdlookup" +Debug: 05-18 12:38:27 host: "localhost" +Debug: 05-18 12:38:27 clear current dictionaries: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/OPSXBaluTvwUvbDYfpAwkHnf?allow_redirect=true" +Debug: 05-18 12:38:27 some body finished +Debug: 05-18 12:38:27 one not finished. +Debug: 05-18 12:38:27 ====reading 1511 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:27 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:27 ====reading 0 of (1511) bytes . Finished: 0 +Warning: 05-18 12:38:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:38:48 translating from clipboard or selection +Debug: 05-18 12:38:48 clipboard data: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" +Debug: 05-18 12:38:48 Current state: true false true true +Debug: 05-18 12:38:48 getResource: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect%3Dtrue&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:38:48 scheme: "gdlookup" +Debug: 05-18 12:38:48 host: "localhost" +Debug: 05-18 12:38:48 clear current dictionaries: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" +Debug: 05-18 12:38:48 some body finished +Debug: 05-18 12:38:48 one not finished. +Debug: 05-18 12:38:48 ====reading 1511 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:48 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:48 ====reading 0 of (1511) bytes . Finished: 0 +Warning: 05-18 12:38:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:38:49 translating from clipboard or selection +Debug: 05-18 12:38:49 clipboard data: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" +Debug: 05-18 12:38:49 Current state: true false true true +Debug: 05-18 12:38:49 getResource: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect%3Dtrue&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:38:49 scheme: "gdlookup" +Debug: 05-18 12:38:49 host: "localhost" +Debug: 05-18 12:38:49 clear current dictionaries: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" +Debug: 05-18 12:38:49 some body finished +Debug: 05-18 12:38:49 one not finished. +Debug: 05-18 12:38:49 ====reading 1511 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:49 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 12:38:49 ====reading 0 of (1511) bytes . Finished: 0 +Warning: 05-18 12:38:49 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:40:56 getResource: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect%3Dtrue&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:40:56 scheme: "gdlookup" +Debug: 05-18 12:40:56 host: "localhost" +Debug: 05-18 12:40:56 clear current dictionaries: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" +Debug: 05-18 12:40:56 some body finished +Debug: 05-18 12:40:56 send dicts(stemmed): "groupId:1,word:https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true,dictId:" +Debug: 05-18 12:40:56 receive dicts, current word: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" : QList() +Debug: 05-18 12:40:56 ====reading 1595 of (1595) bytes . Finished: 0 +Debug: 05-18 12:40:56 ====reading 0 of (1595) bytes . Finished: 0 +Debug: 05-18 12:40:56 ====reading 0 of (1595) bytes . Finished: 0 +Debug: 05-18 12:40:56 ====reading 0 of (1595) bytes . Finished: 0 +Warning: 05-18 12:40:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:40:56 ====reading 826 of (2421) bytes . Finished: 1 +Debug: 05-18 12:40:56 article view loaded url: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect%3Dtrue&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d7" true +Debug: 05-18 12:40:58 getResource: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect%3Dtrue&group=1&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:40:58 scheme: "gdlookup" +Debug: 05-18 12:40:58 host: "localhost" +Debug: 05-18 12:40:58 clear current dictionaries: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" +Debug: 05-18 12:40:58 some body finished +Debug: 05-18 12:40:58 one not finished. +Debug: 05-18 12:40:58 ====reading 1511 of (1511) bytes . Finished: 0 +Debug: 05-18 12:40:58 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 12:40:58 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 12:40:58 some body finished +Debug: 05-18 12:40:58 one finished. +Debug: 05-18 12:40:58 erasing.. +Debug: 05-18 12:40:58 erase done.. +Debug: 05-18 12:40:58 send dicts(finished): "groupId:1,word:https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:40:58 ====reading 6933 of (8444) bytes . Finished: 1 +Debug: 05-18 12:40:58 receive dicts, current word: "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" "https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect=true" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:40:58 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:40:58 scheme: "gico" +Debug: 05-18 12:40:58 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:40:58 article view loaded url: "gdlookup://localhost/?word=https://matrix.eientei.org/_matrix/media/v3/download/matrix.org/hIplYubEMEpQItBtIRJgjKUH?allow_redirect%3Dtrue&group=1&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99" true +Debug: 05-18 12:40:59 getResource: "gdlookup://localhost/?word=誇る&group=1&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:40:59 scheme: "gdlookup" +Debug: 05-18 12:40:59 host: "localhost" +Debug: 05-18 12:40:59 clear current dictionaries: "誇る" +Debug: 05-18 12:40:59 some body finished +Debug: 05-18 12:40:59 one not finished. +Debug: 05-18 12:40:59 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 12:40:59 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:40:59 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:40:59 some body finished +Debug: 05-18 12:40:59 one finished. +Debug: 05-18 12:40:59 erasing.. +Debug: 05-18 12:40:59 erase done.. +Debug: 05-18 12:40:59 send dicts(finished): "groupId:1,word:誇る,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:40:59 receive dicts, current word: "誇る" "誇る" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:40:59 ====reading 2571 of (3980) bytes . Finished: 1 +Debug: 05-18 12:40:59 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:40:59 scheme: "gico" +Debug: 05-18 12:40:59 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:40:59 article view loaded url: "gdlookup://localhost/?word=誇る&group=1&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c" true +Debug: 05-18 12:40:59 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:40:59 scheme: "gdlookup" +Debug: 05-18 12:40:59 host: "localhost" +Debug: 05-18 12:40:59 clear current dictionaries: "悔しい" +Debug: 05-18 12:40:59 some body finished +Debug: 05-18 12:40:59 one not finished. +Debug: 05-18 12:40:59 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:40:59 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:40:59 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:40:59 some body finished +Debug: 05-18 12:40:59 one finished. +Debug: 05-18 12:40:59 erasing.. +Debug: 05-18 12:40:59 erase done.. +Debug: 05-18 12:40:59 send dicts(finished): "groupId:1,word:悔しい,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:40:59 receive dicts, current word: "悔しい" "悔しい" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:40:59 ====reading 2922 of (4334) bytes . Finished: 1 +Debug: 05-18 12:40:59 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:40:59 scheme: "gico" +Debug: 05-18 12:40:59 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:40:59 article view loaded url: "gdlookup://localhost/?word=悔しい&group=1&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0" true +Debug: 05-18 12:41:53 open link url: QUrl("bword:しいる") +Debug: 05-18 12:41:53 getResource: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:41:53 scheme: "gdlookup" +Debug: 05-18 12:41:53 host: "localhost" +Debug: 05-18 12:41:53 clear current dictionaries: "しいる" +Debug: 05-18 12:41:53 some body finished +Debug: 05-18 12:41:53 one not finished. +Debug: 05-18 12:41:53 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:53 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:53 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:53 some body finished +Debug: 05-18 12:41:53 one finished. +Debug: 05-18 12:41:53 erasing.. +Debug: 05-18 12:41:53 erase done.. +Debug: 05-18 12:41:53 send dicts(finished): "groupId:1,word:しいる,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:53 ====reading 2918 of (4330) bytes . Finished: 1 +Debug: 05-18 12:41:53 receive dicts, current word: "しいる" "しいる" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:41:53 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:41:53 scheme: "gico" +Debug: 05-18 12:41:53 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:53 article view loaded url: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50c" true +Debug: 05-18 12:41:57 open link url: QUrl("bword:しう") +Debug: 05-18 12:41:57 getResource: "gdlookup://localhost/?word=しう&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:41:57 scheme: "gdlookup" +Debug: 05-18 12:41:57 host: "localhost" +Debug: 05-18 12:41:57 clear current dictionaries: "しう" +Debug: 05-18 12:41:57 some body finished +Debug: 05-18 12:41:57 one not finished. +Debug: 05-18 12:41:57 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 12:41:57 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:41:57 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:41:57 some body finished +Debug: 05-18 12:41:57 one finished. +Debug: 05-18 12:41:57 erasing.. +Debug: 05-18 12:41:57 erase done.. +Debug: 05-18 12:41:57 send dicts(finished): "groupId:1,word:しう,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:57 ====reading 2910 of (4319) bytes . Finished: 1 +Debug: 05-18 12:41:57 receive dicts, current word: "しう" "しう" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:41:57 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:41:57 scheme: "gico" +Debug: 05-18 12:41:57 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:57 article view loaded url: "gdlookup://localhost/?word=しう&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cd" true +Debug: 05-18 12:41:58 open link url: QUrl("bword:しいる") +Debug: 05-18 12:41:58 getResource: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:41:58 scheme: "gdlookup" +Debug: 05-18 12:41:58 host: "localhost" +Debug: 05-18 12:41:58 clear current dictionaries: "しいる" +Debug: 05-18 12:41:58 some body finished +Debug: 05-18 12:41:58 one not finished. +Debug: 05-18 12:41:58 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:58 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:58 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:58 some body finished +Debug: 05-18 12:41:58 one finished. +Debug: 05-18 12:41:58 erasing.. +Debug: 05-18 12:41:58 erase done.. +Debug: 05-18 12:41:58 send dicts(finished): "groupId:1,word:しいる,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:58 ====reading 2918 of (4330) bytes . Finished: 1 +Debug: 05-18 12:41:58 receive dicts, current word: "しいる" "しいる" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:41:58 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:41:58 scheme: "gico" +Debug: 05-18 12:41:58 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:58 article view loaded url: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50c" true +Debug: 05-18 12:41:59 open link url: QUrl("bword:悔しい") +Debug: 05-18 12:41:59 getResource: "gdlookup://localhost/?word=悔しい&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:41:59 scheme: "gdlookup" +Debug: 05-18 12:41:59 host: "localhost" +Debug: 05-18 12:41:59 clear current dictionaries: "悔しい" +Debug: 05-18 12:41:59 some body finished +Debug: 05-18 12:41:59 one not finished. +Debug: 05-18 12:41:59 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:59 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:59 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:41:59 some body finished +Debug: 05-18 12:41:59 one finished. +Debug: 05-18 12:41:59 erasing.. +Debug: 05-18 12:41:59 erase done.. +Debug: 05-18 12:41:59 send dicts(finished): "groupId:1,word:悔しい,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:59 ====reading 2922 of (4334) bytes . Finished: 1 +Debug: 05-18 12:41:59 receive dicts, current word: "悔しい" "悔しい" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:41:59 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:41:59 scheme: "gico" +Debug: 05-18 12:41:59 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:41:59 article view loaded url: "gdlookup://localhost/?word=悔しい&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50c" true +Debug: 05-18 12:42:00 open link url: QUrl("bword:悔し") +Debug: 05-18 12:42:00 getResource: "gdlookup://localhost/?word=悔し&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:42:00 scheme: "gdlookup" +Debug: 05-18 12:42:00 host: "localhost" +Debug: 05-18 12:42:00 clear current dictionaries: "悔し" +Debug: 05-18 12:42:00 some body finished +Debug: 05-18 12:42:00 one not finished. +Debug: 05-18 12:42:00 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 12:42:00 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:42:00 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:42:00 some body finished +Debug: 05-18 12:42:00 one finished. +Debug: 05-18 12:42:00 erasing.. +Debug: 05-18 12:42:00 erase done.. +Debug: 05-18 12:42:00 send dicts(finished): "groupId:1,word:悔し,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:42:00 ====reading 2910 of (4319) bytes . Finished: 1 +Debug: 05-18 12:42:00 receive dicts, current word: "悔し" "悔し" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:42:00 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:42:00 scheme: "gico" +Debug: 05-18 12:42:00 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:42:00 article view loaded url: "gdlookup://localhost/?word=悔し&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cd" true +Debug: 05-18 12:42:01 open link url: QUrl("bword:しいる") +Debug: 05-18 12:42:01 getResource: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:42:01 scheme: "gdlookup" +Debug: 05-18 12:42:01 host: "localhost" +Debug: 05-18 12:42:01 clear current dictionaries: "しいる" +Debug: 05-18 12:42:01 some body finished +Debug: 05-18 12:42:01 one not finished. +Debug: 05-18 12:42:01 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:42:01 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:42:01 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:42:01 some body finished +Debug: 05-18 12:42:01 one finished. +Debug: 05-18 12:42:01 erasing.. +Debug: 05-18 12:42:01 erase done.. +Debug: 05-18 12:42:01 send dicts(finished): "groupId:1,word:しいる,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:42:01 ====reading 2918 of (4330) bytes . Finished: 1 +Debug: 05-18 12:42:01 receive dicts, current word: "しいる" "しいる" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-18 12:42:01 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-18 12:42:01 scheme: "gico" +Debug: 05-18 12:42:01 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-18 12:42:01 article view loaded url: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50c" true +Debug: 05-18 12:43:47 getResource: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 12:43:47 scheme: "gdlookup" +Debug: 05-18 12:43:47 host: "localhost" +Debug: 05-18 12:43:47 clear current dictionaries: "しいる" +Debug: 05-18 12:43:47 some body finished +Debug: 05-18 12:43:47 send dicts(stemmed): "groupId:1,word:しいる,dictId:" +Debug: 05-18 12:43:47 receive dicts, current word: "しいる" "しいる" : QList() +Debug: 05-18 12:43:47 ====reading 1527 of (1527) bytes . Finished: 0 +Debug: 05-18 12:43:47 ====reading 0 of (1527) bytes . Finished: 0 +Debug: 05-18 12:43:47 ====reading 14 of (1541) bytes . Finished: 1 +Debug: 05-18 12:43:47 article view loaded url: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f42" true +Debug: 05-18 12:43:49 getResource: "gdlookup://localhost/?word=しいる&group=1&scrollto=gdfrom-00824c93f503c5d1680483abdf367948&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:43:49 scheme: "gdlookup" +Debug: 05-18 12:43:49 host: "localhost" +Debug: 05-18 12:43:49 clear current dictionaries: "しいる" +Debug: 05-18 12:43:49 some body finished +Debug: 05-18 12:43:49 one not finished. +Debug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:44:01 getResource: "gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:44:01 scheme: "gdlookup" +Debug: 05-18 12:44:01 host: "localhost" +Debug: 05-18 12:44:01 clear current dictionaries: "誇る" +Debug: 05-18 12:44:01 some body finished +Debug: 05-18 12:44:01 one not finished. +Debug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 12:44:01 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:44:20 translating from clipboard or selection +Debug: 05-18 12:44:20 clipboard data: "Debug: 05-18 12:43:49 scheme: \"gdlookup\"\nDebug: 05-18 12:43:49 host: \"localhost\"\nDebug: 05-18 12:43:49 clear current dictionaries: \"しいる\"\nDebug: 05-18 12:43:49 some body finished\nDebug: 05-18 12:43:49 one not finished.\nDebug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\nDebug: 05-18 12:44:01 getResource: \"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\"\nDebug: 05-18 12:44:01 scheme: \"gdlookup\"\nDebug: 05-18 12:44:01 host: \"localhost\"\nDebug: 05-18 12:44:01 clear current dictionaries: \"誇る\"\nDebug: 05-18 12:44:01 some body finished\nDebug: 05-18 12:44:01 one not finished.\nDebug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\nWarning: 05-18 12:44:01 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\n" +Debug: 05-18 12:44:20 Current state: true true false true +Debug: 05-18 12:44:20 getResource: "gdlookup://localhost/?word=Debug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:44:20 scheme: "gdlookup" +Debug: 05-18 12:44:20 host: "localhost" +Debug: 05-18 12:44:20 clear current dictionaries: "Debug: 05-18 12:43:49 scheme: \"gdlookup\" Debug: 05-18 12:43:49 host: \"localhost\" Debug: 05-18 12:43:49 clear current dictionaries: \"しいる\" Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: \"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\" Debug: 05-18 12:44:01 scheme: \"gdlookup\" Debug: 05-18 12:44:01 host: \"localhost\" Debug: 05-18 12:44:01 clear current dictionaries: \"誇る\" Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running." +Debug: 05-18 12:44:20 some body finished +Debug: 05-18 12:44:20 one not finished. +Debug: 05-18 12:44:20 ====reading 2853 of (2853) bytes . Finished: 0 +Debug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0 +Debug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0 +Warning: 05-18 12:44:20 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:44:43 translating from clipboard or selection +Debug: 05-18 12:44:43 clipboard data: "Debug: 05-18 12:44:01 scheme: \"gdlookup\"\nDebug: 05-18 12:44:01 host: \"localhost\"\nDebug: 05-18 12:44:01 clear current dictionaries: \"誇る\"\nDebug: 05-18 12:44:01 some body finished\nDebug: 05-18 12:44:01 one not finished.\nDebug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\nWarning: 05-18 12:44:01 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\nDebug: 05-18 12:44:20 translating from clipboard or selection\nDebug: 05-18 12:44:20 clipboard data: \"Debug: 05-18 12:43:49 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:43:49 host: \\\"localhost\\\"\\nDebug: 05-18 12:43:49 clear current dictionaries: \\\"しいる\\\"\\nDebug: 05-18 12:43:49 some body finished\\nDebug: 05-18 12:43:49 one not finished.\\nDebug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0\\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\\nDebug: 05-18 12:44:01 getResource: \\\"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\"\\nDebug: 05-18 12:44:01 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:44:01 host: \\\"localhost\\\"\\nDebug: 05-18 12:44:01 clear current dictionaries: \\\"誇る\\\"\\nDebug: 05-18 12:44:01 some body finished\\nDebug: 05-18 12:44:01 one not finished.\\nDebug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\nWarning: 05-18 12:44:01 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\\n\"\nDebug: 05-18 12:44:20 Current state: true true false true\nDebug: 05-18 12:44:20 getResource: \"gdlookup://localhost/?word=Debug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\"\nDebug: 05-18 12:44:20 scheme: \"gdlookup\"\nDebug: 05-18 12:44:20 host: \"localhost\"\nDebug: 05-18 12:44:20 clear current dictionaries: \"Debug: 05-18 12:43:49 scheme: \\\"gdlookup\\\" Debug: 05-18 12:43:49 host: \\\"localhost\\\" Debug: 05-18 12:43:49 clear current dictionaries: \\\"しいる\\\" Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: \\\"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\" Debug: 05-18 12:44:01 scheme: \\\"gdlookup\\\" Debug: 05-18 12:44:01 host: \\\"localhost\\\" Debug: 05-18 12:44:01 clear current dictionaries: \\\"誇る\\\" Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\"\nDebug: 05-18 12:44:20 some body finished\nDebug: 05-18 12:44:20 one not finished.\nDebug: 05-18 12:44:20 ====reading 2853 of (2853) bytes . Finished: 0\nDebug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0\nDebug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0\nWarning: 05-18 12:44:20 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\n" +Debug: 05-18 12:44:43 Current state: true true false true +Debug: 05-18 12:44:43 getResource: "gdlookup://localhost/?word=Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:44:43 scheme: "gdlookup" +Debug: 05-18 12:44:43 host: "localhost" +Debug: 05-18 12:44:43 some body finished +Debug: 05-18 12:44:43 one not finished. +Debug: 05-18 12:44:43 ====reading 7521 of (7521) bytes . Finished: 0 +Debug: 05-18 12:44:43 ====reading 0 of (7521) bytes . Finished: 0 +Debug: 05-18 12:44:43 ====reading 0 of (7521) bytes . Finished: 0 +Warning: 05-18 12:44:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:44:50 translating from clipboard or selection +Debug: 05-18 12:44:50 clipboard data: "Debug: 05-18 12:44:01 scheme: \"gdlookup\"\nDebug: 05-18 12:44:01 host: \"localhost\"\nDebug: 05-18 12:44:01 clear current dictionaries: \"誇る\"\nDebug: 05-18 12:44:01 some body finished\nDebug: 05-18 12:44:01 one not finished.\nDebug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\nWarning: 05-18 12:44:01 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\nDebug: 05-18 12:44:20 translating from clipboard or selection\nDebug: 05-18 12:44:20 clipboard data: \"Debug: 05-18 12:43:49 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:43:49 host: \\\"localhost\\\"\\nDebug: 05-18 12:43:49 clear current dictionaries: \\\"しいる\\\"\\nDebug: 05-18 12:43:49 some body finished\\nDebug: 05-18 12:43:49 one not finished.\\nDebug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0\\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\\nDebug: 05-18 12:44:01 getResource: \\\"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\"\\nDebug: 05-18 12:44:01 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:44:01 host: \\\"localhost\\\"\\nDebug: 05-18 12:44:01 clear current dictionaries: \\\"誇る\\\"\\nDebug: 05-18 12:44:01 some body finished\\nDebug: 05-18 12:44:01 one not finished.\\nDebug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\nWarning: 05-18 12:44:01 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\\n\"\nDebug: 05-18 12:44:20 Current state: true true false true\nDebug: 05-18 12:44:20 getResource: \"gdlookup://localhost/?word=Debug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\"\nDebug: 05-18 12:44:20 scheme: \"gdlookup\"\nDebug: 05-18 12:44:20 host: \"localhost\"\nDebug: 05-18 12:44:20 clear current dictionaries: \"Debug: 05-18 12:43:49 scheme: \\\"gdlookup\\\" Debug: 05-18 12:43:49 host: \\\"localhost\\\" Debug: 05-18 12:43:49 clear current dictionaries: \\\"しいる\\\" Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: \\\"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\" Debug: 05-18 12:44:01 scheme: \\\"gdlookup\\\" Debug: 05-18 12:44:01 host: \\\"localhost\\\" Debug: 05-18 12:44:01 clear current dictionaries: \\\"誇る\\\" Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\"\nDebug: 05-18 12:44:20 some body finished\nDebug: 05-18 12:44:20 one not finished.\nDebug: 05-18 12:44:20 ====reading 2853 of (2853) bytes . Finished: 0\nDebug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0\nDebug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0\nWarning: 05-18 12:44:20 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\nDebug: 05-18 12:44:43 translating from clipboard or selection\nDebug: 05-18 12:44:43 clipboard data: \"Debug: 05-18 12:44:01 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:44:01 host: \\\"localhost\\\"\\nDebug: 05-18 12:44:01 clear current dictionaries: \\\"誇る\\\"\\nDebug: 05-18 12:44:01 some body finished\\nDebug: 05-18 12:44:01 one not finished.\\nDebug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\nWarning: 05-18 12:44:01 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\\nDebug: 05-18 12:44:20 translating from clipboard or selection\\nDebug: 05-18 12:44:20 clipboard data: \\\"Debug: 05-18 12:43:49 scheme: \\\\\\\"gdlookup\\\\\\\"\\\\nDebug: 05-18 12:43:49 host: \\\\\\\"localhost\\\\\\\"\\\\nDebug: 05-18 12:43:49 clear current dictionaries: \\\\\\\"しいる\\\\\\\"\\\\nDebug: 05-18 12:43:49 some body finished\\\\nDebug: 05-18 12:43:49 one not finished.\\\\nDebug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0\\\\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\\\\nDebug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0\\\\nDebug: 05-18 12:44:01 getResource: \\\\\\\"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\\\\\"\\\\nDebug: 05-18 12:44:01 scheme: \\\\\\\"gdlookup\\\\\\\"\\\\nDebug: 05-18 12:44:01 host: \\\\\\\"localhost\\\\\\\"\\\\nDebug: 05-18 12:44:01 clear current dictionaries: \\\\\\\"誇る\\\\\\\"\\\\nDebug: 05-18 12:44:01 some body finished\\\\nDebug: 05-18 12:44:01 one not finished.\\\\nDebug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0\\\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\\\nDebug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0\\\\nWarning: 05-18 12:44:01 QProcess: Destroyed while process (\\\\\\\"/tmp/Hakurei/hakurei\\\\\\\") is still running.\\\\n\\\"\\nDebug: 05-18 12:44:20 Current state: true true false true\\nDebug: 05-18 12:44:20 getResource: \\\"gdlookup://localhost/?word=Debug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\"\\nDebug: 05-18 12:44:20 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:44:20 host: \\\"localhost\\\"\\nDebug: 05-18 12:44:20 clear current dictionaries: \\\"Debug: 05-18 12:43:49 scheme: \\\\\\\"gdlookup\\\\\\\" Debug: 05-18 12:43:49 host: \\\\\\\"localhost\\\\\\\" Debug: 05-18 12:43:49 clear current dictionaries: \\\\\\\"しいる\\\\\\\" Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 ====reading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 ====reading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: \\\\\\\"gdlookup://localhost/?word=誇る&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\\\\\" Debug: 05-18 12:44:01 scheme: \\\\\\\"gdlookup\\\\\\\" Debug: 05-18 12:44:01 host: \\\\\\\"localhost\\\\\\\" Debug: 05-18 12:44:01 clear current dictionaries: \\\\\\\"誇る\\\\\\\" Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 ====reading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 ====reading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (\\\\\\\"/tmp/Hakurei/hakurei\\\\\\\") is still running.\\\"\\nDebug: 05-18 12:44:20 some body finished\\nDebug: 05-18 12:44:20 one not finished.\\nDebug: 05-18 12:44:20 ====reading 2853 of (2853) bytes . Finished: 0\\nDebug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0\\nDebug: 05-18 12:44:20 ====reading 0 of (2853) bytes . Finished: 0\\nWarning: 05-18 12:44:20 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\\n\"\nDebug: 05-18 12:44:43 Current state: true true false true\nDebug: 05-18 12:44:43 getResource: \"gdlookup://localhost/?word=Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\"\nDebug: 05-18 12:44:43 scheme: \"gdlookup\"\nDebug: 05-18 12:44:43 host: \"localhost\"\nDebug: 05-18 12:44:43 some body finished\nDebug: 05-18 12:44:43 one not finished.\nDebug: 05-18 12:44:43 ====reading 7521 of (7521) bytes . Finished: 0\nDebug: 05-18 12:44:43 ====reading 0 of (7521) bytes . Finished: 0\nDebug: 05-18 12:44:43 ====reading 0 of (7521) bytes . Finished: 0\nWarning: 05-18 12:44:43 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\n" +Debug: 05-18 12:44:50 Current state: true false false true +Debug: 05-18 12:44:50 getResource: "gdlookup://localhost/?word=Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:43 translating from clipboard or selection Debug: 05-18 12:44:43 clipboard data: %22Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5CnDebug: 05-18 12:44:20 translating from clipboard or selection%5CnDebug: 05-18 12:44:20 clipboard data: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22%5C%5CnDebug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22%5C%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22%5C%5CnDebug: 05-18 12:43:49 some body finished%5C%5CnDebug: 05-18 12:43:49 one not finished.%5C%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5C%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5C%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5C%5CnDebug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22%5C%5CnDebug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22%5C%5CnDebug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22%5C%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22%5C%5CnDebug: 05-18 12:44:01 some body finished%5C%5CnDebug: 05-18 12:44:01 one not finished.%5C%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5C%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5C%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5C%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%5Cn%5C%22%5CnDebug: 05-18 12:44:20 Current state: true true false true%5CnDebug: 05-18 12:44:20 getResource: %5C%22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:44:50 scheme: "gdlookup" +Debug: 05-18 12:44:50 host: "localhost" +Debug: 05-18 12:44:50 some body finished +Debug: 05-18 12:44:50 one not finished. +Debug: 05-18 12:44:50 ====reading 20974 of (20974) bytes . Finished: 0 +Debug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0 +Debug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0 +Warning: 05-18 12:44:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:44:56 translating from clipboard or selection +Debug: 05-18 12:44:56 clipboard data: "f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\"\nDebug: 05-18 12:44:50 scheme: \"gdlookup\"\nDebug: 05-18 12:44:50 host: \"localhost\"\nDebug: 05-18 12:44:50 some body finished\nDebug: 05-18 12:44:50 one not finished.\nDebug: 05-18 12:44:50 ====reading 20974 of (20974) bytes . Finished: 0\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\nWarning: 05-18 12:44:50 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\n" +Debug: 05-18 12:44:56 Current state: true false true true +Debug: 05-18 12:44:56 getResource: "gdlookup://localhost/?word=f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:50 scheme: %22gdlookup%22 Debug: 05-18 12:44:50 host: %22localhost%22 Debug: 05-18 12:44:50 some body finished Debug: 05-18 12:44:50 one not finished. Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Warning: 05-18 12:44:50 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:44:56 scheme: "gdlookup" +Debug: 05-18 12:44:56 host: "localhost" +Debug: 05-18 12:44:56 some body finished +Debug: 05-18 12:44:56 one not finished. +Debug: 05-18 12:44:56 ====reading 12650 of (12650) bytes . Finished: 0 +Debug: 05-18 12:44:56 ====reading 0 of (12650) bytes . Finished: 0 +Debug: 05-18 12:44:56 ====reading 0 of (12650) bytes . Finished: 0 +Warning: 05-18 12:44:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:45:12 translating from clipboard or selection +Debug: 05-18 12:45:12 clipboard data: "Debug: 05-18 12:44:50 scheme: \"gdlookup\"\nDebug: 05-18 12:44:50 host: \"localhost\"\nDebug: 05-18 12:44:50 some body finished\nDebug: 05-18 12:44:50 one not finished.\nDebug: 05-18 12:44:50 ====reading 20974 of (20974) bytes . Finished: 0\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\nWarning: 05-18 12:44:50 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\nDebug: 05-18 12:44:56 translating from clipboard or selection\nDebug: 05-18 12:44:56 clipboard data: \"f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\"\\nDebug: 05-18 12:44:50 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:44:50 host: \\\"localhost\\\"\\nDebug: 05-18 12:44:50 some body finished\\nDebug: 05-18 12:44:50 one not finished.\\nDebug: 05-18 12:44:50 ====reading 20974 of (20974) bytes . Finished: 0\\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\\nWarning: 05-18 12:44:50 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\\n\"\nDebug: 05-18 12:44:56 Current state: true false true true\nDebug: 05-18 12:44:56 getResource: \"gdlookup://localhost/?word=f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:50 scheme: %22gdlookup%22 Debug: 05-18 12:44:50 host: %22localhost%22 Debug: 05-18 12:44:50 some body finished Debug: 05-18 12:44:50 one not finished. Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Warning: 05-18 12:44:50 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\"\nDebug: 05-18 12:44:56 scheme: \"gdlookup\"\nDebug: 05-18 12:44:56 host: \"localhost\"\nDebug: 05-18 12:44:56 some body finished\nDebug: 05-18 12:44:56 one not finished.\nDebug: 05-18 12:44:56 ====reading 12650 of (12650) bytes . Finished: 0\nDebug: 05-18 12:44:56 ====reading 0 of (12650) bytes . Finished: 0\nDebug: 05-18 12:44:56 ====reading 0 of (12650) bytes . Finished: 0" +Debug: 05-18 12:45:12 Current state: true false true true +Debug: 05-18 12:45:12 getResource: "gdlookup://localhost/?word=Debug: 05-18 12:44:50 scheme: %22gdlookup%22 Debug: 05-18 12:44:50 host: %22localhost%22 Debug: 05-18 12:44:50 some body finished Debug: 05-18 12:44:50 one not finished. Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Warning: 05-18 12:44:50 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:56 translating from clipboard or selection Debug: 05-18 12:44:56 clipboard data: %22f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:50 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:50 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:50 some body finished%5CnDebug: 05-18 12:44:50 one not finished.%5CnDebug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0%5CnDebug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0%5CnDebug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0%5CnWarning: 05-18 12:44:50 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:56 Current state: true false true true Debug: 05-18 12:44:56 getResource: %22gdlookup://localhost/?word%3Df50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:50 scheme: %22gdlookup%22 Debug: 05-18 12:44:50 host: %22localhost%22 Debug: 05-18 12:44:50 some body finished Debug: 05-18 12:44:50 one not finished. Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Warning: 05-18 12:44:50 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:56 scheme: %22gdlookup%22 Debug: 05-18 12:44:56 host: %22localhost%22 Debug: 05-18 12:44:56 some body finished Debug: 05-18 12:44:56 one not finished. Debug: 05-18 12:44:56 %3D%3D%3D%3Dreading 12650 of (12650) bytes . Finished: 0 Debug: 05-18 12:44:56 %3D%3D%3D%3Dreading 0 of (12650) bytes . Finished: 0 Debug: 05-18 12:44:56 %3D%3D%3D%3Dreading 0 of (12650) bytes . Finished: 0&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:45:12 scheme: "gdlookup" +Debug: 05-18 12:45:12 host: "localhost" +Debug: 05-18 12:45:12 some body finished +Debug: 05-18 12:45:12 one not finished. +Debug: 05-18 12:45:12 ====reading 25396 of (25396) bytes . Finished: 0 +Debug: 05-18 12:45:12 ====reading 0 of (25396) bytes . Finished: 0 +Debug: 05-18 12:45:12 ====reading 0 of (25396) bytes . Finished: 0 +Warning: 05-18 12:45:12 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:45:13 translating from clipboard or selection +Debug: 05-18 12:45:13 clipboard data: "Debug: 05-18 12:44:50 scheme: \"gdlookup\"\nDebug: 05-18 12:44:50 host: \"localhost\"\nDebug: 05-18 12:44:50 some body finished\nDebug: 05-18 12:44:50 one not finished.\nDebug: 05-18 12:44:50 ====reading 20974 of (20974) bytes . Finished: 0\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\nWarning: 05-18 12:44:50 QProcess: Destroyed while process (\"/tmp/Hakurei/hakurei\") is still running.\nDebug: 05-18 12:44:56 translating from clipboard or selection\nDebug: 05-18 12:44:56 clipboard data: \"f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\\\"\\nDebug: 05-18 12:44:50 scheme: \\\"gdlookup\\\"\\nDebug: 05-18 12:44:50 host: \\\"localhost\\\"\\nDebug: 05-18 12:44:50 some body finished\\nDebug: 05-18 12:44:50 one not finished.\\nDebug: 05-18 12:44:50 ====reading 20974 of (20974) bytes . Finished: 0\\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\\nDebug: 05-18 12:44:50 ====reading 0 of (20974) bytes . Finished: 0\\nWarning: 05-18 12:44:50 QProcess: Destroyed while process (\\\"/tmp/Hakurei/hakurei\\\") is still running.\\n\"\nDebug: 05-18 12:44:56 Current state: true false true true\nDebug: 05-18 12:44:56 getResource: \"gdlookup://localhost/?word=f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:50 scheme: %22gdlookup%22 Debug: 05-18 12:44:50 host: %22localhost%22 Debug: 05-18 12:44:50 some body finished Debug: 05-18 12:44:50 one not finished. Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Warning: 05-18 12:44:50 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74\"\nDebug: 05-18 12:44:56 scheme: \"gdlookup\"\nDebug: 05-18 12:44:56 host: \"localhost\"\nDebug: 05-18 12:44:56 some body finished\nDebug: 05-18 12:44:56 one not finished.\nDebug: 05-18 12:44:56 ====reading 12650 of (12650) bytes . Finished: 0\nDebug: 05-18 12:44:56 ====reading 0 of (12650) bytes . Finished: 0\nDebug: 05-18 12:44:56 ====reading 0 of (12650) bytes . Finished: 0" +Debug: 05-18 12:45:13 Current state: true false true true +Debug: 05-18 12:45:13 getResource: "gdlookup://localhost/?word=Debug: 05-18 12:44:50 scheme: %22gdlookup%22 Debug: 05-18 12:44:50 host: %22localhost%22 Debug: 05-18 12:44:50 some body finished Debug: 05-18 12:44:50 one not finished. Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Warning: 05-18 12:44:50 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:56 translating from clipboard or selection Debug: 05-18 12:44:56 clipboard data: %22f50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:50 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:50 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:50 some body finished%5CnDebug: 05-18 12:44:50 one not finished.%5CnDebug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0%5CnDebug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0%5CnDebug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0%5CnWarning: 05-18 12:44:50 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:56 Current state: true false true true Debug: 05-18 12:44:56 getResource: %22gdlookup://localhost/?word%3Df50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:20 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:20 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:20 clear current dictionaries: %5C%22Debug: 05-18 12:43:49 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:43:49 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%5C%5C%22しいる%5C%5C%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%5C%5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%5C%5C%22 Debug: 05-18 12:44:01 scheme: %5C%5C%5C%22gdlookup%5C%5C%5C%22 Debug: 05-18 12:44:01 host: %5C%5C%5C%22localhost%5C%5C%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%5C%5C%22誇る%5C%5C%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%5C%5C%22/tmp/Hakurei/hakurei%5C%5C%5C%22) is still running.%5C%22%5CnDebug: 05-18 12:44:20 some body finished%5CnDebug: 05-18 12:44:20 one not finished.%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnDebug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0%5CnWarning: 05-18 12:44:20 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:43 Current state: true true false true Debug: 05-18 12:44:43 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running. Debug: 05-18 12:44:20 translating from clipboard or selection Debug: 05-18 12:44:20 clipboard data: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:43:49 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22%5CnDebug: 05-18 12:43:49 some body finished%5CnDebug: 05-18 12:43:49 one not finished.%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22%5CnDebug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22%5CnDebug: 05-18 12:44:01 host: %5C%22localhost%5C%22%5CnDebug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22%5CnDebug: 05-18 12:44:01 some body finished%5CnDebug: 05-18 12:44:01 one not finished.%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnDebug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0%5CnWarning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%5Cn%22 Debug: 05-18 12:44:20 Current state: true true false true Debug: 05-18 12:44:20 getResource: %22gdlookup://localhost/?word%3DDebug: 05-18 12:43:49 scheme: %22gdlookup%22 Debug: 05-18 12:43:49 host: %22localhost%22 Debug: 05-18 12:43:49 clear current dictionaries: %22しいる%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:01 scheme: %22gdlookup%22 Debug: 05-18 12:44:01 host: %22localhost%22 Debug: 05-18 12:44:01 clear current dictionaries: %22誇る%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:20 scheme: %22gdlookup%22 Debug: 05-18 12:44:20 host: %22localhost%22 Debug: 05-18 12:44:20 clear current dictionaries: %22Debug: 05-18 12:43:49 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:43:49 host: %5C%22localhost%5C%22 Debug: 05-18 12:43:49 clear current dictionaries: %5C%22しいる%5C%22 Debug: 05-18 12:43:49 some body finished Debug: 05-18 12:43:49 one not finished. Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 1412 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:43:49 %3D%3D%3D%3Dreading 0 of (1412) bytes . Finished: 0 Debug: 05-18 12:44:01 getResource: %5C%22gdlookup://localhost/?word%3D誇る%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%5C%22 Debug: 05-18 12:44:01 scheme: %5C%22gdlookup%5C%22 Debug: 05-18 12:44:01 host: %5C%22localhost%5C%22 Debug: 05-18 12:44:01 clear current dictionaries: %5C%22誇る%5C%22 Debug: 05-18 12:44:01 some body finished Debug: 05-18 12:44:01 one not finished. Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 1409 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Debug: 05-18 12:44:01 %3D%3D%3D%3Dreading 0 of (1409) bytes . Finished: 0 Warning: 05-18 12:44:01 QProcess: Destroyed while process (%5C%22/tmp/Hakurei/hakurei%5C%22) is still running.%22 Debug: 05-18 12:44:20 some body finished Debug: 05-18 12:44:20 one not finished. Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 2853 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Debug: 05-18 12:44:20 %3D%3D%3D%3Dreading 0 of (2853) bytes . Finished: 0 Warning: 05-18 12:44:20 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:43 scheme: %22gdlookup%22 Debug: 05-18 12:44:43 host: %22localhost%22 Debug: 05-18 12:44:43 some body finished Debug: 05-18 12:44:43 one not finished. Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 7521 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Debug: 05-18 12:44:43 %3D%3D%3D%3Dreading 0 of (7521) bytes . Finished: 0 Warning: 05-18 12:44:43 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:50 scheme: %22gdlookup%22 Debug: 05-18 12:44:50 host: %22localhost%22 Debug: 05-18 12:44:50 some body finished Debug: 05-18 12:44:50 one not finished. Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 20974 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Debug: 05-18 12:44:50 %3D%3D%3D%3Dreading 0 of (20974) bytes . Finished: 0 Warning: 05-18 12:44:50 QProcess: Destroyed while process (%22/tmp/Hakurei/hakurei%22) is still running.%26group%3D1%26muted%3D00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74%22 Debug: 05-18 12:44:56 scheme: %22gdlookup%22 Debug: 05-18 12:44:56 host: %22localhost%22 Debug: 05-18 12:44:56 some body finished Debug: 05-18 12:44:56 one not finished. Debug: 05-18 12:44:56 %3D%3D%3D%3Dreading 12650 of (12650) bytes . Finished: 0 Debug: 05-18 12:44:56 %3D%3D%3D%3Dreading 0 of (12650) bytes . Finished: 0 Debug: 05-18 12:44:56 %3D%3D%3D%3Dreading 0 of (12650) bytes . Finished: 0&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:45:13 scheme: "gdlookup" +Debug: 05-18 12:45:13 host: "localhost" +Debug: 05-18 12:45:13 some body finished +Debug: 05-18 12:45:13 one not finished. +Debug: 05-18 12:45:13 ====reading 25396 of (25396) bytes . Finished: 0 +Debug: 05-18 12:45:13 ====reading 0 of (25396) bytes . Finished: 0 +Debug: 05-18 12:45:13 ====reading 0 of (25396) bytes . Finished: 0 +Warning: 05-18 12:45:13 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:46:18 translating from clipboard or selection +Debug: 05-18 12:46:18 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/gd-mandarin_cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=~/.local/gd-mandarin/user.dic\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t~/.local/gd-mandarin \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tmecab -d . -Ogdmandarin\t --dicdir=\"$(find_dicdir)\"\t--userdic=\"${USER_DICT}\"\n\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
'\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
'\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 12:46:18 Current state: true false true true +Debug: 05-18 12:46:18 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/gd-mandarin_cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D~/.local/gd-mandarin/user.dic FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_dicdir() %7B dirname -- %22$( find %5C ~/.local/gd-mandarin %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi mecab -d . -Ogdmandarin --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E .gd-mandarin %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mandarin a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mandarin a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mandarin a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mandarin%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:46:18 scheme: "gdlookup" +Debug: 05-18 12:46:18 host: "localhost" +Debug: 05-18 12:46:18 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/gd-mandarin_cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=~/.local/gd-mandarin/user.dic FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_dicdir() { dirname -- \"$( find \\ ~/.local/gd-mandarin \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi mecab -d . -Ogdmandarin --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
' print_css } main \"$@\"" +Debug: 05-18 12:46:18 some body finished +Debug: 05-18 12:46:18 one not finished. +Debug: 05-18 12:46:18 ====reading 5345 of (5345) bytes . Finished: 0 +Debug: 05-18 12:46:18 ====reading 0 of (5345) bytes . Finished: 0 +Debug: 05-18 12:46:18 ====reading 0 of (5345) bytes . Finished: 0 +Warning: 05-18 12:46:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:46:18 translating from clipboard or selection +Debug: 05-18 12:46:18 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/gd-mandarin_cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=~/.local/gd-mandarin/user.dic\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t~/.local/gd-mandarin \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tmecab -d . -Ogdmandarin\t --dicdir=\"$(find_dicdir)\"\t--userdic=\"${USER_DICT}\"\n\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
'\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
'\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 12:46:18 Current state: true false true true +Debug: 05-18 12:46:18 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/gd-mandarin_cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D~/.local/gd-mandarin/user.dic FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_dicdir() %7B dirname -- %22$( find %5C ~/.local/gd-mandarin %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi mecab -d . -Ogdmandarin --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E .gd-mandarin %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mandarin a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mandarin a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mandarin a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mandarin%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:46:18 scheme: "gdlookup" +Debug: 05-18 12:46:18 host: "localhost" +Debug: 05-18 12:46:18 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/gd-mandarin_cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=~/.local/gd-mandarin/user.dic FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_dicdir() { dirname -- \"$( find \\ ~/.local/gd-mandarin \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi mecab -d . -Ogdmandarin --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
' print_css } main \"$@\"" +Debug: 05-18 12:46:18 some body finished +Debug: 05-18 12:46:18 one not finished. +Debug: 05-18 12:46:18 ====reading 5345 of (5345) bytes . Finished: 0 +Debug: 05-18 12:46:18 ====reading 0 of (5345) bytes . Finished: 0 +Debug: 05-18 12:46:18 ====reading 0 of (5345) bytes . Finished: 0 +Warning: 05-18 12:46:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:46:18 translating from clipboard or selection +Debug: 05-18 12:46:18 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/gd-mandarin_cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=~/.local/gd-mandarin/user.dic\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t~/.local/gd-mandarin \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tmecab -d . -Ogdmandarin\t --dicdir=\"$(find_dicdir)\"\t--userdic=\"${USER_DICT}\"\n\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
'\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
'\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 12:46:18 Current state: true false true true +Debug: 05-18 12:46:18 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/gd-mandarin_cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D~/.local/gd-mandarin/user.dic FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_dicdir() %7B dirname -- %22$( find %5C ~/.local/gd-mandarin %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi mecab -d . -Ogdmandarin --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E .gd-mandarin %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mandarin a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mandarin a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mandarin a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mandarin%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:46:18 scheme: "gdlookup" +Debug: 05-18 12:46:18 host: "localhost" +Debug: 05-18 12:46:18 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/gd-mandarin_cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=~/.local/gd-mandarin/user.dic FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_dicdir() { dirname -- \"$( find \\ ~/.local/gd-mandarin \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi mecab -d . -Ogdmandarin --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
' print_css } main \"$@\"" +Debug: 05-18 12:46:18 some body finished +Debug: 05-18 12:46:18 one not finished. +Debug: 05-18 12:46:18 ====reading 5345 of (5345) bytes . Finished: 0 +Debug: 05-18 12:46:18 ====reading 0 of (5345) bytes . Finished: 0 +Debug: 05-18 12:46:18 ====reading 0 of (5345) bytes . Finished: 0 +Warning: 05-18 12:46:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:48:48 translating from clipboard or selection +Debug: 05-18 12:48:48 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 12:48:48 Current state: true false true true +Debug: 05-18 12:48:48 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:48:48 scheme: "gdlookup" +Debug: 05-18 12:48:48 host: "localhost" +Debug: 05-18 12:48:48 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 12:48:48 some body finished +Debug: 05-18 12:48:48 one not finished. +Debug: 05-18 12:48:48 ====reading 10997 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:48 ====reading 0 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:48 ====reading 0 of (10997) bytes . Finished: 0 +Warning: 05-18 12:48:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:48:48 translating from clipboard or selection +Debug: 05-18 12:48:48 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 12:48:48 Current state: true false true true +Debug: 05-18 12:48:48 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:48:48 scheme: "gdlookup" +Debug: 05-18 12:48:48 host: "localhost" +Debug: 05-18 12:48:48 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 12:48:48 some body finished +Debug: 05-18 12:48:48 one not finished. +Debug: 05-18 12:48:48 ====reading 10997 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:48 ====reading 0 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:48 ====reading 0 of (10997) bytes . Finished: 0 +Warning: 05-18 12:48:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:48:48 translating from clipboard or selection +Debug: 05-18 12:48:48 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 12:48:48 Current state: true false true true +Debug: 05-18 12:48:48 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:48:48 scheme: "gdlookup" +Debug: 05-18 12:48:48 host: "localhost" +Debug: 05-18 12:48:48 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 12:48:48 some body finished +Debug: 05-18 12:48:48 one not finished. +Debug: 05-18 12:48:48 ====reading 10997 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:48 ====reading 0 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:48 ====reading 0 of (10997) bytes . Finished: 0 +Warning: 05-18 12:48:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:48:49 translating from clipboard or selection +Debug: 05-18 12:48:49 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 12:48:49 Current state: true false true true +Debug: 05-18 12:48:49 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:48:49 scheme: "gdlookup" +Debug: 05-18 12:48:49 host: "localhost" +Debug: 05-18 12:48:49 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 12:48:49 some body finished +Debug: 05-18 12:48:49 one not finished. +Debug: 05-18 12:48:49 ====reading 10997 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:49 ====reading 0 of (10997) bytes . Finished: 0 +Debug: 05-18 12:48:49 ====reading 0 of (10997) bytes . Finished: 0 +Warning: 05-18 12:48:49 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:51:37 translating from clipboard or selection +Debug: 05-18 12:51:37 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += R\"(\n\n\n\n\n\n\n
\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 12:51:37 Current state: true false true true +Debug: 05-18 12:51:37 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D R%22( %3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:51:37 scheme: "gdlookup" +Debug: 05-18 12:51:37 host: "localhost" +Debug: 05-18 12:51:37 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += R\"(
)\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 12:51:37 some body finished +Debug: 05-18 12:51:37 one not finished. +Debug: 05-18 12:51:37 ====reading 10778 of (10778) bytes . Finished: 0 +Debug: 05-18 12:51:37 ====reading 0 of (10778) bytes . Finished: 0 +Debug: 05-18 12:51:37 ====reading 0 of (10778) bytes . Finished: 0 +Warning: 05-18 12:51:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:51:54 translating from clipboard or selection +Debug: 05-18 12:51:54 clipboard data: "" +Debug: 05-18 12:51:55 translating from clipboard or selection +Debug: 05-18 12:51:55 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 12:51:55 Current state: true false true true +Debug: 05-18 12:51:55 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:51:55 scheme: "gdlookup" +Debug: 05-18 12:51:55 host: "localhost" +Debug: 05-18 12:51:55 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 12:51:55 some body finished +Debug: 05-18 12:51:55 one not finished. +Debug: 05-18 12:51:55 ====reading 10997 of (10997) bytes . Finished: 0 +Debug: 05-18 12:51:55 ====reading 0 of (10997) bytes . Finished: 0 +Debug: 05-18 12:51:55 ====reading 0 of (10997) bytes . Finished: 0 +Warning: 05-18 12:51:55 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:52:41 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:52:41 scheme: "gdlookup" +Debug: 05-18 12:52:41 host: "localhost" +Debug: 05-18 12:52:41 clear current dictionaries: "悔しい" +Debug: 05-18 12:52:41 some body finished +Debug: 05-18 12:52:41 one not finished. +Debug: 05-18 12:52:41 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:52:41 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:52:41 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 12:52:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:52:42 translating from clipboard or selection +Debug: 05-18 12:52:42 clipboard data: "悔しい" +Debug: 05-18 12:52:42 Current state: true false true true +Debug: 05-18 12:52:42 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:52:42 scheme: "gdlookup" +Debug: 05-18 12:52:42 host: "localhost" +Debug: 05-18 12:52:42 clear current dictionaries: "悔しい" +Debug: 05-18 12:52:42 some body finished +Debug: 05-18 12:52:42 one not finished. +Debug: 05-18 12:52:42 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 12:52:42 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 12:52:42 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 12:52:42 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:52:54 translating from clipboard or selection +Debug: 05-18 12:52:54 clipboard data: " align-content: start;\n justify-content: space-around;\n text-align: left;\n padding: 5px 0px;\n}\n.hakurei .alternatives > ul {\n list-style-type: none;\n margin: 0;\n padding: calc( var(--size) / 4);\n background-color: hsl(0 0% 50% / 0.05);\n box-shadow: 0 0 4px hsl(0 0% 0% / 0.1);\n border-radius: 0.2rem;\n}\n.hakurei .alternatives > ul > li {\n margin-right: 1rem;\n}\n.container {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n}\n.segment {\n display: inline-block;\n}\n\n\n\n" +Debug: 05-18 12:52:54 Current state: true true false true +Debug: 05-18 12:52:54 getResource: "gdlookup://localhost/?word=align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E %3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:悔しい%22%3E悔しい%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cdiv class%3D%22segment%22%3Eい%3C/div%3E%3C/div%3E%3C/div%3E%3C/body%3E%3C/html%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:52:54 scheme: "gdlookup" +Debug: 05-18 12:52:54 host: "localhost" +Debug: 05-18 12:52:54 clear current dictionaries: "align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; } .hakurei .alternatives > ul { list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0% 50% / 0.05); box-shadow: 0 0 4px hsl(0 0% 0% / 0.1); border-radius: 0.2rem; } .hakurei .alternatives > ul > li { margin-right: 1rem; } .container { display: flex; flex-wrap: wrap; gap: 10px; } .segment { display: inline-block; } " +Debug: 05-18 12:52:54 some body finished +Debug: 05-18 12:52:54 one not finished. +Debug: 05-18 12:52:54 ====reading 2449 of (2449) bytes . Finished: 0 +Debug: 05-18 12:52:54 ====reading 0 of (2449) bytes . Finished: 0 +Debug: 05-18 12:52:54 ====reading 0 of (2449) bytes . Finished: 0 +Warning: 05-18 12:52:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:52:58 translating from clipboard or selection +Debug: 05-18 12:52:58 clipboard data: "\n\n\n\n\n\n" +Debug: 05-18 12:52:58 Current state: true false false true +Debug: 05-18 12:52:58 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E %3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:悔しい%22%3E悔しい%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cdiv class%3D%22segment%22%3Eい%3C/div%3E%3C/div%3E%3C/div%3E%3C/body%3E%3C/html%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:52:58 scheme: "gdlookup" +Debug: 05-18 12:52:58 host: "localhost" +Debug: 05-18 12:52:58 clear current dictionaries: " " +Debug: 05-18 12:52:58 some body finished +Debug: 05-18 12:52:58 one not finished. +Debug: 05-18 12:52:58 ====reading 3197 of (3197) bytes . Finished: 0 +Debug: 05-18 12:52:58 ====reading 0 of (3197) bytes . Finished: 0 +Debug: 05-18 12:52:58 ====reading 0 of (3197) bytes . Finished: 0 +Warning: 05-18 12:52:58 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:52:59 translating from clipboard or selection +Debug: 05-18 12:52:59 clipboard data: "\n\n\n\n\n\n" +Debug: 05-18 12:52:59 Current state: true false true true +Debug: 05-18 12:52:59 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E %3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:悔しい%22%3E悔しい%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cdiv class%3D%22segment%22%3Eい%3C/div%3E%3C/div%3E%3C/div%3E%3C/body%3E%3C/html%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:52:59 scheme: "gdlookup" +Debug: 05-18 12:52:59 host: "localhost" +Debug: 05-18 12:52:59 clear current dictionaries: " " +Debug: 05-18 12:52:59 some body finished +Debug: 05-18 12:52:59 one not finished. +Debug: 05-18 12:52:59 ====reading 3197 of (3197) bytes . Finished: 0 +Debug: 05-18 12:52:59 ====reading 0 of (3197) bytes . Finished: 0 +Debug: 05-18 12:52:59 ====reading 0 of (3197) bytes . Finished: 0 +Warning: 05-18 12:52:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:52:59 translating from clipboard or selection +Debug: 05-18 12:52:59 clipboard data: "\n\n\n\n\n\n" +Debug: 05-18 12:52:59 Current state: true false true true +Debug: 05-18 12:52:59 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E %3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:悔し%22%3E悔し%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:悔しい%22%3E悔しい%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cdiv class%3D%22segment%22%3Eい%3C/div%3E%3C/div%3E%3C/div%3E%3C/body%3E%3C/html%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:52:59 scheme: "gdlookup" +Debug: 05-18 12:52:59 host: "localhost" +Debug: 05-18 12:52:59 clear current dictionaries: " " +Debug: 05-18 12:52:59 some body finished +Debug: 05-18 12:52:59 one not finished. +Debug: 05-18 12:52:59 ====reading 3197 of (3197) bytes . Finished: 0 +Debug: 05-18 12:52:59 ====reading 0 of (3197) bytes . Finished: 0 +Debug: 05-18 12:52:59 ====reading 0 of (3197) bytes . Finished: 0 +Warning: 05-18 12:52:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:54:38 translating from clipboard or selection +Debug: 05-18 12:54:38 clipboard data: "I apologize for not addressing all your requirements. Here's a revised version that:\n\n Provides the CSS only at the end as a raw const string.\n Uses only div tags and a tags.\n Maintains the full functionality without removing features.\n\nHere's the updated code:\n\ncpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n.hakurei {\n font-size: 2rem;\n margin-bottom: 0.05em;\n margin-top: -0.2em;\n color: #1268c3;\n font-weight: normal;\n}\n.hakurei a {\n display: inline-block;\n font-weight: normal;\n color: royalblue;\n text-decoration: none;\n border-bottom: dashed max(1px, calc(1em / 16)) currentColor;\n}\n.hakurei a.hakurei-headword {\n background-color: #ddeeff;\n border-radius: 0.2rem;\n font-weight: 500;\n}\n.hakurei > ul {\n --size: 1rem;\n font-size: var(--size);\n padding-inline-start: var(--size);\n margin-block: 2px;\n}\n.hakurei .alternatives {\n --size: 1rem;\n display: grid;\n font-size: var(--size);\n gap: calc( var(--size) / 4);\n max-width: 100%;\n margin: 0 auto;\n grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));\n align-content: start;\n justify-content: space-around;\n text-align: left;\n padding: 5px 0px;\n}\n.hakurei .alternatives > ul {\n list-style-type: none;\n margin: 0;\n padding: calc( var(--size) / 4);\n background-color: hsl(0 0% 50% / 0.05);\n box-shadow: 0 0 4px hsl(0 0% 0% / 0.1);\n border-radius: 0.2rem;\n}\n.hakurei .alternatives > ul > li {\n margin-right: 1rem;\n}\n.container {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n}\n.segment {\n display: inline-block;\n}\n)\";\n\n output_html += \"
\";\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n\n // Output the CSS\n std::cout << \"\";\n // Output the HTML\n std::cout << output_html << std::endl;\n}" +Debug: 05-18 12:54:38 Current state: true false true true +Debug: 05-18 12:54:38 getResource: "gdlookup://localhost/?word=I apologize for not addressing all your requirements. Here%27s a revised version that: Provides the CSS only at the end as a raw const string. Uses only div tags and a tags. Maintains the full functionality without removing features. Here%27s the updated code: cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D )%22; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; // Output the CSS std::cout %3C%3C %22%3Cstyle%3E%22 %3C%3C css %3C%3C %22%3C/style%3E%22; // Output the HTML std::cout %3C%3C output_html %3C%3C std::endl; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:54:38 scheme: "gdlookup" +Debug: 05-18 12:54:38 host: "localhost" +Debug: 05-18 12:54:38 clear current dictionaries: "I apologize for not addressing all your requirements. Here's a revised version that: Provides the CSS only at the end as a raw const string. Uses only div tags and a tags. Maintains the full functionality without removing features. Here's the updated code: cpp #include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( .hakurei { font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: #1268c3; font-weight: normal; } .hakurei a { display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; } .hakurei a.hakurei-headword { background-color: #ddeeff; border-radius: 0.2rem; font-weight: 500; } .hakurei > ul { --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; } .hakurei .alternatives { --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; } .hakurei .alternatives > ul { list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0% 50% / 0.05); box-shadow: 0 0 4px hsl(0 0% 0% / 0.1); border-radius: 0.2rem; } .hakurei .alternatives > ul > li { margin-right: 1rem; } .container { display: flex; flex-wrap: wrap; gap: 10px; } .segment { display: inline-block; } )\"; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; // Output the CSS std::cout << \"\"; // Output the HTML std::cout << output_html << std::endl; }" +Debug: 05-18 12:54:38 some body finished +Debug: 05-18 12:54:38 one not finished. +Debug: 05-18 12:54:38 ====reading 8210 of (8210) bytes . Finished: 0 +Debug: 05-18 12:54:38 ====reading 0 of (8210) bytes . Finished: 0 +Debug: 05-18 12:54:38 ====reading 0 of (8210) bytes . Finished: 0 +Warning: 05-18 12:54:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:54:39 translating from clipboard or selection +Debug: 05-18 12:54:39 clipboard data: " // Output the CSS\n std::cout << \"\";\n // Output the HTML\n std::cout << output_html << std::endl;\n}\n" +Debug: 05-18 12:54:39 Current state: true false true true +Debug: 05-18 12:54:39 getResource: "gdlookup://localhost/?word=// Output the CSS std::cout %3C%3C %22%3Cstyle%3E%22 %3C%3C css %3C%3C %22%3C/style%3E%22; // Output the HTML std::cout %3C%3C output_html %3C%3C std::endl; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:54:39 scheme: "gdlookup" +Debug: 05-18 12:54:39 host: "localhost" +Debug: 05-18 12:54:39 clear current dictionaries: "// Output the CSS std::cout << \"\"; // Output the HTML std::cout << output_html << std::endl; }" +Debug: 05-18 12:54:39 some body finished +Debug: 05-18 12:54:39 one not finished. +Debug: 05-18 12:54:39 ====reading 1587 of (1587) bytes . Finished: 0 +Debug: 05-18 12:54:39 ====reading 0 of (1587) bytes . Finished: 0 +Debug: 05-18 12:54:39 ====reading 0 of (1587) bytes . Finished: 0 +Warning: 05-18 12:54:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:54:39 translating from clipboard or selection +Debug: 05-18 12:54:39 clipboard data: " // Output the CSS\n std::cout << \"\";\n // Output the HTML\n std::cout << output_html << std::endl;\n}\n" +Debug: 05-18 12:54:39 Current state: true false true true +Debug: 05-18 12:54:39 getResource: "gdlookup://localhost/?word=// Output the CSS std::cout %3C%3C %22%3Cstyle%3E%22 %3C%3C css %3C%3C %22%3C/style%3E%22; // Output the HTML std::cout %3C%3C output_html %3C%3C std::endl; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:54:39 scheme: "gdlookup" +Debug: 05-18 12:54:39 host: "localhost" +Debug: 05-18 12:54:39 clear current dictionaries: "// Output the CSS std::cout << \"\"; // Output the HTML std::cout << output_html << std::endl; }" +Debug: 05-18 12:54:39 some body finished +Debug: 05-18 12:54:39 one not finished. +Debug: 05-18 12:54:39 ====reading 1587 of (1587) bytes . Finished: 0 +Debug: 05-18 12:54:39 ====reading 0 of (1587) bytes . Finished: 0 +Debug: 05-18 12:54:39 ====reading 0 of (1587) bytes . Finished: 0 +Warning: 05-18 12:54:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 12:59:22 translating from clipboard or selection +Debug: 05-18 12:59:22 clipboard data: "it's likely that we" +Debug: 05-18 12:59:22 Current state: true false true true +Debug: 05-18 12:59:22 getResource: "gdlookup://localhost/?word=it%27s likely that we&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 12:59:22 scheme: "gdlookup" +Debug: 05-18 12:59:22 host: "localhost" +Debug: 05-18 12:59:22 clear current dictionaries: "it's likely that we" +Debug: 05-18 12:59:22 some body finished +Debug: 05-18 12:59:22 one not finished. +Debug: 05-18 12:59:22 ====reading 1422 of (1422) bytes . Finished: 0 +Debug: 05-18 12:59:22 ====reading 0 of (1422) bytes . Finished: 0 +Debug: 05-18 12:59:22 ====reading 0 of (1422) bytes . Finished: 0 +Warning: 05-18 12:59:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:00:18 translating from clipboard or selection +Debug: 05-18 13:00:18 clipboard data: "examine the bash script that i've sent earlier and debug to see each step of it and why it doens't enter in a loop" +Debug: 05-18 13:00:18 Current state: true false true true +Debug: 05-18 13:00:18 getResource: "gdlookup://localhost/?word=examine the bash script that i%27ve sent earlier and debug to see each step of it and why it doens%27t enter in a loop&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:00:18 scheme: "gdlookup" +Debug: 05-18 13:00:18 host: "localhost" +Debug: 05-18 13:00:18 clear current dictionaries: "examine the bash script that i've sent earlier and debug to see each step of it and why it doens't enter in a loop" +Debug: 05-18 13:00:18 some body finished +Debug: 05-18 13:00:18 one not finished. +Debug: 05-18 13:00:18 ====reading 1517 of (1517) bytes . Finished: 0 +Debug: 05-18 13:00:18 ====reading 0 of (1517) bytes . Finished: 0 +Debug: 05-18 13:00:18 ====reading 0 of (1517) bytes . Finished: 0 +Warning: 05-18 13:00:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:00:20 translating from clipboard or selection +Debug: 05-18 13:00:20 clipboard data: "examine the bash script that i've sent earlier and debug to see each step of it and why it doens't enter in a loop" +Debug: 05-18 13:00:20 Current state: true false true true +Debug: 05-18 13:00:20 getResource: "gdlookup://localhost/?word=examine the bash script that i%27ve sent earlier and debug to see each step of it and why it doens%27t enter in a loop&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:00:20 scheme: "gdlookup" +Debug: 05-18 13:00:20 host: "localhost" +Debug: 05-18 13:00:20 clear current dictionaries: "examine the bash script that i've sent earlier and debug to see each step of it and why it doens't enter in a loop" +Debug: 05-18 13:00:20 some body finished +Debug: 05-18 13:00:20 one not finished. +Debug: 05-18 13:00:20 ====reading 1517 of (1517) bytes . Finished: 0 +Debug: 05-18 13:00:20 ====reading 0 of (1517) bytes . Finished: 0 +Debug: 05-18 13:00:20 ====reading 0 of (1517) bytes . Finished: 0 +Warning: 05-18 13:00:20 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:00:47 translating from clipboard or selection +Debug: 05-18 13:00:47 clipboard data: " that i've sent earlier" +Debug: 05-18 13:00:47 Current state: true false true true +Debug: 05-18 13:00:47 getResource: "gdlookup://localhost/?word=that i%27ve sent earlier&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:00:47 scheme: "gdlookup" +Debug: 05-18 13:00:47 host: "localhost" +Debug: 05-18 13:00:47 clear current dictionaries: "that i've sent earlier" +Debug: 05-18 13:00:47 some body finished +Debug: 05-18 13:00:47 one not finished. +Debug: 05-18 13:00:47 ====reading 1425 of (1425) bytes . Finished: 0 +Debug: 05-18 13:00:47 ====reading 0 of (1425) bytes . Finished: 0 +Debug: 05-18 13:00:47 ====reading 0 of (1425) bytes . Finished: 0 +Warning: 05-18 13:00:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:00:49 translating from clipboard or selection +Debug: 05-18 13:00:49 clipboard data: "examine the bash script and debug to see each step of it and why it doens't enter in a loop" +Debug: 05-18 13:00:49 Current state: true false true true +Debug: 05-18 13:00:49 getResource: "gdlookup://localhost/?word=examine the bash script and debug to see each step of it and why it doens%27t enter in a loop&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:00:49 scheme: "gdlookup" +Debug: 05-18 13:00:49 host: "localhost" +Debug: 05-18 13:00:49 clear current dictionaries: "examine the bash script and debug to see each step of it and why it doens't enter in a loop" +Debug: 05-18 13:00:49 some body finished +Debug: 05-18 13:00:49 one not finished. +Debug: 05-18 13:00:49 ====reading 1494 of (1494) bytes . Finished: 0 +Debug: 05-18 13:00:49 ====reading 0 of (1494) bytes . Finished: 0 +Debug: 05-18 13:00:49 ====reading 0 of (1494) bytes . Finished: 0 +Warning: 05-18 13:00:49 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:01:05 translating from clipboard or selection +Debug: 05-18 13:01:05 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/mecab-cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=\"\"\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_user_dict() {\n\tfind \\\n\t\t\"$USER_DICT\" \\\n\t\t/usr/share/gd-tools/user_dic.dic \\\n\t\t~/.local/share/gd-tools/user_dic.dic \\\n\t\t-type f -print -quit 2>/dev/null\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t/usr/lib/mecab/dic/mecab-ipadic-neologd \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit 2>/dev/null\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tlocal -r user_dict=$(find_user_dict)\n\tlocal -a args=(\n\t\tmecab\n\t\t--node-format='%m'\n\t\t--unk-format='%m'\n\t\t--eos-format='
'\n\t\t--dicdir=\"$(find_dicdir)\"\n\t\t--userdic=\"${USER_DICT}\"\n\t)\n\tif [[ -n $user_dict ]]; then\n\t\targs+=(\"$user_dict\")\n\tfi\n\t\"${args[@]}\"\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
'\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
'\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 13:01:05 Current state: true false true true +Debug: 05-18 13:01:05 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/mecab-cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D%22%22 FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_user_dict() %7B find %5C %22$USER_DICT%22 %5C /usr/share/gd-tools/user_dic.dic %5C ~/.local/share/gd-tools/user_dic.dic %5C -type f -print -quit 2%3E/dev/null %7D find_dicdir() %7B dirname -- %22$( find %5C /usr/lib/mecab/dic/mecab-ipadic-neologd %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit 2%3E/dev/null )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi local -r user_dict%3D$(find_user_dict) local -a args%3D( mecab --node-format%3D%27%3Ca href%3D%22bword:%25f[6]%22%3E%25m%3C/a%3E%27 --unk-format%3D%27%3Ca href%3D%22bword:%25m%22%3E%25m%3C/a%3E%27 --eos-format%3D%27%3Cbr%3E%27 --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 ) if [[ -n $user_dict ]]; then args+%3D(%22$user_dict%22) fi %22$%7Bargs[@]%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E * %7B margin: 0; padding: 0; %7D .gd-mecab %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mecab a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mecab a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mecab a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if [[ -n $USER_DICT ]] %26%26 ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mecab%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:01:05 scheme: "gdlookup" +Debug: 05-18 13:01:05 host: "localhost" +Debug: 05-18 13:01:05 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/mecab-cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=\"\" FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_user_dict() { find \\ \"$USER_DICT\" \\ /usr/share/gd-tools/user_dic.dic \\ ~/.local/share/gd-tools/user_dic.dic \\ -type f -print -quit 2>/dev/null } find_dicdir() { dirname -- \"$( find \\ /usr/lib/mecab/dic/mecab-ipadic-neologd \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit 2>/dev/null )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi local -r user_dict=$(find_user_dict) local -a args=( mecab --node-format='%m' --unk-format='%m' --eos-format='
' --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" ) if [[ -n $user_dict ]]; then args+=(\"$user_dict\") fi \"${args[@]}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
' print_css } main \"$@\"" +Debug: 05-18 13:01:05 some body finished +Debug: 05-18 13:01:05 one not finished. +Debug: 05-18 13:01:05 ====reading 5843 of (5843) bytes . Finished: 0 +Debug: 05-18 13:01:05 ====reading 0 of (5843) bytes . Finished: 0 +Debug: 05-18 13:01:05 ====reading 0 of (5843) bytes . Finished: 0 +Warning: 05-18 13:01:05 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:01:05 translating from clipboard or selection +Debug: 05-18 13:01:05 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/mecab-cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=\"\"\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_user_dict() {\n\tfind \\\n\t\t\"$USER_DICT\" \\\n\t\t/usr/share/gd-tools/user_dic.dic \\\n\t\t~/.local/share/gd-tools/user_dic.dic \\\n\t\t-type f -print -quit 2>/dev/null\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t/usr/lib/mecab/dic/mecab-ipadic-neologd \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit 2>/dev/null\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tlocal -r user_dict=$(find_user_dict)\n\tlocal -a args=(\n\t\tmecab\n\t\t--node-format='%m'\n\t\t--unk-format='%m'\n\t\t--eos-format='
'\n\t\t--dicdir=\"$(find_dicdir)\"\n\t\t--userdic=\"${USER_DICT}\"\n\t)\n\tif [[ -n $user_dict ]]; then\n\t\targs+=(\"$user_dict\")\n\tfi\n\t\"${args[@]}\"\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
'\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
'\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 13:01:05 Current state: true false true true +Debug: 05-18 13:01:05 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/mecab-cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D%22%22 FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_user_dict() %7B find %5C %22$USER_DICT%22 %5C /usr/share/gd-tools/user_dic.dic %5C ~/.local/share/gd-tools/user_dic.dic %5C -type f -print -quit 2%3E/dev/null %7D find_dicdir() %7B dirname -- %22$( find %5C /usr/lib/mecab/dic/mecab-ipadic-neologd %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit 2%3E/dev/null )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi local -r user_dict%3D$(find_user_dict) local -a args%3D( mecab --node-format%3D%27%3Ca href%3D%22bword:%25f[6]%22%3E%25m%3C/a%3E%27 --unk-format%3D%27%3Ca href%3D%22bword:%25m%22%3E%25m%3C/a%3E%27 --eos-format%3D%27%3Cbr%3E%27 --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 ) if [[ -n $user_dict ]]; then args+%3D(%22$user_dict%22) fi %22$%7Bargs[@]%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E * %7B margin: 0; padding: 0; %7D .gd-mecab %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mecab a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mecab a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mecab a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if [[ -n $USER_DICT ]] %26%26 ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mecab%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:01:05 scheme: "gdlookup" +Debug: 05-18 13:01:05 host: "localhost" +Debug: 05-18 13:01:05 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/mecab-cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=\"\" FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_user_dict() { find \\ \"$USER_DICT\" \\ /usr/share/gd-tools/user_dic.dic \\ ~/.local/share/gd-tools/user_dic.dic \\ -type f -print -quit 2>/dev/null } find_dicdir() { dirname -- \"$( find \\ /usr/lib/mecab/dic/mecab-ipadic-neologd \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit 2>/dev/null )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi local -r user_dict=$(find_user_dict) local -a args=( mecab --node-format='%m' --unk-format='%m' --eos-format='
' --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" ) if [[ -n $user_dict ]]; then args+=(\"$user_dict\") fi \"${args[@]}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
' print_css } main \"$@\"" +Debug: 05-18 13:01:05 some body finished +Debug: 05-18 13:01:05 one not finished. +Debug: 05-18 13:01:05 ====reading 5843 of (5843) bytes . Finished: 0 +Debug: 05-18 13:01:05 ====reading 0 of (5843) bytes . Finished: 0 +Debug: 05-18 13:01:05 ====reading 0 of (5843) bytes . Finished: 0 +Warning: 05-18 13:01:05 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:01:05 translating from clipboard or selection +Debug: 05-18 13:01:05 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/mecab-cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=\"\"\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_user_dict() {\n\tfind \\\n\t\t\"$USER_DICT\" \\\n\t\t/usr/share/gd-tools/user_dic.dic \\\n\t\t~/.local/share/gd-tools/user_dic.dic \\\n\t\t-type f -print -quit 2>/dev/null\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t/usr/lib/mecab/dic/mecab-ipadic-neologd \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit 2>/dev/null\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tlocal -r user_dict=$(find_user_dict)\n\tlocal -a args=(\n\t\tmecab\n\t\t--node-format='%m'\n\t\t--unk-format='%m'\n\t\t--eos-format='
'\n\t\t--dicdir=\"$(find_dicdir)\"\n\t\t--userdic=\"${USER_DICT}\"\n\t)\n\tif [[ -n $user_dict ]]; then\n\t\targs+=(\"$user_dict\")\n\tfi\n\t\"${args[@]}\"\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
'\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
'\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 13:01:05 Current state: true false true true +Debug: 05-18 13:01:05 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/mecab-cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D%22%22 FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_user_dict() %7B find %5C %22$USER_DICT%22 %5C /usr/share/gd-tools/user_dic.dic %5C ~/.local/share/gd-tools/user_dic.dic %5C -type f -print -quit 2%3E/dev/null %7D find_dicdir() %7B dirname -- %22$( find %5C /usr/lib/mecab/dic/mecab-ipadic-neologd %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit 2%3E/dev/null )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi local -r user_dict%3D$(find_user_dict) local -a args%3D( mecab --node-format%3D%27%3Ca href%3D%22bword:%25f[6]%22%3E%25m%3C/a%3E%27 --unk-format%3D%27%3Ca href%3D%22bword:%25m%22%3E%25m%3C/a%3E%27 --eos-format%3D%27%3Cbr%3E%27 --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 ) if [[ -n $user_dict ]]; then args+%3D(%22$user_dict%22) fi %22$%7Bargs[@]%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E * %7B margin: 0; padding: 0; %7D .gd-mecab %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mecab a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mecab a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mecab a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if [[ -n $USER_DICT ]] %26%26 ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mecab%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:01:05 scheme: "gdlookup" +Debug: 05-18 13:01:05 host: "localhost" +Debug: 05-18 13:01:05 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/mecab-cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=\"\" FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_user_dict() { find \\ \"$USER_DICT\" \\ /usr/share/gd-tools/user_dic.dic \\ ~/.local/share/gd-tools/user_dic.dic \\ -type f -print -quit 2>/dev/null } find_dicdir() { dirname -- \"$( find \\ /usr/lib/mecab/dic/mecab-ipadic-neologd \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit 2>/dev/null )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi local -r user_dict=$(find_user_dict) local -a args=( mecab --node-format='%m' --unk-format='%m' --eos-format='
' --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" ) if [[ -n $user_dict ]]; then args+=(\"$user_dict\") fi \"${args[@]}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
' print_css } main \"$@\"" +Debug: 05-18 13:01:05 some body finished +Debug: 05-18 13:01:05 one not finished. +Debug: 05-18 13:01:05 ====reading 5843 of (5843) bytes . Finished: 0 +Debug: 05-18 13:01:05 ====reading 0 of (5843) bytes . Finished: 0 +Debug: 05-18 13:01:05 ====reading 0 of (5843) bytes . Finished: 0 +Warning: 05-18 13:01:05 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:01:59 translating from clipboard or selection +Debug: 05-18 13:01:59 clipboard data: "highlight_word(): Highlights the target word in the HTML output." +Debug: 05-18 13:01:59 Current state: true false true true +Debug: 05-18 13:01:59 getResource: "gdlookup://localhost/?word=highlight_word(): Highlights the target word in the HTML output.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:01:59 scheme: "gdlookup" +Debug: 05-18 13:01:59 host: "localhost" +Debug: 05-18 13:01:59 clear current dictionaries: "highlight_word(): Highlights the target word in the HTML output." +Debug: 05-18 13:01:59 some body finished +Debug: 05-18 13:01:59 one not finished. +Debug: 05-18 13:01:59 ====reading 1467 of (1467) bytes . Finished: 0 +Debug: 05-18 13:01:59 ====reading 0 of (1467) bytes . Finished: 0 +Debug: 05-18 13:01:59 ====reading 0 of (1467) bytes . Finished: 0 +Warning: 05-18 13:01:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:02:00 translating from clipboard or selection +Debug: 05-18 13:02:00 clipboard data: "highlight_word(): Highlights the target word in the HTML output." +Debug: 05-18 13:02:00 Current state: true false true true +Debug: 05-18 13:02:00 getResource: "gdlookup://localhost/?word=highlight_word(): Highlights the target word in the HTML output.&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:02:00 scheme: "gdlookup" +Debug: 05-18 13:02:00 host: "localhost" +Debug: 05-18 13:02:00 clear current dictionaries: "highlight_word(): Highlights the target word in the HTML output." +Debug: 05-18 13:02:00 some body finished +Debug: 05-18 13:02:00 one not finished. +Debug: 05-18 13:02:00 ====reading 1467 of (1467) bytes . Finished: 0 +Debug: 05-18 13:02:00 ====reading 0 of (1467) bytes . Finished: 0 +Debug: 05-18 13:02:00 ====reading 0 of (1467) bytes . Finished: 0 +Warning: 05-18 13:02:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:33:07 translating from clipboard or selection +Debug: 05-18 13:33:07 clipboard data: "se for " +Debug: 05-18 13:33:07 Current state: true false true true +Debug: 05-18 13:33:07 getResource: "gdlookup://localhost/?word=se for&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:33:07 scheme: "gdlookup" +Debug: 05-18 13:33:07 host: "localhost" +Debug: 05-18 13:33:07 clear current dictionaries: "se for" +Debug: 05-18 13:33:07 some body finished +Debug: 05-18 13:33:07 one not finished. +Debug: 05-18 13:33:07 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 13:33:07 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 13:33:07 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 13:33:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 13:35:06 translating from clipboard or selection +Debug: 05-18 13:35:06 clipboard data: "ehh sim" +Debug: 05-18 13:35:06 Current state: true false true true +Debug: 05-18 13:35:06 getResource: "gdlookup://localhost/?word=ehh sim&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 13:35:06 scheme: "gdlookup" +Debug: 05-18 13:35:06 host: "localhost" +Debug: 05-18 13:35:06 clear current dictionaries: "ehh sim" +Debug: 05-18 13:35:06 some body finished +Debug: 05-18 13:35:06 one not finished. +Debug: 05-18 13:35:06 ====reading 1410 of (1410) bytes . Finished: 0 +Debug: 05-18 13:35:06 ====reading 0 of (1410) bytes . Finished: 0 +Debug: 05-18 13:35:06 ====reading 0 of (1410) bytes . Finished: 0 +Warning: 05-18 13:35:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:21:04 translating from clipboard or selection +Debug: 05-18 14:21:04 clipboard data: "hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:04 Current state: true false true true +Debug: 05-18 14:21:04 getResource: "gdlookup://localhost/?word=hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:21:04 scheme: "gdlookup" +Debug: 05-18 14:21:04 host: "localhost" +Debug: 05-18 14:21:04 clear current dictionaries: "hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:04 some body finished +Debug: 05-18 14:21:04 one not finished. +Debug: 05-18 14:21:04 ====reading 1453 of (1453) bytes . Finished: 0 +Debug: 05-18 14:21:04 ====reading 0 of (1453) bytes . Finished: 0 +Debug: 05-18 14:21:04 ====reading 0 of (1453) bytes . Finished: 0 +Warning: 05-18 14:21:04 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:21:04 translating from clipboard or selection +Debug: 05-18 14:21:04 clipboard data: "hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:04 Current state: true false true true +Debug: 05-18 14:21:04 getResource: "gdlookup://localhost/?word=hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:21:04 scheme: "gdlookup" +Debug: 05-18 14:21:04 host: "localhost" +Debug: 05-18 14:21:04 clear current dictionaries: "hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:04 some body finished +Debug: 05-18 14:21:04 one not finished. +Debug: 05-18 14:21:04 ====reading 1453 of (1453) bytes . Finished: 0 +Debug: 05-18 14:21:04 ====reading 0 of (1453) bytes . Finished: 0 +Debug: 05-18 14:21:04 ====reading 0 of (1453) bytes . Finished: 0 +Warning: 05-18 14:21:04 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:21:04 translating from clipboard or selection +Debug: 05-18 14:21:04 clipboard data: "hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:04 Current state: true false true true +Debug: 05-18 14:21:04 getResource: "gdlookup://localhost/?word=hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:21:04 scheme: "gdlookup" +Debug: 05-18 14:21:04 host: "localhost" +Debug: 05-18 14:21:04 clear current dictionaries: "hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:04 some body finished +Debug: 05-18 14:21:04 one not finished. +Debug: 05-18 14:21:04 ====reading 1453 of (1453) bytes . Finished: 0 +Debug: 05-18 14:21:04 ====reading 0 of (1453) bytes . Finished: 0 +Debug: 05-18 14:21:04 ====reading 0 of (1453) bytes . Finished: 0 +Warning: 05-18 14:21:05 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:21:06 translating from clipboard or selection +Debug: 05-18 14:21:06 clipboard data: "ajattix.loophole.site/hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:06 Current state: true false true true +Debug: 05-18 14:21:06 getResource: "gdlookup://localhost/?word=ajattix.loophole.site/hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:21:06 scheme: "gdlookup" +Debug: 05-18 14:21:06 host: "localhost" +Debug: 05-18 14:21:06 clear current dictionaries: "ajattix.loophole.site/hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:06 some body finished +Debug: 05-18 14:21:06 one not finished. +Debug: 05-18 14:21:06 ====reading 1475 of (1475) bytes . Finished: 0 +Debug: 05-18 14:21:06 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-18 14:21:06 ====reading 0 of (1475) bytes . Finished: 0 +Warning: 05-18 14:21:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:21:07 translating from clipboard or selection +Debug: 05-18 14:21:07 clipboard data: "ajattix.loophole.site/hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:07 Current state: true false true true +Debug: 05-18 14:21:07 getResource: "gdlookup://localhost/?word=ajattix.loophole.site/hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:21:07 scheme: "gdlookup" +Debug: 05-18 14:21:07 host: "localhost" +Debug: 05-18 14:21:07 clear current dictionaries: "ajattix.loophole.site/hashirama/gd-tools/raw/branch/main/src/gd-mecab.sh" +Debug: 05-18 14:21:07 some body finished +Debug: 05-18 14:21:07 one not finished. +Debug: 05-18 14:21:07 ====reading 1475 of (1475) bytes . Finished: 0 +Debug: 05-18 14:21:07 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-18 14:21:07 ====reading 0 of (1475) bytes . Finished: 0 +Warning: 05-18 14:21:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:21:24 translating from clipboard or selection +Debug: 05-18 14:21:24 clipboard data: "nice" +Debug: 05-18 14:21:24 Current state: true false true true +Debug: 05-18 14:21:24 getResource: "gdlookup://localhost/?word=nice&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:21:24 scheme: "gdlookup" +Debug: 05-18 14:21:24 host: "localhost" +Debug: 05-18 14:21:24 clear current dictionaries: "nice" +Debug: 05-18 14:21:24 some body finished +Debug: 05-18 14:21:24 one not finished. +Debug: 05-18 14:21:24 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 14:21:24 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 14:21:24 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 14:21:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:53:36 translating from clipboard or selection +Debug: 05-18 14:53:36 clipboard data: "debug " +Debug: 05-18 14:53:36 Current state: true true false true +Debug: 05-18 14:53:36 getResource: "gdlookup://localhost/?word=debug&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:53:36 scheme: "gdlookup" +Debug: 05-18 14:53:36 host: "localhost" +Debug: 05-18 14:53:36 clear current dictionaries: "debug" +Debug: 05-18 14:53:36 some body finished +Debug: 05-18 14:53:36 one not finished. +Debug: 05-18 14:53:36 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 14:53:36 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 14:53:36 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 14:53:36 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:54:13 translating from clipboard or selection +Debug: 05-18 14:54:13 clipboard data: "debug " +Debug: 05-18 14:54:13 Current state: true false false true +Debug: 05-18 14:54:13 getResource: "gdlookup://localhost/?word=debug&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:54:13 scheme: "gdlookup" +Debug: 05-18 14:54:13 host: "localhost" +Debug: 05-18 14:54:13 clear current dictionaries: "debug" +Debug: 05-18 14:54:13 some body finished +Debug: 05-18 14:54:13 one not finished. +Debug: 05-18 14:54:13 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 14:54:13 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 14:54:13 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 14:54:13 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:54:18 translating from clipboard or selection +Debug: 05-18 14:54:18 clipboard data: "debug " +Debug: 05-18 14:54:18 Current state: true false true true +Debug: 05-18 14:54:18 getResource: "gdlookup://localhost/?word=debug&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:54:18 scheme: "gdlookup" +Debug: 05-18 14:54:18 host: "localhost" +Debug: 05-18 14:54:18 clear current dictionaries: "debug" +Debug: 05-18 14:54:18 some body finished +Debug: 05-18 14:54:18 one not finished. +Debug: 05-18 14:54:18 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 14:54:18 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 14:54:18 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 14:54:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:54:19 translating from clipboard or selection +Debug: 05-18 14:54:19 clipboard data: "debug " +Debug: 05-18 14:54:19 Current state: true false true true +Debug: 05-18 14:54:19 getResource: "gdlookup://localhost/?word=debug&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:54:19 scheme: "gdlookup" +Debug: 05-18 14:54:19 host: "localhost" +Debug: 05-18 14:54:19 clear current dictionaries: "debug" +Debug: 05-18 14:54:19 some body finished +Debug: 05-18 14:54:19 one not finished. +Debug: 05-18 14:54:19 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 14:54:19 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 14:54:19 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 14:54:19 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:55:20 translating from clipboard or selection +Debug: 05-18 14:55:20 clipboard data: "" +Debug: 05-18 14:55:49 translating from clipboard or selection +Debug: 05-18 14:55:49 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += R\"(\n\n\n\n\n\n\n
\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 14:55:49 Current state: true false true true +Debug: 05-18 14:55:49 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D R%22( %3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:55:49 scheme: "gdlookup" +Debug: 05-18 14:55:49 host: "localhost" +Debug: 05-18 14:55:49 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += R\"(
)\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 14:55:49 some body finished +Debug: 05-18 14:55:49 one not finished. +Debug: 05-18 14:55:49 ====reading 10778 of (10778) bytes . Finished: 0 +Debug: 05-18 14:55:49 ====reading 0 of (10778) bytes . Finished: 0 +Debug: 05-18 14:55:49 ====reading 0 of (10778) bytes . Finished: 0 +Warning: 05-18 14:55:49 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:55:50 translating from clipboard or selection +Debug: 05-18 14:55:50 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += R\"(\n\n\n\n\n\n\n
\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 14:55:50 Current state: true false true true +Debug: 05-18 14:55:50 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D R%22( %3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:55:50 scheme: "gdlookup" +Debug: 05-18 14:55:50 host: "localhost" +Debug: 05-18 14:55:50 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += R\"(
)\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 14:55:50 some body finished +Debug: 05-18 14:55:50 one not finished. +Debug: 05-18 14:55:50 ====reading 10778 of (10778) bytes . Finished: 0 +Debug: 05-18 14:55:50 ====reading 0 of (10778) bytes . Finished: 0 +Debug: 05-18 14:55:50 ====reading 0 of (10778) bytes . Finished: 0 +Warning: 05-18 14:55:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:55:50 translating from clipboard or selection +Debug: 05-18 14:55:50 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += R\"(\n\n\n\n\n\n\n
\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 14:55:50 Current state: true false true true +Debug: 05-18 14:55:50 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D R%22( %3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E %3C/head%3E %3Cbody%3E %3Cdiv class%3D%22hakurei%22%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:55:50 scheme: "gdlookup" +Debug: 05-18 14:55:50 host: "localhost" +Debug: 05-18 14:55:50 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += R\"(
)\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 14:55:50 some body finished +Debug: 05-18 14:55:50 one not finished. +Debug: 05-18 14:55:50 ====reading 10778 of (10778) bytes . Finished: 0 +Debug: 05-18 14:55:50 ====reading 0 of (10778) bytes . Finished: 0 +Debug: 05-18 14:55:50 ====reading 0 of (10778) bytes . Finished: 0 +Warning: 05-18 14:55:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:56:08 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:56:08 scheme: "gdlookup" +Debug: 05-18 14:56:08 host: "localhost" +Debug: 05-18 14:56:08 clear current dictionaries: "悔しい" +Debug: 05-18 14:56:08 some body finished +Debug: 05-18 14:56:08 one not finished. +Debug: 05-18 14:56:08 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 14:56:08 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 14:56:08 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 14:56:08 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:56:09 translating from clipboard or selection +Debug: 05-18 14:56:09 clipboard data: "悔しい" +Debug: 05-18 14:56:09 Current state: true false true true +Debug: 05-18 14:56:09 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:56:09 scheme: "gdlookup" +Debug: 05-18 14:56:09 host: "localhost" +Debug: 05-18 14:56:09 clear current dictionaries: "悔しい" +Debug: 05-18 14:56:09 some body finished +Debug: 05-18 14:56:09 one not finished. +Debug: 05-18 14:56:09 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 14:56:09 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 14:56:09 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 14:56:09 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:56:10 translating from clipboard or selection +Debug: 05-18 14:56:10 clipboard data: "悔しい" +Debug: 05-18 14:56:10 Current state: true false true true +Debug: 05-18 14:56:10 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:56:10 scheme: "gdlookup" +Debug: 05-18 14:56:10 host: "localhost" +Debug: 05-18 14:56:10 clear current dictionaries: "悔しい" +Debug: 05-18 14:56:10 some body finished +Debug: 05-18 14:56:10 one not finished. +Debug: 05-18 14:56:10 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 14:56:10 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 14:56:10 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 14:56:10 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:56:45 translating from clipboard or selection +Debug: 05-18 14:56:45 clipboard data: "Compilation failed due to following error(s)." +Debug: 05-18 14:56:45 Current state: true true false true +Debug: 05-18 14:56:45 getResource: "gdlookup://localhost/?word=Compilation failed due to following error(s).&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:56:45 scheme: "gdlookup" +Debug: 05-18 14:56:45 host: "localhost" +Debug: 05-18 14:56:45 clear current dictionaries: "Compilation failed due to following error(s)." +Debug: 05-18 14:56:45 some body finished +Debug: 05-18 14:56:45 one not finished. +Debug: 05-18 14:56:45 ====reading 1448 of (1448) bytes . Finished: 0 +Debug: 05-18 14:56:45 ====reading 0 of (1448) bytes . Finished: 0 +Debug: 05-18 14:56:45 ====reading 0 of (1448) bytes . Finished: 0 +Warning: 05-18 14:56:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:57:16 translating from clipboard or selection +Debug: 05-18 14:57:16 clipboard data: " output_html += R\"(\n\n\n" +Debug: 05-18 14:57:16 Current state: true false false true +Debug: 05-18 14:57:16 getResource: "gdlookup://localhost/?word=output_html +%3D R%22( %3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:57:16 scheme: "gdlookup" +Debug: 05-18 14:57:16 host: "localhost" +Debug: 05-18 14:57:16 clear current dictionaries: "output_html += R\"( " +Debug: 05-18 14:57:16 some body finished +Debug: 05-18 14:57:16 one not finished. +Debug: 05-18 14:57:16 ====reading 1474 of (1474) bytes . Finished: 0 +Debug: 05-18 14:57:16 ====reading 0 of (1474) bytes . Finished: 0 +Debug: 05-18 14:57:16 ====reading 0 of (1474) bytes . Finished: 0 +Warning: 05-18 14:57:16 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:57:17 translating from clipboard or selection +Debug: 05-18 14:57:17 clipboard data: "\n\n" +Debug: 05-18 14:57:17 Current state: true false true true +Debug: 05-18 14:57:17 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:57:17 scheme: "gdlookup" +Debug: 05-18 14:57:17 host: "localhost" +Debug: 05-18 14:57:17 clear current dictionaries: " " +Debug: 05-18 14:57:17 some body finished +Debug: 05-18 14:57:17 one not finished. +Debug: 05-18 14:57:17 ====reading 1450 of (1450) bytes . Finished: 0 +Debug: 05-18 14:57:17 ====reading 0 of (1450) bytes . Finished: 0 +Debug: 05-18 14:57:17 ====reading 0 of (1450) bytes . Finished: 0 +Warning: 05-18 14:57:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:57:27 translating from clipboard or selection +Debug: 05-18 14:57:27 clipboard data: "\n\n" +Debug: 05-18 14:57:27 Current state: true false true true +Debug: 05-18 14:57:27 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E %3Chtml%3E %3Chead%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:57:27 scheme: "gdlookup" +Debug: 05-18 14:57:27 host: "localhost" +Debug: 05-18 14:57:27 clear current dictionaries: " " +Debug: 05-18 14:57:27 some body finished +Debug: 05-18 14:57:27 one not finished. +Debug: 05-18 14:57:27 ====reading 1450 of (1450) bytes . Finished: 0 +Debug: 05-18 14:57:27 ====reading 0 of (1450) bytes . Finished: 0 +Debug: 05-18 14:57:27 ====reading 0 of (1450) bytes . Finished: 0 +Warning: 05-18 14:57:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:57:42 translating from clipboard or selection +Debug: 05-18 14:57:42 clipboard data: "" +Debug: 05-18 14:57:42 Current state: true false true true +Debug: 05-18 14:57:42 getResource: "gdlookup://localhost/?word=%3Cbody%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:57:42 scheme: "gdlookup" +Debug: 05-18 14:57:42 host: "localhost" +Debug: 05-18 14:57:42 clear current dictionaries: "" +Debug: 05-18 14:57:42 some body finished +Debug: 05-18 14:57:42 one not finished. +Debug: 05-18 14:57:42 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 14:57:42 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 14:57:42 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 14:57:42 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:57:43 translating from clipboard or selection +Debug: 05-18 14:57:43 clipboard data: "\n" +Debug: 05-18 14:57:43 Current state: true false true true +Debug: 05-18 14:57:43 getResource: "gdlookup://localhost/?word=%3C/head%3E %3Cbody%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:57:43 scheme: "gdlookup" +Debug: 05-18 14:57:43 host: "localhost" +Debug: 05-18 14:57:43 clear current dictionaries: " " +Debug: 05-18 14:57:43 some body finished +Debug: 05-18 14:57:43 one not finished. +Debug: 05-18 14:57:43 ====reading 1429 of (1429) bytes . Finished: 0 +Debug: 05-18 14:57:43 ====reading 0 of (1429) bytes . Finished: 0 +Debug: 05-18 14:57:43 ====reading 0 of (1429) bytes . Finished: 0 +Warning: 05-18 14:57:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:57:44 translating from clipboard or selection +Debug: 05-18 14:57:44 clipboard data: "\n" +Debug: 05-18 14:57:44 Current state: true false true true +Debug: 05-18 14:57:44 getResource: "gdlookup://localhost/?word=%3C/head%3E %3Cbody%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:57:44 scheme: "gdlookup" +Debug: 05-18 14:57:44 host: "localhost" +Debug: 05-18 14:57:44 clear current dictionaries: " " +Debug: 05-18 14:57:44 some body finished +Debug: 05-18 14:57:44 one not finished. +Debug: 05-18 14:57:44 ====reading 1429 of (1429) bytes . Finished: 0 +Debug: 05-18 14:57:44 ====reading 0 of (1429) bytes . Finished: 0 +Debug: 05-18 14:57:44 ====reading 0 of (1429) bytes . Finished: 0 +Warning: 05-18 14:57:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:57:45 translating from clipboard or selection +Debug: 05-18 14:57:45 clipboard data: "\n" +Debug: 05-18 14:57:45 Current state: true false true true +Debug: 05-18 14:57:45 getResource: "gdlookup://localhost/?word=%3C/head%3E %3Cbody%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:57:45 scheme: "gdlookup" +Debug: 05-18 14:57:45 host: "localhost" +Debug: 05-18 14:57:45 clear current dictionaries: " " +Debug: 05-18 14:57:45 some body finished +Debug: 05-18 14:57:45 one not finished. +Debug: 05-18 14:57:45 ====reading 1429 of (1429) bytes . Finished: 0 +Debug: 05-18 14:57:45 ====reading 0 of (1429) bytes . Finished: 0 +Debug: 05-18 14:57:45 ====reading 0 of (1429) bytes . Finished: 0 +Warning: 05-18 14:57:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:58:16 translating from clipboard or selection +Debug: 05-18 14:58:16 clipboard data: "" +Debug: 05-18 14:58:18 Current state: true false true true +Debug: 05-18 14:58:18 getResource: "gdlookup://localhost/?word=%3C/body%3E%3C/html%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:58:18 scheme: "gdlookup" +Debug: 05-18 14:58:18 host: "localhost" +Debug: 05-18 14:58:18 clear current dictionaries: "" +Debug: 05-18 14:58:18 some body finished +Debug: 05-18 14:58:18 one not finished. +Debug: 05-18 14:58:18 ====reading 1429 of (1429) bytes . Finished: 0 +Debug: 05-18 14:58:18 ====reading 0 of (1429) bytes . Finished: 0 +Debug: 05-18 14:58:18 ====reading 0 of (1429) bytes . Finished: 0 +Warning: 05-18 14:58:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 14:58:19 translating from clipboard or selection +Debug: 05-18 14:58:19 clipboard data: "" +Debug: 05-18 14:58:19 Current state: true false true true +Debug: 05-18 14:58:19 getResource: "gdlookup://localhost/?word=%3C/body%3E%3C/html%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 14:58:19 scheme: "gdlookup" +Debug: 05-18 14:58:19 host: "localhost" +Debug: 05-18 14:58:19 clear current dictionaries: "" +Debug: 05-18 14:58:19 some body finished +Debug: 05-18 14:58:19 one not finished. +Debug: 05-18 14:58:19 ====reading 1429 of (1429) bytes . Finished: 0 +Debug: 05-18 14:58:19 ====reading 0 of (1429) bytes . Finished: 0 +Debug: 05-18 14:58:19 ====reading 0 of (1429) bytes . Finished: 0 +Warning: 05-18 14:58:19 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:01:49 translating from clipboard or selection +Debug: 05-18 15:01:49 clipboard data: "+=" +Debug: 05-18 15:01:49 Current state: true false true true +Debug: 05-18 15:01:49 getResource: "gdlookup://localhost/?word=+%3D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:01:49 scheme: "gdlookup" +Debug: 05-18 15:01:49 host: "localhost" +Debug: 05-18 15:01:49 clear current dictionaries: "+=" +Debug: 05-18 15:01:49 some body finished +Debug: 05-18 15:01:49 one not finished. +Debug: 05-18 15:01:49 ====reading 1405 of (1405) bytes . Finished: 0 +Debug: 05-18 15:01:49 ====reading 0 of (1405) bytes . Finished: 0 +Debug: 05-18 15:01:49 ====reading 0 of (1405) bytes . Finished: 0 +Warning: 05-18 15:01:49 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:01:50 translating from clipboard or selection +Debug: 05-18 15:01:50 clipboard data: "+=" +Debug: 05-18 15:01:50 Current state: true false true true +Debug: 05-18 15:01:50 getResource: "gdlookup://localhost/?word=+%3D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:01:50 scheme: "gdlookup" +Debug: 05-18 15:01:50 host: "localhost" +Debug: 05-18 15:01:50 clear current dictionaries: "+=" +Debug: 05-18 15:01:50 some body finished +Debug: 05-18 15:01:50 one not finished. +Debug: 05-18 15:01:50 ====reading 1405 of (1405) bytes . Finished: 0 +Debug: 05-18 15:01:50 ====reading 0 of (1405) bytes . Finished: 0 +Debug: 05-18 15:01:50 ====reading 0 of (1405) bytes . Finished: 0 +Warning: 05-18 15:01:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:01:52 translating from clipboard or selection +Debug: 05-18 15:01:52 clipboard data: "+=" +Debug: 05-18 15:01:52 Current state: true false true true +Debug: 05-18 15:01:52 getResource: "gdlookup://localhost/?word=+%3D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:01:52 scheme: "gdlookup" +Debug: 05-18 15:01:52 host: "localhost" +Debug: 05-18 15:01:52 clear current dictionaries: "+=" +Debug: 05-18 15:01:52 some body finished +Debug: 05-18 15:01:52 one not finished. +Debug: 05-18 15:01:52 ====reading 1405 of (1405) bytes . Finished: 0 +Debug: 05-18 15:01:52 ====reading 0 of (1405) bytes . Finished: 0 +Debug: 05-18 15:01:52 ====reading 0 of (1405) bytes . Finished: 0 +Warning: 05-18 15:01:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:03:22 getResource: "gdlookup://localhost/?word=悔しい&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:03:22 scheme: "gdlookup" +Debug: 05-18 15:03:22 host: "localhost" +Debug: 05-18 15:03:22 clear current dictionaries: "悔しい" +Debug: 05-18 15:03:22 some body finished +Debug: 05-18 15:03:22 one not finished. +Debug: 05-18 15:03:22 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 15:03:22 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 15:03:22 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 15:03:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:04:57 translating from clipboard or selection +Debug: 05-18 15:04:57 clipboard data: "・レボリ" +Debug: 05-18 15:04:57 Current state: true true false true +Debug: 05-18 15:04:57 getResource: "gdlookup://localhost/?word=・レボリ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:04:57 scheme: "gdlookup" +Debug: 05-18 15:04:57 host: "localhost" +Debug: 05-18 15:04:57 clear current dictionaries: "・レボリ" +Debug: 05-18 15:04:57 some body finished +Debug: 05-18 15:04:57 one not finished. +Debug: 05-18 15:04:57 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 15:04:57 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 15:04:57 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 15:04:57 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:04:58 translating from clipboard or selection +Debug: 05-18 15:04:58 clipboard data: "・レボリ" +Debug: 05-18 15:04:58 Current state: true false false true +Debug: 05-18 15:04:58 getResource: "gdlookup://localhost/?word=・レボリ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:04:58 scheme: "gdlookup" +Debug: 05-18 15:04:58 host: "localhost" +Debug: 05-18 15:04:58 clear current dictionaries: "・レボリ" +Debug: 05-18 15:04:58 some body finished +Debug: 05-18 15:04:58 one not finished. +Debug: 05-18 15:04:58 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 15:04:58 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 15:04:58 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 15:04:58 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:08:00 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:08:00 scheme: "gdlookup" +Debug: 05-18 15:08:00 host: "localhost" +Debug: 05-18 15:08:00 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 15:08:00 some body finished +Debug: 05-18 15:08:00 one not finished. +Debug: 05-18 15:08:00 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 15:08:00 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 15:08:00 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 15:08:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:08:02 translating from clipboard or selection +Debug: 05-18 15:08:02 clipboard data: "転生したら剣でした" +Debug: 05-18 15:08:02 Current state: true false true true +Debug: 05-18 15:08:02 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:08:02 scheme: "gdlookup" +Debug: 05-18 15:08:02 host: "localhost" +Debug: 05-18 15:08:02 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 15:08:02 some body finished +Debug: 05-18 15:08:02 one not finished. +Debug: 05-18 15:08:02 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 15:08:02 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 15:08:02 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 15:08:02 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 15:08:11 translating from clipboard or selection +Debug: 05-18 15:08:11 clipboard data: "転生\">転生
" +Debug: 05-18 15:08:11 Current state: true true false true +Debug: 05-18 15:08:11 getResource: "gdlookup://localhost/?word=転生%22%3E転生%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:した%22%3Eした%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca class%3D href%3D%22bword:した%22%3Eした%3C/a%3E%3C/li%3E%3Cli%3E%3Ca class%3D href%3D%22bword:したら%22%3Eしたら%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cdiv class%3D%22segment%22%3Eら%3C/div%3E%3Cdiv class%3D%22segment%22%3E剣%3C/div%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:でし%22%3Eでし%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca class%3D href%3D%22bword:でし%22%3Eでし%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cdiv class%3D%22segment%22%3Eた%3C/div%3E%3C/div%3E%3C/div%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 15:08:11 scheme: "gdlookup" +Debug: 05-18 15:08:11 host: "localhost" +Debug: 05-18 15:08:11 clear current dictionaries: "転生\">転生
" +Debug: 05-18 15:08:11 some body finished +Debug: 05-18 15:08:11 one not finished. +Debug: 05-18 15:08:11 ====reading 2344 of (2344) bytes . Finished: 0 +Debug: 05-18 15:08:11 ====reading 0 of (2344) bytes . Finished: 0 +Debug: 05-18 15:08:11 ====reading 0 of (2344) bytes . Finished: 0 +Warning: 05-18 15:08:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:39:08 translating from clipboard or selection +Debug: 05-18 16:39:08 clipboard data: "柱間" +Debug: 05-18 16:39:08 Current state: true false false true +Debug: 05-18 16:39:08 getResource: "gdlookup://localhost/?word=柱間&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:39:08 scheme: "gdlookup" +Debug: 05-18 16:39:08 host: "localhost" +Debug: 05-18 16:39:08 clear current dictionaries: "柱間" +Debug: 05-18 16:39:08 some body finished +Debug: 05-18 16:39:08 one not finished. +Debug: 05-18 16:39:08 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 16:39:08 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 16:39:08 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 16:39:08 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:40:09 translating from clipboard or selection +Debug: 05-18 16:40:09 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:40:09 Current state: true false true true +Debug: 05-18 16:40:09 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:40:09 scheme: "gdlookup" +Debug: 05-18 16:40:09 host: "localhost" +Debug: 05-18 16:40:09 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:40:09 some body finished +Debug: 05-18 16:40:09 one not finished. +Debug: 05-18 16:40:09 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:09 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:09 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:40:09 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:40:12 translating from clipboard or selection +Debug: 05-18 16:40:12 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:40:12 Current state: true false true true +Debug: 05-18 16:40:12 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:40:12 scheme: "gdlookup" +Debug: 05-18 16:40:12 host: "localhost" +Debug: 05-18 16:40:12 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:40:12 some body finished +Debug: 05-18 16:40:12 one not finished. +Debug: 05-18 16:40:12 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:12 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:12 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:40:12 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:40:12 translating from clipboard or selection +Debug: 05-18 16:40:12 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:40:12 Current state: true false true true +Debug: 05-18 16:40:12 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:40:12 scheme: "gdlookup" +Debug: 05-18 16:40:12 host: "localhost" +Debug: 05-18 16:40:12 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:40:12 some body finished +Debug: 05-18 16:40:12 one not finished. +Debug: 05-18 16:40:12 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:12 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:12 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:40:12 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:40:13 translating from clipboard or selection +Debug: 05-18 16:40:13 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:40:13 Current state: true false true true +Debug: 05-18 16:40:13 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:40:13 scheme: "gdlookup" +Debug: 05-18 16:40:13 host: "localhost" +Debug: 05-18 16:40:13 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:40:13 some body finished +Debug: 05-18 16:40:13 one not finished. +Debug: 05-18 16:40:13 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:13 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:40:13 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:40:13 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:18 translating from clipboard or selection +Debug: 05-18 16:43:18 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6 && i + 1 < len) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe && i + 2 < len) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e && i + 3 < len) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n } else {\n throw std::runtime_error(\"Invalid UTF-8 encoding detected.\");\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(substring);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file;\n\n try {\n dict_file = find_dic_file().string(); // Default dictionary file path\n } catch (const std::exception& e) {\n std::cerr << \"Error finding dictionary file: \" << e.what() << std::endl;\n return 1;\n }\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n goldendict_mode = true;\n sentence = argv[i + 1];\n i++;\n } else {\n word = argv[i];\n }\n }\n\n if (sentence.empty()) {\n if (word.empty()) {\n std::cerr << \"Error: no word or sentence provided.\" << std::endl;\n return 1;\n }\n sentence = word;\n }\n\n try {\n const auto dict_data = xcdat::Dictionary(dict_file);\n std::vector entries;\n for (const auto& entry : dict_data.get_index().get_entries()) {\n entries.emplace_back(entry.get_word(), entry.get_id());\n }\n std::sort(entries.begin(), entries.end(), [](const Entry& a, const Entry& b) {\n return a.decoded_view.size() > b.decoded_view.size();\n });\n\n std::map> alternatives_map;\n std::vector substrings;\n\n for (const auto& entry : entries) {\n std::string decoded_word = std::string(entry.decoded_view);\n if (sentence.find(decoded_word) != std::string::npos) {\n substrings.push_back(decoded_word);\n auto it = alternatives_map.find(decoded_word);\n if (it == alternatives_map.end()) {\n alternatives_map[decoded_word] = {decoded_word};\n } else {\n it->second.insert(decoded_word);\n }\n }\n }\n\n if (debug_mode) {\n std::string raw_output;\n for (const auto& entry : entries) {\n raw_output += std::string(entry.decoded_view) + \"\\n\";\n }\n print_debug_info(substrings, raw_output);\n }\n\n wrap_html_output(substrings, alternatives_map, sentence);\n\n } catch (const std::exception& e) {\n std::cerr << \"Error: \" << e.what() << std::endl;\n return 1;\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:18 Current state: true false true true +Debug: 05-18 16:43:18 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6 %26%26 i + 1 %3C len) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe %26%26 i + 2 %3C len) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e %26%26 i + 3 %3C len) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D else %7B throw std::runtime_error(%22Invalid UTF-8 encoding detected.%22); %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(substring); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file; try %7B dict_file %3D find_dic_file().string(); // Default dictionary file path %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C %22Error finding dictionary file: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B goldendict_mode %3D true; sentence %3D argv[i + 1]; i++; %7D else %7B word %3D argv[i]; %7D %7D if (sentence.empty()) %7B if (word.empty()) %7B std::cerr %3C%3C %22Error: no word or sentence provided.%22 %3C%3C std::endl; return 1; %7D sentence %3D word; %7D try %7B const auto dict_data %3D xcdat::Dictionary(dict_file); std::vector%3CEntry%3E entries; for (const auto%26 entry : dict_data.get_index().get_entries()) %7B entries.emplace_back(entry.get_word(), entry.get_id()); %7D std::sort(entries.begin(), entries.end(), [](const Entry%26 a, const Entry%26 b) %7B return a.decoded_view.size() %3E b.decoded_view.size(); %7D); std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; std::vector%3Cstd::string%3E substrings; for (const auto%26 entry : entries) %7B std::string decoded_word %3D std::string(entry.decoded_view); if (sentence.find(decoded_word) !%3D std::string::npos) %7B substrings.push_back(decoded_word); auto it %3D alternatives_map.find(decoded_word); if (it %3D%3D alternatives_map.end()) %7B alternatives_map[decoded_word] %3D %7Bdecoded_word%7D; %7D else %7B it-%3Esecond.insert(decoded_word); %7D %7D %7D if (debug_mode) %7B std::string raw_output; for (const auto%26 entry : entries) %7B raw_output +%3D std::string(entry.decoded_view) + %22%5Cn%22; %7D print_debug_info(substrings, raw_output); %7D wrap_html_output(substrings, alternatives_map, sentence); %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:18 scheme: "gdlookup" +Debug: 05-18 16:43:18 host: "localhost" +Debug: 05-18 16:43:18 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6 && i + 1 < len) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe && i + 2 < len) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e && i + 3 < len) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } else { throw std::runtime_error(\"Invalid UTF-8 encoding detected.\"); } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(substring); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file; try { dict_file = find_dic_file().string(); // Default dictionary file path } catch (const std::exception& e) { std::cerr << \"Error finding dictionary file: \" << e.what() << std::endl; return 1; } // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { goldendict_mode = true; sentence = argv[i + 1]; i++; } else { word = argv[i]; } } if (sentence.empty()) { if (word.empty()) { std::cerr << \"Error: no word or sentence provided.\" << std::endl; return 1; } sentence = word; } try { const auto dict_data = xcdat::Dictionary(dict_file); std::vector entries; for (const auto& entry : dict_data.get_index().get_entries()) { entries.emplace_back(entry.get_word(), entry.get_id()); } std::sort(entries.begin(), entries.end(), [](const Entry& a, const Entry& b) { return a.decoded_view.size() > b.decoded_view.size(); }); std::map> alternatives_map; std::vector substrings; for (const auto& entry : entries) { std::string decoded_word = std::string(entry.decoded_view); if (sentence.find(decoded_word) != std::string::npos) { substrings.push_back(decoded_word); auto it = alternatives_map.find(decoded_word); if (it == alternatives_map.end()) { alternatives_map[decoded_word] = {decoded_word}; } else { it->second.insert(decoded_word); } } } if (debug_mode) { std::string raw_output; for (const auto& entry : entries) { raw_output += std::string(entry.decoded_view) + \"\\n\"; } print_debug_info(substrings, raw_output); } wrap_html_output(substrings, alternatives_map, sentence); } catch (const std::exception& e) { std::cerr << \"Error: \" << e.what() << std::endl; return 1; } return 0; }" +Debug: 05-18 16:43:18 some body finished +Debug: 05-18 16:43:18 one not finished. +Debug: 05-18 16:43:18 ====reading 10159 of (10159) bytes . Finished: 0 +Debug: 05-18 16:43:18 ====reading 0 of (10159) bytes . Finished: 0 +Debug: 05-18 16:43:18 ====reading 0 of (10159) bytes . Finished: 0 +Warning: 05-18 16:43:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:43 translating from clipboard or selection +Debug: 05-18 16:43:43 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:43 Current state: true false true true +Debug: 05-18 16:43:43 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:43 scheme: "gdlookup" +Debug: 05-18 16:43:43 host: "localhost" +Debug: 05-18 16:43:43 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:43:43 some body finished +Debug: 05-18 16:43:43 one not finished. +Debug: 05-18 16:43:43 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:43 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:43 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:43:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:50 translating from clipboard or selection +Debug: 05-18 16:43:50 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:50 Current state: true false true true +Debug: 05-18 16:43:50 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:50 scheme: "gdlookup" +Debug: 05-18 16:43:50 host: "localhost" +Debug: 05-18 16:43:50 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:43:50 some body finished +Debug: 05-18 16:43:50 one not finished. +Debug: 05-18 16:43:50 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:50 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:50 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:43:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:52 translating from clipboard or selection +Debug: 05-18 16:43:52 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:52 Current state: true false true true +Debug: 05-18 16:43:52 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:52 scheme: "gdlookup" +Debug: 05-18 16:43:52 host: "localhost" +Debug: 05-18 16:43:52 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:43:52 some body finished +Debug: 05-18 16:43:52 one not finished. +Debug: 05-18 16:43:52 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:52 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:52 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:43:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:52 translating from clipboard or selection +Debug: 05-18 16:43:52 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:52 Current state: true false true true +Debug: 05-18 16:43:52 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:52 scheme: "gdlookup" +Debug: 05-18 16:43:52 host: "localhost" +Debug: 05-18 16:43:52 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:43:52 some body finished +Debug: 05-18 16:43:52 one not finished. +Debug: 05-18 16:43:52 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:52 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:52 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:43:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:53 translating from clipboard or selection +Debug: 05-18 16:43:53 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:53 Current state: true false true true +Debug: 05-18 16:43:53 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:53 scheme: "gdlookup" +Debug: 05-18 16:43:53 host: "localhost" +Debug: 05-18 16:43:53 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:43:53 some body finished +Debug: 05-18 16:43:53 one not finished. +Debug: 05-18 16:43:53 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:53 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:53 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:43:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:54 translating from clipboard or selection +Debug: 05-18 16:43:54 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:54 Current state: true false true true +Debug: 05-18 16:43:54 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:54 scheme: "gdlookup" +Debug: 05-18 16:43:54 host: "localhost" +Debug: 05-18 16:43:54 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:43:54 some body finished +Debug: 05-18 16:43:54 one not finished. +Debug: 05-18 16:43:54 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:54 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:54 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:43:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:43:56 translating from clipboard or selection +Debug: 05-18 16:43:56 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"\";\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n // Process the search string once\n auto process_search_string = [&]() {\n auto itr = trie.make_prefix_iterator(search_string);\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After processing: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n results.clear();\n };\n\n // Initial processing\n process_search_string();\n\n // Further process the search string by removing characters one by one\n while (!search_string.empty()) {\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n search_string = new_search_string;\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n // Process again\n process_search_string();\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:43:56 Current state: true false true true +Debug: 05-18 16:43:56 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca class%3D%22%22 href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; // Process the search string once auto process_search_string %3D [%26]() %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After processing: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); %7D; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) %7B const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); // Process again process_search_string(); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:43:56 scheme: "gdlookup" +Debug: 05-18 16:43:56 host: "localhost" +Debug: 05-18 16:43:56 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"\"; output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; // Process the search string once auto process_search_string = [&]() { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Print debug information if in debug mode if (debug_mode) { std::cout << \"After processing: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); }; // Initial processing process_search_string(); // Further process the search string by removing characters one by one while (!search_string.empty()) { const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); // Process again process_search_string(); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:43:56 some body finished +Debug: 05-18 16:43:56 one not finished. +Debug: 05-18 16:43:56 ====reading 10681 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:56 ====reading 0 of (10681) bytes . Finished: 0 +Debug: 05-18 16:43:56 ====reading 0 of (10681) bytes . Finished: 0 +Warning: 05-18 16:43:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:21 translating from clipboard or selection +Debug: 05-18 16:44:21 clipboard data: " | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:21 Current state: true true false true +Debug: 05-18 16:44:21 getResource: "gdlookup://localhost/?word=%7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:21 scheme: "gdlookup" +Debug: 05-18 16:44:21 host: "localhost" +Debug: 05-18 16:44:21 clear current dictionaries: "| ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:21 some body finished +Debug: 05-18 16:44:21 one not finished. +Debug: 05-18 16:44:21 ====reading 12252 of (12252) bytes . Finished: 0 +Debug: 05-18 16:44:21 ====reading 0 of (12252) bytes . Finished: 0 +Debug: 05-18 16:44:21 ====reading 0 of (12252) bytes . Finished: 0 +Warning: 05-18 16:44:21 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:23 translating from clipboard or selection +Debug: 05-18 16:44:23 clipboard data: " = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:23 Current state: true false false true +Debug: 05-18 16:44:23 getResource: "gdlookup://localhost/?word=%3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:23 scheme: "gdlookup" +Debug: 05-18 16:44:23 host: "localhost" +Debug: 05-18 16:44:23 clear current dictionaries: "= __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:23 some body finished +Debug: 05-18 16:44:23 one not finished. +Debug: 05-18 16:44:23 ====reading 14655 of (14655) bytes . Finished: 0 +Debug: 05-18 16:44:23 ====reading 0 of (14655) bytes . Finished: 0 +Debug: 05-18 16:44:23 ====reading 0 of (14655) bytes . Finished: 0 +Warning: 05-18 16:44:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:29 translating from clipboard or selection +Debug: 05-18 16:44:29 clipboard data: " from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:29 Current state: true false true true +Debug: 05-18 16:44:29 getResource: "gdlookup://localhost/?word=from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:29 scheme: "gdlookup" +Debug: 05-18 16:44:29 host: "localhost" +Debug: 05-18 16:44:29 clear current dictionaries: "from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:29 some body finished +Debug: 05-18 16:44:29 one not finished. +Debug: 05-18 16:44:29 ====reading 19544 of (19544) bytes . Finished: 0 +Debug: 05-18 16:44:29 ====reading 0 of (19544) bytes . Finished: 0 +Debug: 05-18 16:44:29 ====reading 0 of (19544) bytes . Finished: 0 +Warning: 05-18 16:44:29 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:31 translating from clipboard or selection +Debug: 05-18 16:44:31 clipboard data: " from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:31 Current state: true false true true +Debug: 05-18 16:44:31 getResource: "gdlookup://localhost/?word=from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry%26, Entry%26)’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:31 scheme: "gdlookup" +Debug: 05-18 16:44:31 host: "localhost" +Debug: 05-18 16:44:31 clear current dictionaries: "from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:31 some body finished +Debug: 05-18 16:44:31 one not finished. +Debug: 05-18 16:44:31 ====reading 22393 of (22393) bytes . Finished: 0 +Debug: 05-18 16:44:31 ====reading 0 of (22393) bytes . Finished: 0 +Debug: 05-18 16:44:31 ====reading 0 of (22393) bytes . Finished: 0 +Warning: 05-18 16:44:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:32 translating from clipboard or selection +Debug: 05-18 16:44:32 clipboard data: "/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 262 | *__result = _GLIBCXX_MOVE(*__first);\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:32 Current state: true false true true +Debug: 05-18 16:44:32 getResource: "gdlookup://localhost/?word=/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 262 %7C *__result %3D _GLIBCXX_MOVE(*__first); %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry%26, Entry%26)’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:32 scheme: "gdlookup" +Debug: 05-18 16:44:32 host: "localhost" +Debug: 05-18 16:44:32 clear current dictionaries: "/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 262 | *__result = _GLIBCXX_MOVE(*__first); | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:32 some body finished +Debug: 05-18 16:44:32 one not finished. +Debug: 05-18 16:44:32 ====reading 23390 of (23390) bytes . Finished: 0 +Debug: 05-18 16:44:32 ====reading 0 of (23390) bytes . Finished: 0 +Debug: 05-18 16:44:32 ====reading 0 of (23390) bytes . Finished: 0 +Warning: 05-18 16:44:32 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:35 translating from clipboard or selection +Debug: 05-18 16:44:35 clipboard data: "andomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 1831 | *__first = _GLIBCXX_MOVE(__val);\n | ^\nsrc/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed:\n 15 | struct Entry {\n | ^~~~~\nsrc/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive]\nIn file included from /run/current-system/profile/include/c++/bits/basic_string.h:48,\n from /run/current-system/profile/include/c++/string:55,\n from /run/current-system/profile/include/c++/bits/locale_classes.h:40,\n from /run/current-system/profile/include/c++/bits/ios_base.h:41,\n from /run/current-system/profile/include/c++/ios:42,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’\n 172 | operator=(const basic_string_view&) noexcept = default;\n | ^~~~~~~~\nsrc/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator\n 15 | struct Entry {\n | ^~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 262 | *__result = _GLIBCXX_MOVE(*__first);\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:35 Current state: true false true true +Debug: 05-18 16:44:35 getResource: "gdlookup://localhost/?word=andomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 1831 %7C *__first %3D _GLIBCXX_MOVE(__val); %7C %5E src/main.cc:15:8: note: ‘Entry%26 Entry::operator%3D(Entry%26%26)’ is implicitly deleted because the default definition would be ill-formed: 15 %7C struct Entry %7B %7C %5E~~~~ src/main.cc:15:8: error: passing ‘const string_view’ %7Baka ‘const std::basic_string_view%3Cchar%3E’%7D as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view%3C_CharT, _Traits%3E%26 std::basic_string_view%3C_CharT, _Traits%3E::operator%3D(const std::basic_string_view%3C_CharT, _Traits%3E%26) [with _CharT %3D char; _Traits %3D std::char_traits%3Cchar%3E]’ 172 %7C operator%3D(const basic_string_view%26) noexcept %3D default; %7C %5E~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 %7C struct Entry %7B %7C %5E~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 262 %7C *__result %3D _GLIBCXX_MOVE(*__first); %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry%26, Entry%26)’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:35 scheme: "gdlookup" +Debug: 05-18 16:44:35 host: "localhost" +Debug: 05-18 16:44:35 clear current dictionaries: "andomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 1831 | *__first = _GLIBCXX_MOVE(__val); | ^ src/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed: 15 | struct Entry { | ^~~~~ src/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’ 172 | operator=(const basic_string_view&) noexcept = default; | ^~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 | struct Entry { | ^~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 262 | *__result = _GLIBCXX_MOVE(*__first); | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:35 some body finished +Debug: 05-18 16:44:35 one not finished. +Debug: 05-18 16:44:35 ====reading 27312 of (27312) bytes . Finished: 0 +Debug: 05-18 16:44:35 ====reading 0 of (27312) bytes . Finished: 0 +Debug: 05-18 16:44:35 ====reading 0 of (27312) bytes . Finished: 0 +Warning: 05-18 16:44:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:38 translating from clipboard or selection +Debug: 05-18 16:44:38 clipboard data: "src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’\n 255 | const auto dict_data = xcdat::Dictionary(dict_file);\n | ^~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 1831 | *__first = _GLIBCXX_MOVE(__val);\n | ^\nsrc/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed:\n 15 | struct Entry {\n | ^~~~~\nsrc/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive]\nIn file included from /run/current-system/profile/include/c++/bits/basic_string.h:48,\n from /run/current-system/profile/include/c++/string:55,\n from /run/current-system/profile/include/c++/bits/locale_classes.h:40,\n from /run/current-system/profile/include/c++/bits/ios_base.h:41,\n from /run/current-system/profile/include/c++/ios:42,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’\n 172 | operator=(const basic_string_view&) noexcept = default;\n | ^~~~~~~~\nsrc/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator\n 15 | struct Entry {\n | ^~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 262 | *__result = _GLIBCXX_MOVE(*__first);\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:38 Current state: true false true true +Debug: 05-18 16:44:39 getResource: "gdlookup://localhost/?word=src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 %7C const auto dict_data %3D xcdat::Dictionary(dict_file); %7C %5E~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 1831 %7C *__first %3D _GLIBCXX_MOVE(__val); %7C %5E src/main.cc:15:8: note: ‘Entry%26 Entry::operator%3D(Entry%26%26)’ is implicitly deleted because the default definition would be ill-formed: 15 %7C struct Entry %7B %7C %5E~~~~ src/main.cc:15:8: error: passing ‘const string_view’ %7Baka ‘const std::basic_string_view%3Cchar%3E’%7D as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view%3C_CharT, _Traits%3E%26 std::basic_string_view%3C_CharT, _Traits%3E::operator%3D(const std::basic_string_view%3C_CharT, _Traits%3E%26) [with _CharT %3D char; _Traits %3D std::char_traits%3Cchar%3E]’ 172 %7C operator%3D(const basic_string_view%26) noexcept %3D default; %7C %5E~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 %7C struct Entry %7B %7C %5E~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 262 %7C *__result %3D _GLIBCXX_MOVE(*__first); %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry%26, Entry%26)’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:39 scheme: "gdlookup" +Debug: 05-18 16:44:39 host: "localhost" +Debug: 05-18 16:44:39 clear current dictionaries: "src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 | const auto dict_data = xcdat::Dictionary(dict_file); | ^~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 1831 | *__first = _GLIBCXX_MOVE(__val); | ^ src/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed: 15 | struct Entry { | ^~~~~ src/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’ 172 | operator=(const basic_string_view&) noexcept = default; | ^~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 | struct Entry { | ^~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 262 | *__result = _GLIBCXX_MOVE(*__first); | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:39 some body finished +Debug: 05-18 16:44:39 one not finished. +Debug: 05-18 16:44:39 ====reading 28509 of (28509) bytes . Finished: 0 +Debug: 05-18 16:44:39 ====reading 0 of (28509) bytes . Finished: 0 +Debug: 05-18 16:44:39 ====reading 0 of (28509) bytes . Finished: 0 +Warning: 05-18 16:44:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:41 translating from clipboard or selection +Debug: 05-18 16:44:41 clipboard data: "/tmp/Hakurei $ g++ src/main.cc -o hakurei\nsrc/main.cc: In function ‘int main(int, char**)’:\nsrc/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’\n 255 | const auto dict_data = xcdat::Dictionary(dict_file);\n | ^~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 1831 | *__first = _GLIBCXX_MOVE(__val);\n | ^\nsrc/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed:\n 15 | struct Entry {\n | ^~~~~\nsrc/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive]\nIn file included from /run/current-system/profile/include/c++/bits/basic_string.h:48,\n from /run/current-system/profile/include/c++/string:55,\n from /run/current-system/profile/include/c++/bits/locale_classes.h:40,\n from /run/current-system/profile/include/c++/bits/ios_base.h:41,\n from /run/current-system/profile/include/c++/ios:42,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’\n 172 | operator=(const basic_string_view&) noexcept = default;\n | ^~~~~~~~\nsrc/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator\n 15 | struct Entry {\n | ^~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 262 | *__result = _GLIBCXX_MOVE(*__first);\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:41 Current state: true false true true +Debug: 05-18 16:44:41 getResource: "gdlookup://localhost/?word=/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘int main(int, char**)’: src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 %7C const auto dict_data %3D xcdat::Dictionary(dict_file); %7C %5E~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 1831 %7C *__first %3D _GLIBCXX_MOVE(__val); %7C %5E src/main.cc:15:8: note: ‘Entry%26 Entry::operator%3D(Entry%26%26)’ is implicitly deleted because the default definition would be ill-formed: 15 %7C struct Entry %7B %7C %5E~~~~ src/main.cc:15:8: error: passing ‘const string_view’ %7Baka ‘const std::basic_string_view%3Cchar%3E’%7D as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view%3C_CharT, _Traits%3E%26 std::basic_string_view%3C_CharT, _Traits%3E::operator%3D(const std::basic_string_view%3C_CharT, _Traits%3E%26) [with _CharT %3D char; _Traits %3D std::char_traits%3Cchar%3E]’ 172 %7C operator%3D(const basic_string_view%26) noexcept %3D default; %7C %5E~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 %7C struct Entry %7B %7C %5E~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 262 %7C *__result %3D _GLIBCXX_MOVE(*__first); %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry%26, Entry%26)’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:41 scheme: "gdlookup" +Debug: 05-18 16:44:41 host: "localhost" +Debug: 05-18 16:44:41 clear current dictionaries: "/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘int main(int, char**)’: src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 | const auto dict_data = xcdat::Dictionary(dict_file); | ^~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 1831 | *__first = _GLIBCXX_MOVE(__val); | ^ src/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed: 15 | struct Entry { | ^~~~~ src/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’ 172 | operator=(const basic_string_view&) noexcept = default; | ^~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 | struct Entry { | ^~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 262 | *__result = _GLIBCXX_MOVE(*__first); | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:41 some body finished +Debug: 05-18 16:44:41 one not finished. +Debug: 05-18 16:44:41 ====reading 28605 of (28605) bytes . Finished: 0 +Debug: 05-18 16:44:41 ====reading 0 of (28605) bytes . Finished: 0 +Debug: 05-18 16:44:41 ====reading 0 of (28605) bytes . Finished: 0 +Warning: 05-18 16:44:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:42 translating from clipboard or selection +Debug: 05-18 16:44:42 clipboard data: "/tmp/Hakurei $ g++ src/main.cc -o hakurei\nsrc/main.cc: In function ‘int main(int, char**)’:\nsrc/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’\n 255 | const auto dict_data = xcdat::Dictionary(dict_file);\n | ^~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 1831 | *__first = _GLIBCXX_MOVE(__val);\n | ^\nsrc/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed:\n 15 | struct Entry {\n | ^~~~~\nsrc/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive]\nIn file included from /run/current-system/profile/include/c++/bits/basic_string.h:48,\n from /run/current-system/profile/include/c++/string:55,\n from /run/current-system/profile/include/c++/bits/locale_classes.h:40,\n from /run/current-system/profile/include/c++/bits/ios_base.h:41,\n from /run/current-system/profile/include/c++/ios:42,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’\n 172 | operator=(const basic_string_view&) noexcept = default;\n | ^~~~~~~~\nsrc/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator\n 15 | struct Entry {\n | ^~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 262 | *__result = _GLIBCXX_MOVE(*__first);\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:42 Current state: true false true true +Debug: 05-18 16:44:42 getResource: "gdlookup://localhost/?word=/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘int main(int, char**)’: src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 %7C const auto dict_data %3D xcdat::Dictionary(dict_file); %7C %5E~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 1831 %7C *__first %3D _GLIBCXX_MOVE(__val); %7C %5E src/main.cc:15:8: note: ‘Entry%26 Entry::operator%3D(Entry%26%26)’ is implicitly deleted because the default definition would be ill-formed: 15 %7C struct Entry %7B %7C %5E~~~~ src/main.cc:15:8: error: passing ‘const string_view’ %7Baka ‘const std::basic_string_view%3Cchar%3E’%7D as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view%3C_CharT, _Traits%3E%26 std::basic_string_view%3C_CharT, _Traits%3E::operator%3D(const std::basic_string_view%3C_CharT, _Traits%3E%26) [with _CharT %3D char; _Traits %3D std::char_traits%3Cchar%3E]’ 172 %7C operator%3D(const basic_string_view%26) noexcept %3D default; %7C %5E~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 %7C struct Entry %7B %7C %5E~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 262 %7C *__result %3D _GLIBCXX_MOVE(*__first); %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry%26, Entry%26)’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:42 scheme: "gdlookup" +Debug: 05-18 16:44:42 host: "localhost" +Debug: 05-18 16:44:42 clear current dictionaries: "/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘int main(int, char**)’: src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 | const auto dict_data = xcdat::Dictionary(dict_file); | ^~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 1831 | *__first = _GLIBCXX_MOVE(__val); | ^ src/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed: 15 | struct Entry { | ^~~~~ src/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’ 172 | operator=(const basic_string_view&) noexcept = default; | ^~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 | struct Entry { | ^~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 262 | *__result = _GLIBCXX_MOVE(*__first); | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:42 some body finished +Debug: 05-18 16:44:42 one not finished. +Debug: 05-18 16:44:42 ====reading 28605 of (28605) bytes . Finished: 0 +Debug: 05-18 16:44:42 ====reading 0 of (28605) bytes . Finished: 0 +Debug: 05-18 16:44:42 ====reading 0 of (28605) bytes . Finished: 0 +Warning: 05-18 16:44:42 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:44:42 translating from clipboard or selection +Debug: 05-18 16:44:42 clipboard data: "/tmp/Hakurei $ g++ src/main.cc -o hakurei\nsrc/main.cc: In function ‘int main(int, char**)’:\nsrc/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’\n 255 | const auto dict_data = xcdat::Dictionary(dict_file);\n | ^~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 1831 | *__first = _GLIBCXX_MOVE(__val);\n | ^\nsrc/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed:\n 15 | struct Entry {\n | ^~~~~\nsrc/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive]\nIn file included from /run/current-system/profile/include/c++/bits/basic_string.h:48,\n from /run/current-system/profile/include/c++/string:55,\n from /run/current-system/profile/include/c++/bits/locale_classes.h:40,\n from /run/current-system/profile/include/c++/bits/ios_base.h:41,\n from /run/current-system/profile/include/c++/ios:42,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’\n 172 | operator=(const basic_string_view&) noexcept = default;\n | ^~~~~~~~\nsrc/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator\n 15 | struct Entry {\n | ^~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 262 | *__result = _GLIBCXX_MOVE(*__first);\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’\n 196 | swap(_Tp& __a, _Tp& __b)\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/move.h:57,\n from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’:\n/run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’\n/run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’\n 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;\n | ^~~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43,\n from /run/current-system/profile/include/c++/exception:153,\n from /run/current-system/profile/include/c++/ios:39,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’:\n/run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’\n 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])\n | ^~~~\n/run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’\n 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted)\n 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;\n | ^~~~\n/run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’\n 182 | swap(*__a, *__b);\n | ~~~~^~~~~~~~~~~~\nIn file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61,\n from /run/current-system/profile/include/c++/algorithm:62,\n from src/main.cc:3:\n/run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’:\n/run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));\n | ^\n/run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’\n 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first\n | ^\nIn file included from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’:\n/run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’\n/run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’\nsrc/main.cc:260:18: required from here\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable\n 738 | static_assert( __assignable::type::value, \"type is not assignable\" );\n | ^~~~~\n/run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false\nIn file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71,\n from /run/current-system/profile/include/c++/bits/char_traits.h:39,\n from /run/current-system/profile/include/c++/ios:40,\n from /run/current-system/profile/include/c++/ostream:38,\n from /run/current-system/profile/include/c++/iostream:39,\n from src/main.cc:1:\n/run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope:\n/run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined\n 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)\n | ^~~~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 16:44:42 Current state: true false true true +Debug: 05-18 16:44:42 getResource: "gdlookup://localhost/?word=/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘int main(int, char**)’: src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 %7C const auto dict_data %3D xcdat::Dictionary(dict_file); %7C %5E~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 1831 %7C *__first %3D _GLIBCXX_MOVE(__val); %7C %5E src/main.cc:15:8: note: ‘Entry%26 Entry::operator%3D(Entry%26%26)’ is implicitly deleted because the default definition would be ill-formed: 15 %7C struct Entry %7B %7C %5E~~~~ src/main.cc:15:8: error: passing ‘const string_view’ %7Baka ‘const std::basic_string_view%3Cchar%3E’%7D as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view%3C_CharT, _Traits%3E%26 std::basic_string_view%3C_CharT, _Traits%3E::operator%3D(const std::basic_string_view%3C_CharT, _Traits%3E%26) [with _CharT %3D char; _Traits %3D std::char_traits%3Cchar%3E]’ 172 %7C operator%3D(const basic_string_view%26) noexcept %3D default; %7C %5E~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 %7C struct Entry %7B %7C %5E~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 262 %7C *__result %3D _GLIBCXX_MOVE(*__first); %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry%26, Entry%26)’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26)’ 196 %7C swap(_Tp%26 __a, _Tp%26 __b) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template%3Cbool _Cond, class _Tp%3E using __enable_if_t %3D typename std::enable_if::type [with bool _Cond %3D false; _Tp %3D void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template%3Cclass ... _Cond%3E using _Require %3D std::__enable_if_t%3Cstd::__and_%3C %3Ctemplate-parameter-1-1%3E %3E::value%3E [with _Cond %3D %7Bstd::__not_%3Cstd::__is_tuple_like%3CEntry%3E %3E, std::is_move_constructible%3CEntry%3E, std::is_move_assignable%3CEntry%3E%7D]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template%3Cclass _Tp%3E std::_Require%3Cstd::__not_%3Cstd::__is_tuple_like%3C_Tp%3E %3E, std::is_move_constructible%3C_Tp%3E, std::is_move_assignable%3C_Tp%3E %3E std::swap(_Tp%26, _Tp%26) [with _Tp %3D Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if%3Cfalse, void%3E’ 2211 %7C using __enable_if_t %3D typename enable_if%3C_Cond, _Tp%3E::type; %7C %5E~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _ForwardIterator2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template%3Cclass _Tp, long unsigned int _Nm%3E std::__enable_if_t%3Cstd::__is_swappable%3C_Tp%3E::value%3E std::swap(_Tp (%26)[_Nm], _Tp (%26)[_Nm])’ 220 %7C swap(_Tp (%26__a)[_Nm], _Tp (%26__b)[_Nm]) %7C %5E~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3Cstd::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ 533 %7C swap(pair%3C_T1, _T2%3E%26 __x, pair%3C_T1, _T2%3E%26 __y) %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template%3Cclass _T1, class _T2%3E typename std::enable_if%3C(! std::__and_%3Cstd::__is_swappable%3C_T1%3E, std::__is_swappable%3C_T2%3E %3E::value)%3E::type std::swap(std::pair%3C_T1, _T2%3E%26, std::pair%3C_T1, _T2%3E%26)’ (deleted) 541 %7C swap(pair%3C_T1, _T2%3E%26, pair%3C_T1, _T2%3E%26) %3D delete; %7C %5E~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair%3C_T1, _T2%3E’ 182 %7C swap(*__a, *__b); %7C ~~~~%5E~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Distance %3D long int; _Tp %3D Entry; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare%26) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Size %3D long int; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 234 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first + __secondChild)); %7C %5E /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry%26 Entry::operator%3D(Entry%26%26)’ 240 %7C *(__first + __holeIndex) %3D _GLIBCXX_MOVE(*(__first %7C %5E In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward%3C_IsMove, true, std::random_access_iterator_tag%3E::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp %3D Entry; bool _IsMove %3D true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove %3D true; _BI1 %3D Entry*; _BI2 %3D Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove %3D true; _II %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _OI %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _BI2 %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D __gnu_cxx::__ops::_Iter_comp_iter%3Cmain(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E %3E]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter %3D __gnu_cxx::__normal_iterator%3CEntry*, std::vector%3CEntry%3E %3E; _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 %7C static_assert( __assignable::type::value, %22type is not assignable%22 ); %7C %5E~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant%3Cbool, false%3E::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val%3C_Compare%3E::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter%3C_Compare%3E%26%26) [with _Compare %3D main(int, char**)::%3Clambda(const Entry%26, const Entry%26)%3E]’ used but never defined 187 %7C _Iter_comp_val(_Iter_comp_iter%3C_Compare%3E%26%26 __comp) %7C %5E~~~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:44:42 scheme: "gdlookup" +Debug: 05-18 16:44:42 host: "localhost" +Debug: 05-18 16:44:42 clear current dictionaries: "/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘int main(int, char**)’: src/main.cc:255:39: error: ‘Dictionary’ is not a member of ‘xcdat’ 255 | const auto dict_data = xcdat::Dictionary(dict_file); | ^~~~~~~~~~ In file included from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algo.h:1831:24: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 1831 | *__first = _GLIBCXX_MOVE(__val); | ^ src/main.cc:15:8: note: ‘Entry& Entry::operator=(Entry&&)’ is implicitly deleted because the default definition would be ill-formed: 15 | struct Entry { | ^~~~~ src/main.cc:15:8: error: passing ‘const string_view’ {aka ‘const std::basic_string_view’} as ‘this’ argument discards qualifiers [-fpermissive] In file included from /run/current-system/profile/include/c++/bits/basic_string.h:48, from /run/current-system/profile/include/c++/string:55, from /run/current-system/profile/include/c++/bits/locale_classes.h:40, from /run/current-system/profile/include/c++/bits/ios_base.h:41, from /run/current-system/profile/include/c++/ios:42, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/string_view:172:7: note: in call to ‘constexpr std::basic_string_view<_CharT, _Traits>& std::basic_string_view<_CharT, _Traits>::operator=(const std::basic_string_view<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’ 172 | operator=(const basic_string_view&) noexcept = default; | ^~~~~~~~ src/main.cc:15:8: error: non-static const member ‘const uint64_t Entry::id’, cannot use default assignment operator 15 | struct Entry { | ^~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:1649:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:262:17: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 262 | *__result = _GLIBCXX_MOVE(*__first); | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: error: no matching function for call to ‘swap(Entry&, Entry&)’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/move.h:196:5: note: candidate: ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)’ 196 | swap(_Tp& __a, _Tp& __b) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:196:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/move.h:57, from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/type_traits: In substitution of ‘template using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]’: /run/current-system/profile/include/c++/type_traits:2215:11: required by substitution of ‘template using _Require = std::__enable_if_t >::value> [with _Cond = {std::__not_ >, std::is_move_constructible, std::is_move_assignable}]’ /run/current-system/profile/include/c++/bits/move.h:196:5: required by substitution of ‘template std::_Require >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Entry]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: required from ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/exception_ptr.h:43, from /run/current-system/profile/include/c++/exception:153, from /run/current-system/profile/include/c++/ios:39, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator >; _ForwardIterator2 = __gnu_cxx::__normal_iterator >]’: /run/current-system/profile/include/c++/bits/stl_algo.h:85:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1904:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1938:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/move.h:220:5: note: candidate: ‘template std::__enable_if_t::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’ 220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) | ^~~~ /run/current-system/profile/include/c++/bits/move.h:220:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: mismatched types ‘_Tp [_Nm]’ and ‘Entry’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: candidate: ‘template typename std::enable_if, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ 533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:64, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: candidate: ‘template typename std::enable_if<(! std::__and_, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ (deleted) 541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; | ^~~~ /run/current-system/profile/include/c++/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed: In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h:182:11: note: ‘Entry’ is not derived from ‘std::pair<_T1, _T2>’ 182 | swap(*__a, *__b); | ~~~~^~~~~~~~~~~~ In file included from /run/current-system/profile/include/c++/bits/stl_algo.h:61, from /run/current-system/profile/include/c++/algorithm:62, from src/main.cc:3: /run/current-system/profile/include/c++/bits/stl_heap.h: In instantiation of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Distance = long int; _Tp = Entry; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’: /run/current-system/profile/include/c++/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_heap.h:234:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 234 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); | ^ /run/current-system/profile/include/c++/bits/stl_heap.h:240:36: error: use of deleted function ‘Entry& Entry::operator=(Entry&&)’ 240 | *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first | ^ In file included from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/stl_algobase.h: In instantiation of ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = Entry; bool _IsMove = true]’: /run/current-system/profile/include/c++/bits/stl_algobase.h:760:37: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:769:51: required from ‘_BI2 std::__copy_move_backward_a1(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = Entry*; _BI2 = Entry*]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:800:5: required from ‘_OI std::__copy_move_backward_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator >; _OI = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algobase.h:894:47: required from ‘_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator >; _BI2 = __gnu_cxx::__normal_iterator >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1830:8: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’ /run/current-system/profile/include/c++/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = main(int, char**)::]’ src/main.cc:260:18: required from here /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: error: static assertion failed: type is not assignable 738 | static_assert( __assignable::type::value, \"type is not assignable\" ); | ^~~~~ /run/current-system/profile/include/c++/bits/stl_algobase.h:738:46: note: ‘std::integral_constant::value’ evaluates to false In file included from /run/current-system/profile/include/c++/bits/stl_algobase.h:71, from /run/current-system/profile/include/c++/bits/char_traits.h:39, from /run/current-system/profile/include/c++/ios:40, from /run/current-system/profile/include/c++/ostream:38, from /run/current-system/profile/include/c++/iostream:39, from src/main.cc:1: /run/current-system/profile/include/c++/bits/predefined_ops.h: At global scope: /run/current-system/profile/include/c++/bits/predefined_ops.h:187:7: warning: ‘__gnu_cxx::__ops::_Iter_comp_val<_Compare>::_Iter_comp_val(__gnu_cxx::__ops::_Iter_comp_iter<_Compare>&&) [with _Compare = main(int, char**)::]’ used but never defined 187 | _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp) | ^~~~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 16:44:42 some body finished +Debug: 05-18 16:44:42 one not finished. +Debug: 05-18 16:44:42 ====reading 28605 of (28605) bytes . Finished: 0 +Debug: 05-18 16:44:42 ====reading 0 of (28605) bytes . Finished: 0 +Debug: 05-18 16:44:42 ====reading 0 of (28605) bytes . Finished: 0 +Warning: 05-18 16:44:42 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:46:07 translating from clipboard or selection +Debug: 05-18 16:46:07 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:46:07 Current state: true false true true +Debug: 05-18 16:46:07 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:46:07 scheme: "gdlookup" +Debug: 05-18 16:46:07 host: "localhost" +Debug: 05-18 16:46:07 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:46:07 some body finished +Debug: 05-18 16:46:07 one not finished. +Debug: 05-18 16:46:07 ====reading 10997 of (10997) bytes . Finished: 0 +Debug: 05-18 16:46:07 ====reading 0 of (10997) bytes . Finished: 0 +Debug: 05-18 16:46:07 ====reading 0 of (10997) bytes . Finished: 0 +Warning: 05-18 16:46:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:46:07 translating from clipboard or selection +Debug: 05-18 16:46:07 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:46:07 Current state: true false true true +Debug: 05-18 16:46:08 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:46:08 scheme: "gdlookup" +Debug: 05-18 16:46:08 host: "localhost" +Debug: 05-18 16:46:08 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:46:08 some body finished +Debug: 05-18 16:46:08 one not finished. +Debug: 05-18 16:46:08 ====reading 10997 of (10997) bytes . Finished: 0 +Debug: 05-18 16:46:08 ====reading 0 of (10997) bytes . Finished: 0 +Debug: 05-18 16:46:08 ====reading 0 of (10997) bytes . Finished: 0 +Warning: 05-18 16:46:08 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:46:11 translating from clipboard or selection +Debug: 05-18 16:46:11 clipboard data: "handling" +Debug: 05-18 16:46:11 Current state: true false true true +Debug: 05-18 16:46:11 getResource: "gdlookup://localhost/?word=handling&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:46:11 scheme: "gdlookup" +Debug: 05-18 16:46:11 host: "localhost" +Debug: 05-18 16:46:11 clear current dictionaries: "handling" +Debug: 05-18 16:46:11 some body finished +Debug: 05-18 16:46:11 one not finished. +Debug: 05-18 16:46:11 ====reading 1411 of (1411) bytes . Finished: 0 +Debug: 05-18 16:46:11 ====reading 0 of (1411) bytes . Finished: 0 +Debug: 05-18 16:46:11 ====reading 0 of (1411) bytes . Finished: 0 +Warning: 05-18 16:46:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:57:33 translating from clipboard or selection +Debug: 05-18 16:57:33 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:57:33 Current state: true false true true +Debug: 05-18 16:57:33 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:57:33 scheme: "gdlookup" +Debug: 05-18 16:57:33 host: "localhost" +Debug: 05-18 16:57:33 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:57:33 some body finished +Debug: 05-18 16:57:33 one not finished. +Debug: 05-18 16:57:33 ====reading 11374 of (11374) bytes . Finished: 0 +Debug: 05-18 16:57:33 ====reading 0 of (11374) bytes . Finished: 0 +Debug: 05-18 16:57:33 ====reading 0 of (11374) bytes . Finished: 0 +Warning: 05-18 16:57:34 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:57:37 translating from clipboard or selection +Debug: 05-18 16:57:37 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6 && i + 1 < len) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe && i + 2 < len) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e && i + 3 < len) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n } else {\n throw std::runtime_error(\"Invalid UTF-8 encoding detected.\");\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(substring);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file;\n\n try {\n dict_file = find_dic_file().string(); // Default dictionary file path\n } catch (const std::exception& e) {\n std::cerr << \"Error finding dictionary file: \" << e.what() << std::endl;\n return 1;\n }\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n goldendict_mode = true;\n sentence = argv[i + 1];\n i++;\n } else {\n word = argv[i];\n }\n }\n\n if (sentence.empty()) {\n if (word.empty()) {\n std::cerr << \"Error: no word or sentence provided.\" << std::endl;\n return 1;\n }\n sentence = word;\n }\n\n try {\n const auto dict_data = xcdat::Dictionary(dict_file);\n std::vector entries;\n for (const auto& entry : dict_data.get_index().get_entries()) {\n entries.emplace_back(entry.get_word(), entry.get_id());\n }\n std::sort(entries.begin(), entries.end(), [](const Entry& a, const Entry& b) {\n return a.decoded_view.size() > b.decoded_view.size();\n });\n\n std::map> alternatives_map;\n std::vector substrings;\n\n for (const auto& entry : entries) {\n std::string decoded_word = std::string(entry.decoded_view);\n if (sentence.find(decoded_word) != std::string::npos) {\n substrings.push_back(decoded_word);\n auto it = alternatives_map.find(decoded_word);\n if (it == alternatives_map.end()) {\n alternatives_map[decoded_word] = {decoded_word};\n } else {\n it->second.insert(decoded_word);\n }\n }\n }\n\n if (debug_mode) {\n std::string raw_output;\n for (const auto& entry : entries) {\n raw_output += std::string(entry.decoded_view) + \"\\n\";\n }\n print_debug_info(substrings, raw_output);\n }\n\n wrap_html_output(substrings, alternatives_map, sentence);\n\n } catch (const std::exception& e) {\n std::cerr << \"Error: \" << e.what() << std::endl;\n return 1;\n }\n\n return 0;\n}\n" +Debug: 05-18 16:57:37 Current state: true false true true +Debug: 05-18 16:57:38 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6 %26%26 i + 1 %3C len) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe %26%26 i + 2 %3C len) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e %26%26 i + 3 %3C len) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D else %7B throw std::runtime_error(%22Invalid UTF-8 encoding detected.%22); %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(substring); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file; try %7B dict_file %3D find_dic_file().string(); // Default dictionary file path %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C %22Error finding dictionary file: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B goldendict_mode %3D true; sentence %3D argv[i + 1]; i++; %7D else %7B word %3D argv[i]; %7D %7D if (sentence.empty()) %7B if (word.empty()) %7B std::cerr %3C%3C %22Error: no word or sentence provided.%22 %3C%3C std::endl; return 1; %7D sentence %3D word; %7D try %7B const auto dict_data %3D xcdat::Dictionary(dict_file); std::vector%3CEntry%3E entries; for (const auto%26 entry : dict_data.get_index().get_entries()) %7B entries.emplace_back(entry.get_word(), entry.get_id()); %7D std::sort(entries.begin(), entries.end(), [](const Entry%26 a, const Entry%26 b) %7B return a.decoded_view.size() %3E b.decoded_view.size(); %7D); std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; std::vector%3Cstd::string%3E substrings; for (const auto%26 entry : entries) %7B std::string decoded_word %3D std::string(entry.decoded_view); if (sentence.find(decoded_word) !%3D std::string::npos) %7B substrings.push_back(decoded_word); auto it %3D alternatives_map.find(decoded_word); if (it %3D%3D alternatives_map.end()) %7B alternatives_map[decoded_word] %3D %7Bdecoded_word%7D; %7D else %7B it-%3Esecond.insert(decoded_word); %7D %7D %7D if (debug_mode) %7B std::string raw_output; for (const auto%26 entry : entries) %7B raw_output +%3D std::string(entry.decoded_view) + %22%5Cn%22; %7D print_debug_info(substrings, raw_output); %7D wrap_html_output(substrings, alternatives_map, sentence); %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:57:38 scheme: "gdlookup" +Debug: 05-18 16:57:38 host: "localhost" +Debug: 05-18 16:57:38 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6 && i + 1 < len) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe && i + 2 < len) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e && i + 3 < len) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } else { throw std::runtime_error(\"Invalid UTF-8 encoding detected.\"); } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(substring); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file; try { dict_file = find_dic_file().string(); // Default dictionary file path } catch (const std::exception& e) { std::cerr << \"Error finding dictionary file: \" << e.what() << std::endl; return 1; } // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { goldendict_mode = true; sentence = argv[i + 1]; i++; } else { word = argv[i]; } } if (sentence.empty()) { if (word.empty()) { std::cerr << \"Error: no word or sentence provided.\" << std::endl; return 1; } sentence = word; } try { const auto dict_data = xcdat::Dictionary(dict_file); std::vector entries; for (const auto& entry : dict_data.get_index().get_entries()) { entries.emplace_back(entry.get_word(), entry.get_id()); } std::sort(entries.begin(), entries.end(), [](const Entry& a, const Entry& b) { return a.decoded_view.size() > b.decoded_view.size(); }); std::map> alternatives_map; std::vector substrings; for (const auto& entry : entries) { std::string decoded_word = std::string(entry.decoded_view); if (sentence.find(decoded_word) != std::string::npos) { substrings.push_back(decoded_word); auto it = alternatives_map.find(decoded_word); if (it == alternatives_map.end()) { alternatives_map[decoded_word] = {decoded_word}; } else { it->second.insert(decoded_word); } } } if (debug_mode) { std::string raw_output; for (const auto& entry : entries) { raw_output += std::string(entry.decoded_view) + \"\\n\"; } print_debug_info(substrings, raw_output); } wrap_html_output(substrings, alternatives_map, sentence); } catch (const std::exception& e) { std::cerr << \"Error: \" << e.what() << std::endl; return 1; } return 0; }" +Debug: 05-18 16:57:38 some body finished +Debug: 05-18 16:57:38 one not finished. +Debug: 05-18 16:57:38 ====reading 10159 of (10159) bytes . Finished: 0 +Debug: 05-18 16:57:38 ====reading 0 of (10159) bytes . Finished: 0 +Debug: 05-18 16:57:38 ====reading 0 of (10159) bytes . Finished: 0 +Warning: 05-18 16:57:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:57:38 translating from clipboard or selection +Debug: 05-18 16:57:38 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6 && i + 1 < len) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe && i + 2 < len) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e && i + 3 < len) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n } else {\n throw std::runtime_error(\"Invalid UTF-8 encoding detected.\");\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n std::string css = R\"(\n\n)\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(substring);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += css;\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file;\n\n try {\n dict_file = find_dic_file().string(); // Default dictionary file path\n } catch (const std::exception& e) {\n std::cerr << \"Error finding dictionary file: \" << e.what() << std::endl;\n return 1;\n }\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n goldendict_mode = true;\n sentence = argv[i + 1];\n i++;\n } else {\n word = argv[i];\n }\n }\n\n if (sentence.empty()) {\n if (word.empty()) {\n std::cerr << \"Error: no word or sentence provided.\" << std::endl;\n return 1;\n }\n sentence = word;\n }\n\n try {\n const auto dict_data = xcdat::Dictionary(dict_file);\n std::vector entries;\n for (const auto& entry : dict_data.get_index().get_entries()) {\n entries.emplace_back(entry.get_word(), entry.get_id());\n }\n std::sort(entries.begin(), entries.end(), [](const Entry& a, const Entry& b) {\n return a.decoded_view.size() > b.decoded_view.size();\n });\n\n std::map> alternatives_map;\n std::vector substrings;\n\n for (const auto& entry : entries) {\n std::string decoded_word = std::string(entry.decoded_view);\n if (sentence.find(decoded_word) != std::string::npos) {\n substrings.push_back(decoded_word);\n auto it = alternatives_map.find(decoded_word);\n if (it == alternatives_map.end()) {\n alternatives_map[decoded_word] = {decoded_word};\n } else {\n it->second.insert(decoded_word);\n }\n }\n }\n\n if (debug_mode) {\n std::string raw_output;\n for (const auto& entry : entries) {\n raw_output += std::string(entry.decoded_view) + \"\\n\";\n }\n print_debug_info(substrings, raw_output);\n }\n\n wrap_html_output(substrings, alternatives_map, sentence);\n\n } catch (const std::exception& e) {\n std::cerr << \"Error: \" << e.what() << std::endl;\n return 1;\n }\n\n return 0;\n}\n" +Debug: 05-18 16:57:38 Current state: true false true true +Debug: 05-18 16:57:38 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6 %26%26 i + 1 %3C len) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe %26%26 i + 2 %3C len) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e %26%26 i + 3 %3C len) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D else %7B throw std::runtime_error(%22Invalid UTF-8 encoding detected.%22); %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; std::string css %3D R%22( %3Cstyle%3E .hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D .hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D .hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D .hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D .hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D .hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D .hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D .container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D .segment %7B display: inline-block; %7D %3C/style%3E )%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(substring); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D css; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file; try %7B dict_file %3D find_dic_file().string(); // Default dictionary file path %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C %22Error finding dictionary file: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B goldendict_mode %3D true; sentence %3D argv[i + 1]; i++; %7D else %7B word %3D argv[i]; %7D %7D if (sentence.empty()) %7B if (word.empty()) %7B std::cerr %3C%3C %22Error: no word or sentence provided.%22 %3C%3C std::endl; return 1; %7D sentence %3D word; %7D try %7B const auto dict_data %3D xcdat::Dictionary(dict_file); std::vector%3CEntry%3E entries; for (const auto%26 entry : dict_data.get_index().get_entries()) %7B entries.emplace_back(entry.get_word(), entry.get_id()); %7D std::sort(entries.begin(), entries.end(), [](const Entry%26 a, const Entry%26 b) %7B return a.decoded_view.size() %3E b.decoded_view.size(); %7D); std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; std::vector%3Cstd::string%3E substrings; for (const auto%26 entry : entries) %7B std::string decoded_word %3D std::string(entry.decoded_view); if (sentence.find(decoded_word) !%3D std::string::npos) %7B substrings.push_back(decoded_word); auto it %3D alternatives_map.find(decoded_word); if (it %3D%3D alternatives_map.end()) %7B alternatives_map[decoded_word] %3D %7Bdecoded_word%7D; %7D else %7B it-%3Esecond.insert(decoded_word); %7D %7D %7D if (debug_mode) %7B std::string raw_output; for (const auto%26 entry : entries) %7B raw_output +%3D std::string(entry.decoded_view) + %22%5Cn%22; %7D print_debug_info(substrings, raw_output); %7D wrap_html_output(substrings, alternatives_map, sentence); %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:57:38 scheme: "gdlookup" +Debug: 05-18 16:57:38 host: "localhost" +Debug: 05-18 16:57:38 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6 && i + 1 < len) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe && i + 2 < len) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e && i + 3 < len) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } else { throw std::runtime_error(\"Invalid UTF-8 encoding detected.\"); } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; std::string css = R\"( )\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(substring); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += css; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file; try { dict_file = find_dic_file().string(); // Default dictionary file path } catch (const std::exception& e) { std::cerr << \"Error finding dictionary file: \" << e.what() << std::endl; return 1; } // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { goldendict_mode = true; sentence = argv[i + 1]; i++; } else { word = argv[i]; } } if (sentence.empty()) { if (word.empty()) { std::cerr << \"Error: no word or sentence provided.\" << std::endl; return 1; } sentence = word; } try { const auto dict_data = xcdat::Dictionary(dict_file); std::vector entries; for (const auto& entry : dict_data.get_index().get_entries()) { entries.emplace_back(entry.get_word(), entry.get_id()); } std::sort(entries.begin(), entries.end(), [](const Entry& a, const Entry& b) { return a.decoded_view.size() > b.decoded_view.size(); }); std::map> alternatives_map; std::vector substrings; for (const auto& entry : entries) { std::string decoded_word = std::string(entry.decoded_view); if (sentence.find(decoded_word) != std::string::npos) { substrings.push_back(decoded_word); auto it = alternatives_map.find(decoded_word); if (it == alternatives_map.end()) { alternatives_map[decoded_word] = {decoded_word}; } else { it->second.insert(decoded_word); } } } if (debug_mode) { std::string raw_output; for (const auto& entry : entries) { raw_output += std::string(entry.decoded_view) + \"\\n\"; } print_debug_info(substrings, raw_output); } wrap_html_output(substrings, alternatives_map, sentence); } catch (const std::exception& e) { std::cerr << \"Error: \" << e.what() << std::endl; return 1; } return 0; }" +Debug: 05-18 16:57:38 some body finished +Debug: 05-18 16:57:38 one not finished. +Debug: 05-18 16:57:38 ====reading 10159 of (10159) bytes . Finished: 0 +Debug: 05-18 16:57:38 ====reading 0 of (10159) bytes . Finished: 0 +Debug: 05-18 16:57:38 ====reading 0 of (10159) bytes . Finished: 0 +Warning: 05-18 16:57:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:57:48 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:57:48 scheme: "gdlookup" +Debug: 05-18 16:57:48 host: "localhost" +Debug: 05-18 16:57:48 clear current dictionaries: "違和感" +Debug: 05-18 16:57:48 some body finished +Debug: 05-18 16:57:48 one not finished. +Debug: 05-18 16:57:48 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 16:57:48 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 16:57:48 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 16:57:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:57:58 translating from clipboard or selection +Debug: 05-18 16:57:58 clipboard data: "違和感" +Debug: 05-18 16:57:58 Current state: true false true true +Debug: 05-18 16:57:58 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:57:58 scheme: "gdlookup" +Debug: 05-18 16:57:58 host: "localhost" +Debug: 05-18 16:57:58 clear current dictionaries: "違和感" +Debug: 05-18 16:57:58 some body finished +Debug: 05-18 16:57:58 one not finished. +Debug: 05-18 16:57:58 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 16:57:58 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 16:57:58 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 16:57:58 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:58:31 translating from clipboard or selection +Debug: 05-18 16:58:31 clipboard data: "" +Debug: 05-18 16:58:31 Current state: true true false true +Debug: 05-18 16:58:31 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:58:31 scheme: "gdlookup" +Debug: 05-18 16:58:31 host: "localhost" +Debug: 05-18 16:58:31 clear current dictionaries: "" +Debug: 05-18 16:58:31 some body finished +Debug: 05-18 16:58:31 one not finished. +Debug: 05-18 16:58:31 ====reading 1448 of (1448) bytes . Finished: 0 +Debug: 05-18 16:58:31 ====reading 0 of (1448) bytes . Finished: 0 +Debug: 05-18 16:58:31 ====reading 0 of (1448) bytes . Finished: 0 +Warning: 05-18 16:58:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:58:32 translating from clipboard or selection +Debug: 05-18 16:58:32 clipboard data: "" +Debug: 05-18 16:58:32 Current state: true false false true +Debug: 05-18 16:58:32 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:58:32 scheme: "gdlookup" +Debug: 05-18 16:58:32 host: "localhost" +Debug: 05-18 16:58:32 clear current dictionaries: "" +Debug: 05-18 16:58:32 some body finished +Debug: 05-18 16:58:32 one not finished. +Debug: 05-18 16:58:32 ====reading 1448 of (1448) bytes . Finished: 0 +Debug: 05-18 16:58:32 ====reading 0 of (1448) bytes . Finished: 0 +Debug: 05-18 16:58:32 ====reading 0 of (1448) bytes . Finished: 0 +Warning: 05-18 16:58:32 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:58:33 translating from clipboard or selection +Debug: 05-18 16:58:33 clipboard data: "" +Debug: 05-18 16:58:33 Current state: true false true true +Debug: 05-18 16:58:33 getResource: "gdlookup://localhost/?word=%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:58:33 scheme: "gdlookup" +Debug: 05-18 16:58:33 host: "localhost" +Debug: 05-18 16:58:33 clear current dictionaries: "" +Debug: 05-18 16:58:33 some body finished +Debug: 05-18 16:58:33 one not finished. +Debug: 05-18 16:58:33 ====reading 1448 of (1448) bytes . Finished: 0 +Debug: 05-18 16:58:33 ====reading 0 of (1448) bytes . Finished: 0 +Debug: 05-18 16:58:33 ====reading 0 of (1448) bytes . Finished: 0 +Warning: 05-18 16:58:33 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:58:46 translating from clipboard or selection +Debug: 05-18 16:58:46 clipboard data: "" +Debug: 05-18 16:58:46 Current state: true false true true +Debug: 05-18 16:58:46 getResource: "gdlookup://localhost/?word=%3C/head%3E%3Cbody%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:58:46 scheme: "gdlookup" +Debug: 05-18 16:58:46 host: "localhost" +Debug: 05-18 16:58:46 clear current dictionaries: "" +Debug: 05-18 16:58:46 some body finished +Debug: 05-18 16:58:46 one not finished. +Debug: 05-18 16:58:46 ====reading 1428 of (1428) bytes . Finished: 0 +Debug: 05-18 16:58:46 ====reading 0 of (1428) bytes . Finished: 0 +Debug: 05-18 16:58:46 ====reading 0 of (1428) bytes . Finished: 0 +Warning: 05-18 16:58:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:58:47 translating from clipboard or selection +Debug: 05-18 16:58:47 clipboard data: "" +Debug: 05-18 16:58:47 Current state: true false true true +Debug: 05-18 16:58:47 getResource: "gdlookup://localhost/?word=%3C/head%3E%3Cbody%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:58:47 scheme: "gdlookup" +Debug: 05-18 16:58:47 host: "localhost" +Debug: 05-18 16:58:47 clear current dictionaries: "" +Debug: 05-18 16:58:47 some body finished +Debug: 05-18 16:58:47 one not finished. +Debug: 05-18 16:58:47 ====reading 1428 of (1428) bytes . Finished: 0 +Debug: 05-18 16:58:47 ====reading 0 of (1428) bytes . Finished: 0 +Debug: 05-18 16:58:47 ====reading 0 of (1428) bytes . Finished: 0 +Warning: 05-18 16:58:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:58:48 translating from clipboard or selection +Debug: 05-18 16:58:48 clipboard data: "" +Debug: 05-18 16:58:48 Current state: true false true true +Debug: 05-18 16:58:48 getResource: "gdlookup://localhost/?word=%3C/head%3E%3Cbody%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:58:48 scheme: "gdlookup" +Debug: 05-18 16:58:48 host: "localhost" +Debug: 05-18 16:58:48 clear current dictionaries: "" +Debug: 05-18 16:58:48 some body finished +Debug: 05-18 16:58:48 one not finished. +Debug: 05-18 16:58:48 ====reading 1428 of (1428) bytes . Finished: 0 +Debug: 05-18 16:58:48 ====reading 0 of (1428) bytes . Finished: 0 +Debug: 05-18 16:58:48 ====reading 0 of (1428) bytes . Finished: 0 +Warning: 05-18 16:58:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:59:09 translating from clipboard or selection +Debug: 05-18 16:59:09 clipboard data: " const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:59:09 Current state: true false true true +Debug: 05-18 16:59:09 getResource: "gdlookup://localhost/?word=const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:59:09 scheme: "gdlookup" +Debug: 05-18 16:59:09 host: "localhost" +Debug: 05-18 16:59:09 clear current dictionaries: "const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \" output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:59:09 some body finished +Debug: 05-18 16:59:09 one not finished. +Debug: 05-18 16:59:09 ====reading 10965 of (10965) bytes . Finished: 0 +Debug: 05-18 16:59:09 ====reading 0 of (10965) bytes . Finished: 0 +Debug: 05-18 16:59:09 ====reading 0 of (10965) bytes . Finished: 0 +Warning: 05-18 16:59:09 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:59:19 translating from clipboard or selection +Debug: 05-18 16:59:19 clipboard data: " output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:59:19 Current state: true false true true +Debug: 05-18 16:59:19 getResource: "gdlookup://localhost/?word=output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:59:19 scheme: "gdlookup" +Debug: 05-18 16:59:19 host: "localhost" +Debug: 05-18 16:59:19 clear current dictionaries: "output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:59:19 some body finished +Debug: 05-18 16:59:19 one not finished. +Debug: 05-18 16:59:19 ====reading 6166 of (6166) bytes . Finished: 0 +Debug: 05-18 16:59:19 ====reading 0 of (6166) bytes . Finished: 0 +Debug: 05-18 16:59:19 ====reading 0 of (6166) bytes . Finished: 0 +Warning: 05-18 16:59:19 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:59:23 translating from clipboard or selection +Debug: 05-18 16:59:23 clipboard data: "" +Debug: 05-18 16:59:25 translating from clipboard or selection +Debug: 05-18 16:59:25 clipboard data: " output_html += \";\n" +Debug: 05-18 16:59:25 Current state: true false true true +Debug: 05-18 16:59:25 getResource: "gdlookup://localhost/?word=output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:59:25 scheme: "gdlookup" +Debug: 05-18 16:59:25 host: "localhost" +Debug: 05-18 16:59:25 clear current dictionaries: "output_html += \";" +Debug: 05-18 16:59:25 some body finished +Debug: 05-18 16:59:25 one not finished. +Debug: 05-18 16:59:25 ====reading 2926 of (2926) bytes . Finished: 0 +Debug: 05-18 16:59:25 ====reading 0 of (2926) bytes . Finished: 0 +Debug: 05-18 16:59:25 ====reading 0 of (2926) bytes . Finished: 0 +Warning: 05-18 16:59:25 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:59:34 translating from clipboard or selection +Debug: 05-18 16:59:34 clipboard data: " output_html += \";\n" +Debug: 05-18 16:59:34 Current state: true false true true +Debug: 05-18 16:59:34 getResource: "gdlookup://localhost/?word=output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:59:34 scheme: "gdlookup" +Debug: 05-18 16:59:34 host: "localhost" +Debug: 05-18 16:59:34 clear current dictionaries: "output_html += \";" +Debug: 05-18 16:59:34 some body finished +Debug: 05-18 16:59:34 one not finished. +Debug: 05-18 16:59:34 ====reading 2926 of (2926) bytes . Finished: 0 +Debug: 05-18 16:59:34 ====reading 0 of (2926) bytes . Finished: 0 +Debug: 05-18 16:59:34 ====reading 0 of (2926) bytes . Finished: 0 +Warning: 05-18 16:59:34 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:59:34 translating from clipboard or selection +Debug: 05-18 16:59:35 clipboard data: " output_html += \";\n" +Debug: 05-18 16:59:35 Current state: true false true true +Debug: 05-18 16:59:35 getResource: "gdlookup://localhost/?word=output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:59:35 scheme: "gdlookup" +Debug: 05-18 16:59:35 host: "localhost" +Debug: 05-18 16:59:35 clear current dictionaries: "output_html += \";" +Debug: 05-18 16:59:35 some body finished +Debug: 05-18 16:59:35 one not finished. +Debug: 05-18 16:59:35 ====reading 2926 of (2926) bytes . Finished: 0 +Debug: 05-18 16:59:35 ====reading 0 of (2926) bytes . Finished: 0 +Debug: 05-18 16:59:35 ====reading 0 of (2926) bytes . Finished: 0 +Warning: 05-18 16:59:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 16:59:45 translating from clipboard or selection +Debug: 05-18 16:59:45 clipboard data: "\t output_html += \";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"\"; // Close container div\n output_html += \"\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 16:59:45 Current state: true false true true +Debug: 05-18 16:59:45 getResource: "gdlookup://localhost/?word=output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%3C/body%3E%3C/html%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 16:59:45 scheme: "gdlookup" +Debug: 05-18 16:59:45 host: "localhost" +Debug: 05-18 16:59:45 clear current dictionaries: "output_html += \"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"\"; // Close container div output_html += \"\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 16:59:45 some body finished +Debug: 05-18 16:59:45 one not finished. +Debug: 05-18 16:59:45 ====reading 6573 of (6573) bytes . Finished: 0 +Debug: 05-18 16:59:45 ====reading 0 of (6573) bytes . Finished: 0 +Debug: 05-18 16:59:45 ====reading 0 of (6573) bytes . Finished: 0 +Warning: 05-18 16:59:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:00:11 translating from clipboard or selection +Debug: 05-18 17:00:11 clipboard data: "class=\"hakurei\">
" +Debug: 05-18 17:00:43 Current state: true false true true +Debug: 05-18 17:00:43 getResource: "gdlookup://localhost/?word=%3C/div%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:00:43 scheme: "gdlookup" +Debug: 05-18 17:00:43 host: "localhost" +Debug: 05-18 17:00:43 clear current dictionaries: "
" +Debug: 05-18 17:00:43 some body finished +Debug: 05-18 17:00:43 one not finished. +Debug: 05-18 17:00:43 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 17:00:43 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 17:00:43 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 17:00:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:00:43 translating from clipboard or selection +Debug: 05-18 17:00:43 clipboard data: "
" +Debug: 05-18 17:00:43 Current state: true false true true +Debug: 05-18 17:00:43 getResource: "gdlookup://localhost/?word=%3C/div%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:00:43 scheme: "gdlookup" +Debug: 05-18 17:00:43 host: "localhost" +Debug: 05-18 17:00:43 clear current dictionaries: "
" +Debug: 05-18 17:00:43 some body finished +Debug: 05-18 17:00:43 one not finished. +Debug: 05-18 17:00:43 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 17:00:43 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 17:00:43 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 17:00:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:00:46 translating from clipboard or selection +Debug: 05-18 17:00:46 clipboard data: "
" +Debug: 05-18 17:00:46 Current state: true false true true +Debug: 05-18 17:00:46 getResource: "gdlookup://localhost/?word=%3Cdiv class%3D%22hakurei%22%3E%3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:違和%22%3E違和%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:違和%22%3E違和%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:違和感%22%3E違和感%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cstyle%3E.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D.segment %7B display: inline-block; %7D%3C/style%3E%3Cdiv class%3D%22segment%22%3E感%3C/div%3E%3C/div%3E%3C/div%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:00:46 scheme: "gdlookup" +Debug: 05-18 17:00:46 host: "localhost" +Debug: 05-18 17:00:46 clear current dictionaries: "
" +Debug: 05-18 17:00:46 some body finished +Debug: 05-18 17:00:46 one not finished. +Debug: 05-18 17:00:46 ====reading 3084 of (3084) bytes . Finished: 0 +Debug: 05-18 17:00:46 ====reading 0 of (3084) bytes . Finished: 0 +Debug: 05-18 17:00:46 ====reading 0 of (3084) bytes . Finished: 0 +Warning: 05-18 17:00:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:00:46 translating from clipboard or selection +Debug: 05-18 17:00:46 clipboard data: "
" +Debug: 05-18 17:00:46 Current state: true false true true +Debug: 05-18 17:00:46 getResource: "gdlookup://localhost/?word=%3Cdiv class%3D%22hakurei%22%3E%3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:違和%22%3E違和%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:違和%22%3E違和%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:違和感%22%3E違和感%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cstyle%3E.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D.segment %7B display: inline-block; %7D%3C/style%3E%3Cdiv class%3D%22segment%22%3E感%3C/div%3E%3C/div%3E%3C/div%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:00:46 scheme: "gdlookup" +Debug: 05-18 17:00:46 host: "localhost" +Debug: 05-18 17:00:46 clear current dictionaries: "
" +Debug: 05-18 17:00:46 some body finished +Debug: 05-18 17:00:46 one not finished. +Debug: 05-18 17:00:46 ====reading 3084 of (3084) bytes . Finished: 0 +Debug: 05-18 17:00:46 ====reading 0 of (3084) bytes . Finished: 0 +Debug: 05-18 17:00:46 ====reading 0 of (3084) bytes . Finished: 0 +Warning: 05-18 17:00:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:00:47 translating from clipboard or selection +Debug: 05-18 17:00:47 clipboard data: "
" +Debug: 05-18 17:00:47 Current state: true false true true +Debug: 05-18 17:00:47 getResource: "gdlookup://localhost/?word=%3Cdiv class%3D%22hakurei%22%3E%3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:違和%22%3E違和%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:違和%22%3E違和%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:違和感%22%3E違和感%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cstyle%3E.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D.segment %7B display: inline-block; %7D%3C/style%3E%3Cdiv class%3D%22segment%22%3E感%3C/div%3E%3C/div%3E%3C/div%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:00:47 scheme: "gdlookup" +Debug: 05-18 17:00:47 host: "localhost" +Debug: 05-18 17:00:47 clear current dictionaries: "
" +Debug: 05-18 17:00:47 some body finished +Debug: 05-18 17:00:47 one not finished. +Debug: 05-18 17:00:47 ====reading 3084 of (3084) bytes . Finished: 0 +Debug: 05-18 17:00:47 ====reading 0 of (3084) bytes . Finished: 0 +Debug: 05-18 17:00:47 ====reading 0 of (3084) bytes . Finished: 0 +Warning: 05-18 17:00:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:01:00 translating from clipboard or selection +Debug: 05-18 17:01:00 clipboard data: "#" +Debug: 05-18 17:01:00 Current state: true false true true +Debug: 05-18 17:01:00 getResource: "gdlookup://localhost/?word=%23&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:01:00 scheme: "gdlookup" +Debug: 05-18 17:01:00 host: "localhost" +Debug: 05-18 17:01:00 clear current dictionaries: "#" +Debug: 05-18 17:01:00 some body finished +Debug: 05-18 17:01:00 one not finished. +Debug: 05-18 17:01:00 ====reading 1404 of (1404) bytes . Finished: 0 +Debug: 05-18 17:01:00 ====reading 0 of (1404) bytes . Finished: 0 +Debug: 05-18 17:01:00 ====reading 0 of (1404) bytes . Finished: 0 +Warning: 05-18 17:01:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:01:02 translating from clipboard or selection +Debug: 05-18 17:01:02 clipboard data: "#" +Debug: 05-18 17:01:02 Current state: true false true true +Debug: 05-18 17:01:02 getResource: "gdlookup://localhost/?word=%23&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:01:02 scheme: "gdlookup" +Debug: 05-18 17:01:02 host: "localhost" +Debug: 05-18 17:01:02 clear current dictionaries: "#" +Debug: 05-18 17:01:02 some body finished +Debug: 05-18 17:01:02 one not finished. +Debug: 05-18 17:01:02 ====reading 1404 of (1404) bytes . Finished: 0 +Debug: 05-18 17:01:02 ====reading 0 of (1404) bytes . Finished: 0 +Debug: 05-18 17:01:02 ====reading 0 of (1404) bytes . Finished: 0 +Warning: 05-18 17:01:02 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:01:21 translating from clipboard or selection +Debug: 05-18 17:01:21 clipboard data: "" +Debug: 05-18 17:01:27 translating from clipboard or selection +Debug: 05-18 17:01:27 clipboard data: "
" +Debug: 05-18 17:01:27 Current state: true false true true +Debug: 05-18 17:01:27 getResource: "gdlookup://localhost/?word=%3Cdiv class%3D%22hakurei%22%3E%3Cdiv class%3D%22container%22%3E%3Cdiv class%3D%22segment%22%3E%3Ca class%3D%22hakurei-headword%22 href%3D%22bword:違和%22%3E違和%3C/a%3E%3Cdiv class%3D%22alternatives%22%3E%3Cul%3E%3Cli%3E%3Ca href%3D%22bword:違和%22%3E違和%3C/a%3E%3C/li%3E%3Cli%3E%3Ca href%3D%22bword:違和感%22%3E違和感%3C/a%3E%3C/li%3E%3C/ul%3E%3C/div%3E%3C/div%3E%3Cstyle%3E.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D.segment %7B display: inline-block; %7D%3C/style%3E%3Cdiv class%3D%22segment%22%3E感%3C/div%3E%3C/div%3E%3C/div%3E&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:01:27 scheme: "gdlookup" +Debug: 05-18 17:01:27 host: "localhost" +Debug: 05-18 17:01:27 clear current dictionaries: "
" +Debug: 05-18 17:01:27 some body finished +Debug: 05-18 17:01:27 one not finished. +Debug: 05-18 17:01:27 ====reading 3084 of (3084) bytes . Finished: 0 +Debug: 05-18 17:01:27 ====reading 0 of (3084) bytes . Finished: 0 +Debug: 05-18 17:01:27 ====reading 0 of (3084) bytes . Finished: 0 +Warning: 05-18 17:01:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:01:31 translating from clipboard or selection +Debug: 05-18 17:01:31 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 17:01:31 Current state: true false true true +Debug: 05-18 17:01:31 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:01:31 scheme: "gdlookup" +Debug: 05-18 17:01:31 host: "localhost" +Debug: 05-18 17:01:31 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 17:01:31 some body finished +Debug: 05-18 17:01:31 one not finished. +Debug: 05-18 17:01:31 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 17:01:31 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 17:01:31 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 17:01:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:01:31 translating from clipboard or selection +Debug: 05-18 17:01:31 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 17:01:31 Current state: true false true true +Debug: 05-18 17:01:31 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:01:31 scheme: "gdlookup" +Debug: 05-18 17:01:31 host: "localhost" +Debug: 05-18 17:01:31 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 17:01:31 some body finished +Debug: 05-18 17:01:31 one not finished. +Debug: 05-18 17:01:31 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 17:01:31 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 17:01:31 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 17:01:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:01:32 translating from clipboard or selection +Debug: 05-18 17:01:32 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 17:01:32 Current state: true false true true +Debug: 05-18 17:01:32 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:01:32 scheme: "gdlookup" +Debug: 05-18 17:01:32 host: "localhost" +Debug: 05-18 17:01:32 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 17:01:32 some body finished +Debug: 05-18 17:01:32 one not finished. +Debug: 05-18 17:01:32 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 17:01:32 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 17:01:32 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 17:01:32 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:02:23 translating from clipboard or selection +Debug: 05-18 17:02:23 clipboard data: " // Adding CSS Styles once to avoid repetition\n output_html += \"\";" +Debug: 05-18 17:02:23 Current state: true false true true +Debug: 05-18 17:02:23 getResource: "gdlookup://localhost/?word=// Adding CSS Styles once to avoid repetition output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:02:23 scheme: "gdlookup" +Debug: 05-18 17:02:23 host: "localhost" +Debug: 05-18 17:02:23 clear current dictionaries: "// Adding CSS Styles once to avoid repetition output_html += \"\";" +Debug: 05-18 17:02:23 some body finished +Debug: 05-18 17:02:23 one not finished. +Debug: 05-18 17:02:23 ====reading 2978 of (2978) bytes . Finished: 0 +Debug: 05-18 17:02:23 ====reading 0 of (2978) bytes . Finished: 0 +Debug: 05-18 17:02:23 ====reading 0 of (2978) bytes . Finished: 0 +Warning: 05-18 17:02:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:02:24 translating from clipboard or selection +Debug: 05-18 17:02:24 clipboard data: " // Adding CSS Styles once to avoid repetition\n output_html += \"\";" +Debug: 05-18 17:02:24 Current state: true false true true +Debug: 05-18 17:02:24 getResource: "gdlookup://localhost/?word=// Adding CSS Styles once to avoid repetition output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:02:24 scheme: "gdlookup" +Debug: 05-18 17:02:24 host: "localhost" +Debug: 05-18 17:02:24 clear current dictionaries: "// Adding CSS Styles once to avoid repetition output_html += \"\";" +Debug: 05-18 17:02:24 some body finished +Debug: 05-18 17:02:24 one not finished. +Debug: 05-18 17:02:24 ====reading 2978 of (2978) bytes . Finished: 0 +Debug: 05-18 17:02:24 ====reading 0 of (2978) bytes . Finished: 0 +Debug: 05-18 17:02:24 ====reading 0 of (2978) bytes . Finished: 0 +Warning: 05-18 17:02:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:03:46 translating from clipboard or selection +Debug: 05-18 17:03:46 clipboard data: " // Load dictionary\n xcdat::Xcdat dict;\n dict.load(dict_file);" +Debug: 05-18 17:03:46 Current state: true false true true +Debug: 05-18 17:03:46 getResource: "gdlookup://localhost/?word=// Load dictionary xcdat::Xcdat dict; dict.load(dict_file);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:03:46 scheme: "gdlookup" +Debug: 05-18 17:03:46 host: "localhost" +Debug: 05-18 17:03:46 clear current dictionaries: "// Load dictionary xcdat::Xcdat dict; dict.load(dict_file);" +Debug: 05-18 17:03:46 some body finished +Debug: 05-18 17:03:46 one not finished. +Debug: 05-18 17:03:46 ====reading 1462 of (1462) bytes . Finished: 0 +Debug: 05-18 17:03:46 ====reading 0 of (1462) bytes . Finished: 0 +Debug: 05-18 17:03:46 ====reading 0 of (1462) bytes . Finished: 0 +Warning: 05-18 17:03:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:04:44 translating from clipboard or selection +Debug: 05-18 17:04:44 clipboard data: "https://youtu.be/nLG5e-6O8ww" +Debug: 05-18 17:04:44 Current state: true false true true +Debug: 05-18 17:04:44 getResource: "gdlookup://localhost/?word=https://youtu.be/nLG5e-6O8ww&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:04:44 scheme: "gdlookup" +Debug: 05-18 17:04:44 host: "localhost" +Debug: 05-18 17:04:44 clear current dictionaries: "https://youtu.be/nLG5e-6O8ww" +Debug: 05-18 17:04:44 some body finished +Debug: 05-18 17:04:44 one not finished. +Debug: 05-18 17:04:44 ====reading 1431 of (1431) bytes . Finished: 0 +Debug: 05-18 17:04:44 ====reading 0 of (1431) bytes . Finished: 0 +Debug: 05-18 17:04:44 ====reading 0 of (1431) bytes . Finished: 0 +Warning: 05-18 17:04:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:04:45 translating from clipboard or selection +Debug: 05-18 17:04:45 clipboard data: "https://youtu.be/nLG5e-6O8ww" +Debug: 05-18 17:04:45 Current state: true false true true +Debug: 05-18 17:04:45 getResource: "gdlookup://localhost/?word=https://youtu.be/nLG5e-6O8ww&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:04:45 scheme: "gdlookup" +Debug: 05-18 17:04:45 host: "localhost" +Debug: 05-18 17:04:45 clear current dictionaries: "https://youtu.be/nLG5e-6O8ww" +Debug: 05-18 17:04:45 some body finished +Debug: 05-18 17:04:45 one not finished. +Debug: 05-18 17:04:45 ====reading 1431 of (1431) bytes . Finished: 0 +Debug: 05-18 17:04:45 ====reading 0 of (1431) bytes . Finished: 0 +Debug: 05-18 17:04:45 ====reading 0 of (1431) bytes . Finished: 0 +Warning: 05-18 17:04:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 17:17:32 translating from clipboard or selection +Debug: 05-18 17:17:32 clipboard data: "@" +Debug: 05-18 17:17:32 Current state: true false true true +Debug: 05-18 17:17:32 getResource: "gdlookup://localhost/?word=@&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 17:17:32 scheme: "gdlookup" +Debug: 05-18 17:17:32 host: "localhost" +Debug: 05-18 17:17:32 clear current dictionaries: "@" +Debug: 05-18 17:17:32 some body finished +Debug: 05-18 17:17:32 one not finished. +Debug: 05-18 17:17:32 ====reading 1404 of (1404) bytes . Finished: 0 +Debug: 05-18 17:17:32 ====reading 0 of (1404) bytes . Finished: 0 +Debug: 05-18 17:17:32 ====reading 0 of (1404) bytes . Finished: 0 +Warning: 05-18 17:17:32 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:31:20 translating from clipboard or selection +Debug: 05-18 18:31:20 clipboard data: "compre" +Debug: 05-18 18:31:20 Current state: true false true true +Debug: 05-18 18:31:20 getResource: "gdlookup://localhost/?word=compre&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:31:20 scheme: "gdlookup" +Debug: 05-18 18:31:20 host: "localhost" +Debug: 05-18 18:31:20 clear current dictionaries: "compre" +Debug: 05-18 18:31:20 some body finished +Debug: 05-18 18:31:20 one not finished. +Debug: 05-18 18:31:20 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 18:31:20 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 18:31:20 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 18:31:20 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:35:06 translating from clipboard or selection +Debug: 05-18 18:35:06 clipboard data: "350x5= " +Debug: 05-18 18:35:06 Current state: true false true true +Debug: 05-18 18:35:06 getResource: "gdlookup://localhost/?word=350x5%3D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:35:06 scheme: "gdlookup" +Debug: 05-18 18:35:06 host: "localhost" +Debug: 05-18 18:35:06 clear current dictionaries: "350x5=" +Debug: 05-18 18:35:06 some body finished +Debug: 05-18 18:35:06 one not finished. +Debug: 05-18 18:35:06 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 18:35:06 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 18:35:06 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 18:35:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:35:12 translating from clipboard or selection +Debug: 05-18 18:35:12 clipboard data: "isso eh td imposto, o ps5 " +Debug: 05-18 18:35:12 Current state: true false true true +Debug: 05-18 18:35:12 getResource: "gdlookup://localhost/?word=isso eh td imposto, o ps5&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:35:12 scheme: "gdlookup" +Debug: 05-18 18:35:12 host: "localhost" +Debug: 05-18 18:35:12 clear current dictionaries: "isso eh td imposto, o ps5" +Debug: 05-18 18:35:12 some body finished +Debug: 05-18 18:35:12 one not finished. +Debug: 05-18 18:35:12 ====reading 1428 of (1428) bytes . Finished: 0 +Debug: 05-18 18:35:12 ====reading 0 of (1428) bytes . Finished: 0 +Debug: 05-18 18:35:12 ====reading 0 of (1428) bytes . Finished: 0 +Warning: 05-18 18:35:12 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:35:54 translating from clipboard or selection +Debug: 05-18 18:35:54 clipboard data: "essa placa de vie" +Debug: 05-18 18:35:54 Current state: true false true true +Debug: 05-18 18:35:54 getResource: "gdlookup://localhost/?word=essa placa de vie&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:35:54 scheme: "gdlookup" +Debug: 05-18 18:35:54 host: "localhost" +Debug: 05-18 18:35:54 clear current dictionaries: "essa placa de vie" +Debug: 05-18 18:35:54 some body finished +Debug: 05-18 18:35:54 one not finished. +Debug: 05-18 18:35:54 ====reading 1420 of (1420) bytes . Finished: 0 +Debug: 05-18 18:35:54 ====reading 0 of (1420) bytes . Finished: 0 +Debug: 05-18 18:35:54 ====reading 0 of (1420) bytes . Finished: 0 +Warning: 05-18 18:35:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:36:45 translating from clipboard or selection +Debug: 05-18 18:36:45 clipboard data: "pior que eu n " +Debug: 05-18 18:36:45 Current state: true false true true +Debug: 05-18 18:36:45 getResource: "gdlookup://localhost/?word=pior que eu n&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:36:45 scheme: "gdlookup" +Debug: 05-18 18:36:45 host: "localhost" +Debug: 05-18 18:36:45 clear current dictionaries: "pior que eu n" +Debug: 05-18 18:36:45 some body finished +Debug: 05-18 18:36:45 one not finished. +Debug: 05-18 18:36:45 ====reading 1416 of (1416) bytes . Finished: 0 +Debug: 05-18 18:36:45 ====reading 0 of (1416) bytes . Finished: 0 +Debug: 05-18 18:36:45 ====reading 0 of (1416) bytes . Finished: 0 +Warning: 05-18 18:36:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:37:30 translating from clipboard or selection +Debug: 05-18 18:37:30 clipboard data: "isso " +Debug: 05-18 18:37:30 Current state: true false true true +Debug: 05-18 18:37:30 getResource: "gdlookup://localhost/?word=isso&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:37:30 scheme: "gdlookup" +Debug: 05-18 18:37:30 host: "localhost" +Debug: 05-18 18:37:31 clear current dictionaries: "isso" +Debug: 05-18 18:37:31 some body finished +Debug: 05-18 18:37:31 one not finished. +Debug: 05-18 18:37:31 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 18:37:31 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 18:37:31 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 18:37:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:38:47 translating from clipboard or selection +Debug: 05-18 18:38:47 clipboard data: "eu nao t" +Debug: 05-18 18:38:47 Current state: true false true true +Debug: 05-18 18:38:47 getResource: "gdlookup://localhost/?word=eu nao t&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:38:47 scheme: "gdlookup" +Debug: 05-18 18:38:47 host: "localhost" +Debug: 05-18 18:38:47 clear current dictionaries: "eu nao t" +Debug: 05-18 18:38:47 some body finished +Debug: 05-18 18:38:47 one not finished. +Debug: 05-18 18:38:47 ====reading 1411 of (1411) bytes . Finished: 0 +Debug: 05-18 18:38:47 ====reading 0 of (1411) bytes . Finished: 0 +Debug: 05-18 18:38:47 ====reading 0 of (1411) bytes . Finished: 0 +Warning: 05-18 18:38:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 18:38:50 translating from clipboard or selection +Debug: 05-18 18:38:50 clipboard data: "usei" +Debug: 05-18 18:38:50 Current state: true false true true +Debug: 05-18 18:38:50 getResource: "gdlookup://localhost/?word=usei&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 18:38:50 scheme: "gdlookup" +Debug: 05-18 18:38:50 host: "localhost" +Debug: 05-18 18:38:50 clear current dictionaries: "usei" +Debug: 05-18 18:38:50 some body finished +Debug: 05-18 18:38:50 one not finished. +Debug: 05-18 18:38:50 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 18:38:50 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 18:38:50 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 18:38:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:31 translating from clipboard or selection +Debug: 05-18 19:09:31 clipboard data: "e ta errado? kk\n" +Debug: 05-18 19:09:31 Current state: true false true true +Debug: 05-18 19:09:31 getResource: "gdlookup://localhost/?word=e ta errado? kk&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:31 scheme: "gdlookup" +Debug: 05-18 19:09:31 host: "localhost" +Debug: 05-18 19:09:31 clear current dictionaries: "e ta errado? kk" +Debug: 05-18 19:09:31 some body finished +Debug: 05-18 19:09:31 one not finished. +Debug: 05-18 19:09:31 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 19:09:31 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 19:09:31 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 19:09:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:33 translating from clipboard or selection +Debug: 05-18 19:09:33 clipboard data: "qualidade" +Debug: 05-18 19:09:33 Current state: true false true true +Debug: 05-18 19:09:33 getResource: "gdlookup://localhost/?word=qualidade&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:33 scheme: "gdlookup" +Debug: 05-18 19:09:33 host: "localhost" +Debug: 05-18 19:09:33 clear current dictionaries: "qualidade" +Debug: 05-18 19:09:33 some body finished +Debug: 05-18 19:09:33 one not finished. +Debug: 05-18 19:09:33 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 19:09:33 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 19:09:33 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 19:09:33 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:33 translating from clipboard or selection +Debug: 05-18 19:09:33 clipboard data: "saude e qualidade de comida tambem, eh foda la\n\n" +Debug: 05-18 19:09:33 Current state: true false true true +Debug: 05-18 19:09:33 getResource: "gdlookup://localhost/?word=saude e qualidade de comida tambem, eh foda la &group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:33 scheme: "gdlookup" +Debug: 05-18 19:09:33 host: "localhost" +Debug: 05-18 19:09:33 clear current dictionaries: "saude e qualidade de comida tambem, eh foda la " +Debug: 05-18 19:09:33 some body finished +Debug: 05-18 19:09:33 one not finished. +Debug: 05-18 19:09:33 ====reading 1453 of (1453) bytes . Finished: 0 +Debug: 05-18 19:09:33 ====reading 0 of (1453) bytes . Finished: 0 +Debug: 05-18 19:09:33 ====reading 0 of (1453) bytes . Finished: 0 +Warning: 05-18 19:09:33 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:35 translating from clipboard or selection +Debug: 05-18 19:09:35 clipboard data: "o tanto de grana que ela ganha slc\n" +Debug: 05-18 19:09:35 Current state: true false true true +Debug: 05-18 19:09:35 getResource: "gdlookup://localhost/?word=o tanto de grana que ela ganha slc&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:35 scheme: "gdlookup" +Debug: 05-18 19:09:35 host: "localhost" +Debug: 05-18 19:09:35 clear current dictionaries: "o tanto de grana que ela ganha slc" +Debug: 05-18 19:09:35 some body finished +Debug: 05-18 19:09:35 one not finished. +Debug: 05-18 19:09:35 ====reading 1437 of (1437) bytes . Finished: 0 +Debug: 05-18 19:09:35 ====reading 0 of (1437) bytes . Finished: 0 +Debug: 05-18 19:09:35 ====reading 0 of (1437) bytes . Finished: 0 +Warning: 05-18 19:09:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:36 translating from clipboard or selection +Debug: 05-18 19:09:36 clipboard data: "conheco uma veia que vai la pra ficar de baba e fazer unha delas (ela cobra uma nota)\n" +Debug: 05-18 19:09:36 Current state: true false true true +Debug: 05-18 19:09:36 getResource: "gdlookup://localhost/?word=conheco uma veia que vai la pra ficar de baba e fazer unha delas (ela cobra uma nota)&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:36 scheme: "gdlookup" +Debug: 05-18 19:09:36 host: "localhost" +Debug: 05-18 19:09:36 clear current dictionaries: "conheco uma veia que vai la pra ficar de baba e fazer unha delas (ela cobra uma nota)" +Debug: 05-18 19:09:36 some body finished +Debug: 05-18 19:09:36 one not finished. +Debug: 05-18 19:09:36 ====reading 1488 of (1488) bytes . Finished: 0 +Debug: 05-18 19:09:36 ====reading 0 of (1488) bytes . Finished: 0 +Debug: 05-18 19:09:36 ====reading 0 of (1488) bytes . Finished: 0 +Warning: 05-18 19:09:36 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:37 translating from clipboard or selection +Debug: 05-18 19:09:37 clipboard data: "lavar privada la ja da grana kkk\n" +Debug: 05-18 19:09:37 Current state: true false true true +Debug: 05-18 19:09:37 getResource: "gdlookup://localhost/?word=lavar privada la ja da grana kkk&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:37 scheme: "gdlookup" +Debug: 05-18 19:09:37 host: "localhost" +Debug: 05-18 19:09:37 clear current dictionaries: "lavar privada la ja da grana kkk" +Debug: 05-18 19:09:37 some body finished +Debug: 05-18 19:09:37 one not finished. +Debug: 05-18 19:09:37 ====reading 1435 of (1435) bytes . Finished: 0 +Debug: 05-18 19:09:37 ====reading 0 of (1435) bytes . Finished: 0 +Debug: 05-18 19:09:37 ====reading 0 of (1435) bytes . Finished: 0 +Warning: 05-18 19:09:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:39 translating from clipboard or selection +Debug: 05-18 19:09:39 clipboard data: "pais" +Debug: 05-18 19:09:39 Current state: true false true true +Debug: 05-18 19:09:39 getResource: "gdlookup://localhost/?word=pais&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:39 scheme: "gdlookup" +Debug: 05-18 19:09:39 host: "localhost" +Debug: 05-18 19:09:39 clear current dictionaries: "pais" +Debug: 05-18 19:09:39 some body finished +Debug: 05-18 19:09:39 one not finished. +Debug: 05-18 19:09:39 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 19:09:39 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 19:09:39 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 19:09:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:40 translating from clipboard or selection +Debug: 05-18 19:09:40 clipboard data: "a real eh que esse pais ja era, a tendencia eh a gente virar uma brazuela da vida\n\n" +Debug: 05-18 19:09:40 Current state: true false true true +Debug: 05-18 19:09:40 getResource: "gdlookup://localhost/?word=a real eh que esse pais ja era, a tendencia eh a gente virar uma brazuela da vida &group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:40 scheme: "gdlookup" +Debug: 05-18 19:09:40 host: "localhost" +Debug: 05-18 19:09:40 clear current dictionaries: "a real eh que esse pais ja era, a tendencia eh a gente virar uma brazuela da vida " +Debug: 05-18 19:09:40 some body finished +Debug: 05-18 19:09:40 one not finished. +Debug: 05-18 19:09:40 ====reading 1488 of (1488) bytes . Finished: 0 +Debug: 05-18 19:09:40 ====reading 0 of (1488) bytes . Finished: 0 +Debug: 05-18 19:09:40 ====reading 0 of (1488) bytes . Finished: 0 +Warning: 05-18 19:09:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:41 translating from clipboard or selection +Debug: 05-18 19:09:41 clipboard data: "sem contar kabum e etc\n" +Debug: 05-18 19:09:41 Current state: true false true true +Debug: 05-18 19:09:41 getResource: "gdlookup://localhost/?word=sem contar kabum e etc&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:41 scheme: "gdlookup" +Debug: 05-18 19:09:41 host: "localhost" +Debug: 05-18 19:09:41 clear current dictionaries: "sem contar kabum e etc" +Debug: 05-18 19:09:41 some body finished +Debug: 05-18 19:09:41 one not finished. +Debug: 05-18 19:09:41 ====reading 1425 of (1425) bytes . Finished: 0 +Debug: 05-18 19:09:41 ====reading 0 of (1425) bytes . Finished: 0 +Debug: 05-18 19:09:41 ====reading 0 of (1425) bytes . Finished: 0 +Warning: 05-18 19:09:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:42 translating from clipboard or selection +Debug: 05-18 19:09:42 clipboard data: "ai tu vai ver o mercado brasileiro: positivo, rise mode e multilaser, cobrando caro por produto merda\n" +Debug: 05-18 19:09:42 Current state: true false true true +Debug: 05-18 19:09:42 getResource: "gdlookup://localhost/?word=ai tu vai ver o mercado brasileiro: positivo, rise mode e multilaser, cobrando caro por produto merda&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:42 scheme: "gdlookup" +Debug: 05-18 19:09:42 host: "localhost" +Debug: 05-18 19:09:42 clear current dictionaries: "ai tu vai ver o mercado brasileiro: positivo, rise mode e multilaser, cobrando caro por produto merda" +Debug: 05-18 19:09:42 some body finished +Debug: 05-18 19:09:42 one not finished. +Debug: 05-18 19:09:42 ====reading 1504 of (1504) bytes . Finished: 0 +Debug: 05-18 19:09:42 ====reading 0 of (1504) bytes . Finished: 0 +Debug: 05-18 19:09:42 ====reading 0 of (1504) bytes . Finished: 0 +Warning: 05-18 19:09:42 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:43 translating from clipboard or selection +Debug: 05-18 19:09:43 clipboard data: "nacionalismo num pais que as empresas brasileiras fazem lobby pra aumentar imposto de importacao pra \"\"\"valorizarem\"\"\" mercado brasileiro\n" +Debug: 05-18 19:09:43 Current state: true false true true +Debug: 05-18 19:09:43 getResource: "gdlookup://localhost/?word=nacionalismo num pais que as empresas brasileiras fazem lobby pra aumentar imposto de importacao pra %22%22%22valorizarem%22%22%22 mercado brasileiro&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:43 scheme: "gdlookup" +Debug: 05-18 19:09:43 host: "localhost" +Debug: 05-18 19:09:43 clear current dictionaries: "nacionalismo num pais que as empresas brasileiras fazem lobby pra aumentar imposto de importacao pra \"\"\"valorizarem\"\"\" mercado brasileiro" +Debug: 05-18 19:09:43 some body finished +Debug: 05-18 19:09:43 one not finished. +Debug: 05-18 19:09:43 ====reading 1570 of (1570) bytes . Finished: 0 +Debug: 05-18 19:09:43 ====reading 0 of (1570) bytes . Finished: 0 +Debug: 05-18 19:09:43 ====reading 0 of (1570) bytes . Finished: 0 +Warning: 05-18 19:09:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:46 translating from clipboard or selection +Debug: 05-18 19:09:46 clipboard data: "eu tenho um lado nacionalista, mas sinceramente tem q se esforçar muito pra gostar de alguma coisa aqui\n\n" +Debug: 05-18 19:09:46 Current state: true false true true +Debug: 05-18 19:09:46 getResource: "gdlookup://localhost/?word=eu tenho um lado nacionalista, mas sinceramente tem q se esforçar muito pra gostar de alguma coisa aqui &group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:46 scheme: "gdlookup" +Debug: 05-18 19:09:46 host: "localhost" +Debug: 05-18 19:09:46 clear current dictionaries: "eu tenho um lado nacionalista, mas sinceramente tem q se esforçar muito pra gostar de alguma coisa aqui " +Debug: 05-18 19:09:46 some body finished +Debug: 05-18 19:09:46 one not finished. +Debug: 05-18 19:09:46 ====reading 1511 of (1511) bytes . Finished: 0 +Debug: 05-18 19:09:46 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 19:09:46 ====reading 0 of (1511) bytes . Finished: 0 +Warning: 05-18 19:09:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:09:47 translating from clipboard or selection +Debug: 05-18 19:09:47 clipboard data: "situação é cada vez mais apocaliptica\n" +Debug: 05-18 19:09:47 Current state: true false true true +Debug: 05-18 19:09:47 getResource: "gdlookup://localhost/?word=situação é cada vez mais apocaliptica&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:09:47 scheme: "gdlookup" +Debug: 05-18 19:09:47 host: "localhost" +Debug: 05-18 19:09:47 clear current dictionaries: "situação é cada vez mais apocaliptica" +Debug: 05-18 19:09:47 some body finished +Debug: 05-18 19:09:47 one not finished. +Debug: 05-18 19:09:47 ====reading 1443 of (1443) bytes . Finished: 0 +Debug: 05-18 19:09:47 ====reading 0 of (1443) bytes . Finished: 0 +Debug: 05-18 19:09:47 ====reading 0 of (1443) bytes . Finished: 0 +Warning: 05-18 19:09:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:11:33 translating from clipboard or selection +Debug: 05-18 19:11:33 clipboard data: "situação é cada vez mais apocaliptica\n" +Debug: 05-18 19:11:33 Current state: true false true true +Debug: 05-18 19:11:33 getResource: "gdlookup://localhost/?word=situação é cada vez mais apocaliptica&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:11:33 scheme: "gdlookup" +Debug: 05-18 19:11:33 host: "localhost" +Debug: 05-18 19:11:33 clear current dictionaries: "situação é cada vez mais apocaliptica" +Debug: 05-18 19:11:33 some body finished +Debug: 05-18 19:11:33 one not finished. +Debug: 05-18 19:11:33 ====reading 1443 of (1443) bytes . Finished: 0 +Debug: 05-18 19:11:33 ====reading 0 of (1443) bytes . Finished: 0 +Debug: 05-18 19:11:33 ====reading 0 of (1443) bytes . Finished: 0 +Warning: 05-18 19:11:33 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:11:34 translating from clipboard or selection +Debug: 05-18 19:11:34 clipboard data: "eu tenho um lado nacionalista, mas sinceramente tem q se esforçar muito pra gostar de alguma coisa aqui\n\n" +Debug: 05-18 19:11:34 Current state: true false true true +Debug: 05-18 19:11:34 getResource: "gdlookup://localhost/?word=eu tenho um lado nacionalista, mas sinceramente tem q se esforçar muito pra gostar de alguma coisa aqui &group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:11:34 scheme: "gdlookup" +Debug: 05-18 19:11:34 host: "localhost" +Debug: 05-18 19:11:34 clear current dictionaries: "eu tenho um lado nacionalista, mas sinceramente tem q se esforçar muito pra gostar de alguma coisa aqui " +Debug: 05-18 19:11:34 some body finished +Debug: 05-18 19:11:34 one not finished. +Debug: 05-18 19:11:34 ====reading 1511 of (1511) bytes . Finished: 0 +Debug: 05-18 19:11:34 ====reading 0 of (1511) bytes . Finished: 0 +Debug: 05-18 19:11:34 ====reading 0 of (1511) bytes . Finished: 0 +Warning: 05-18 19:11:34 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:13:39 translating from clipboard or selection +Debug: 05-18 19:13:39 clipboard data: "usuario de guix" +Debug: 05-18 19:13:39 Current state: true false true true +Debug: 05-18 19:13:39 getResource: "gdlookup://localhost/?word=usuario de guix&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:13:39 scheme: "gdlookup" +Debug: 05-18 19:13:39 host: "localhost" +Debug: 05-18 19:13:39 clear current dictionaries: "usuario de guix" +Debug: 05-18 19:13:39 some body finished +Debug: 05-18 19:13:39 one not finished. +Debug: 05-18 19:13:39 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 19:13:39 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 19:13:39 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 19:13:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:13:39 translating from clipboard or selection +Debug: 05-18 19:13:39 clipboard data: "usuario de guix" +Debug: 05-18 19:13:39 Current state: true false true true +Debug: 05-18 19:13:39 getResource: "gdlookup://localhost/?word=usuario de guix&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:13:39 scheme: "gdlookup" +Debug: 05-18 19:13:39 host: "localhost" +Debug: 05-18 19:13:39 clear current dictionaries: "usuario de guix" +Debug: 05-18 19:13:39 some body finished +Debug: 05-18 19:13:39 one not finished. +Debug: 05-18 19:13:39 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 19:13:39 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 19:13:39 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 19:13:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:13:43 translating from clipboard or selection +Debug: 05-18 19:13:43 clipboard data: "usuario de guix medio" +Debug: 05-18 19:13:43 Current state: true false true true +Debug: 05-18 19:13:43 getResource: "gdlookup://localhost/?word=usuario de guix medio&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:13:43 scheme: "gdlookup" +Debug: 05-18 19:13:43 host: "localhost" +Debug: 05-18 19:13:43 clear current dictionaries: "usuario de guix medio" +Debug: 05-18 19:13:43 some body finished +Debug: 05-18 19:13:43 one not finished. +Debug: 05-18 19:13:43 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 19:13:43 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 19:13:43 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 19:13:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:14:18 translating from clipboard or selection +Debug: 05-18 19:14:18 clipboard data: "pra mim sentou na privada e encostou o pe no chao ja pode nmorar\nK\nK\n" +Debug: 05-18 19:14:18 Current state: true false true true +Debug: 05-18 19:14:18 getResource: "gdlookup://localhost/?word=pra mim sentou na privada e encostou o pe no chao ja pode nmorar K K&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:14:18 scheme: "gdlookup" +Debug: 05-18 19:14:18 host: "localhost" +Debug: 05-18 19:14:18 clear current dictionaries: "pra mim sentou na privada e encostou o pe no chao ja pode nmorar K K" +Debug: 05-18 19:14:18 some body finished +Debug: 05-18 19:14:18 one not finished. +Debug: 05-18 19:14:18 ====reading 1477 of (1477) bytes . Finished: 0 +Debug: 05-18 19:14:18 ====reading 0 of (1477) bytes . Finished: 0 +Debug: 05-18 19:14:18 ====reading 0 of (1477) bytes . Finished: 0 +Warning: 05-18 19:14:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:15:12 translating from clipboard or selection +Debug: 05-18 19:15:12 clipboard data: "naquele video eu tava mt difere" +Debug: 05-18 19:15:12 Current state: true false true true +Debug: 05-18 19:15:12 getResource: "gdlookup://localhost/?word=naquele video eu tava mt difere&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:15:12 scheme: "gdlookup" +Debug: 05-18 19:15:12 host: "localhost" +Debug: 05-18 19:15:12 clear current dictionaries: "naquele video eu tava mt difere" +Debug: 05-18 19:15:12 some body finished +Debug: 05-18 19:15:12 one not finished. +Debug: 05-18 19:15:12 ====reading 1434 of (1434) bytes . Finished: 0 +Debug: 05-18 19:15:12 ====reading 0 of (1434) bytes . Finished: 0 +Debug: 05-18 19:15:12 ====reading 0 of (1434) bytes . Finished: 0 +Warning: 05-18 19:15:12 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:15:16 translating from clipboard or selection +Debug: 05-18 19:15:16 clipboard data: "nera eu nao" +Debug: 05-18 19:15:16 Current state: true false true true +Debug: 05-18 19:15:16 getResource: "gdlookup://localhost/?word=nera eu nao&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:15:16 scheme: "gdlookup" +Debug: 05-18 19:15:16 host: "localhost" +Debug: 05-18 19:15:16 clear current dictionaries: "nera eu nao" +Debug: 05-18 19:15:16 some body finished +Debug: 05-18 19:15:16 one not finished. +Debug: 05-18 19:15:16 ====reading 1414 of (1414) bytes . Finished: 0 +Debug: 05-18 19:15:16 ====reading 0 of (1414) bytes . Finished: 0 +Debug: 05-18 19:15:16 ====reading 0 of (1414) bytes . Finished: 0 +Warning: 05-18 19:15:16 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:15:17 translating from clipboard or selection +Debug: 05-18 19:15:17 clipboard data: "nera eu nao" +Debug: 05-18 19:15:17 Current state: true false true true +Debug: 05-18 19:15:17 getResource: "gdlookup://localhost/?word=nera eu nao&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:15:17 scheme: "gdlookup" +Debug: 05-18 19:15:17 host: "localhost" +Debug: 05-18 19:15:17 clear current dictionaries: "nera eu nao" +Debug: 05-18 19:15:17 some body finished +Debug: 05-18 19:15:17 one not finished. +Debug: 05-18 19:15:17 ====reading 1414 of (1414) bytes . Finished: 0 +Debug: 05-18 19:15:17 ====reading 0 of (1414) bytes . Finished: 0 +Debug: 05-18 19:15:17 ====reading 0 of (1414) bytes . Finished: 0 +Warning: 05-18 19:15:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:15:53 translating from clipboard or selection +Debug: 05-18 19:15:53 clipboard data: "sex" +Debug: 05-18 19:15:53 Current state: true false true true +Debug: 05-18 19:15:53 getResource: "gdlookup://localhost/?word=sex&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:15:53 scheme: "gdlookup" +Debug: 05-18 19:15:53 host: "localhost" +Debug: 05-18 19:15:53 clear current dictionaries: "sex" +Debug: 05-18 19:15:53 some body finished +Debug: 05-18 19:15:53 one not finished. +Debug: 05-18 19:15:53 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 19:15:53 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 19:15:53 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 19:15:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:17:47 translating from clipboard or selection +Debug: 05-18 19:17:47 clipboard data: "eu pareco umta" +Debug: 05-18 19:17:47 Current state: true false true true +Debug: 05-18 19:17:47 getResource: "gdlookup://localhost/?word=eu pareco umta&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:17:47 scheme: "gdlookup" +Debug: 05-18 19:17:47 host: "localhost" +Debug: 05-18 19:17:47 clear current dictionaries: "eu pareco umta" +Debug: 05-18 19:17:47 some body finished +Debug: 05-18 19:17:47 one not finished. +Debug: 05-18 19:17:47 ====reading 1417 of (1417) bytes . Finished: 0 +Debug: 05-18 19:17:47 ====reading 0 of (1417) bytes . Finished: 0 +Debug: 05-18 19:17:47 ====reading 0 of (1417) bytes . Finished: 0 +Warning: 05-18 19:17:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:20:36 translating from clipboard or selection +Debug: 05-18 19:20:36 clipboard data: "https://www.youtube.com/watch?v=zOB5QhWu1VY" +Debug: 05-18 19:20:36 Current state: true false true true +Debug: 05-18 19:20:36 getResource: "gdlookup://localhost/?word=https://www.youtube.com/watch?v%3DzOB5QhWu1VY&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:20:36 scheme: "gdlookup" +Debug: 05-18 19:20:36 host: "localhost" +Debug: 05-18 19:20:36 clear current dictionaries: "https://www.youtube.com/watch?v=zOB5QhWu1VY" +Debug: 05-18 19:20:36 some body finished +Debug: 05-18 19:20:36 one not finished. +Debug: 05-18 19:20:36 ====reading 1446 of (1446) bytes . Finished: 0 +Debug: 05-18 19:20:36 ====reading 0 of (1446) bytes . Finished: 0 +Debug: 05-18 19:20:36 ====reading 0 of (1446) bytes . Finished: 0 +Warning: 05-18 19:20:36 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:20:36 translating from clipboard or selection +Debug: 05-18 19:20:36 clipboard data: "https://www.youtube.com/watch?v=zOB5QhWu1VY" +Debug: 05-18 19:20:36 Current state: true false true true +Debug: 05-18 19:20:36 getResource: "gdlookup://localhost/?word=https://www.youtube.com/watch?v%3DzOB5QhWu1VY&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:20:36 scheme: "gdlookup" +Debug: 05-18 19:20:36 host: "localhost" +Debug: 05-18 19:20:36 clear current dictionaries: "https://www.youtube.com/watch?v=zOB5QhWu1VY" +Debug: 05-18 19:20:36 some body finished +Debug: 05-18 19:20:36 one not finished. +Debug: 05-18 19:20:36 ====reading 1446 of (1446) bytes . Finished: 0 +Debug: 05-18 19:20:36 ====reading 0 of (1446) bytes . Finished: 0 +Debug: 05-18 19:20:36 ====reading 0 of (1446) bytes . Finished: 0 +Warning: 05-18 19:20:36 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:22:11 translating from clipboard or selection +Debug: 05-18 19:22:11 clipboard data: "uma vez e" +Debug: 05-18 19:22:11 Current state: true false true true +Debug: 05-18 19:22:11 getResource: "gdlookup://localhost/?word=uma vez e&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:22:11 scheme: "gdlookup" +Debug: 05-18 19:22:11 host: "localhost" +Debug: 05-18 19:22:11 clear current dictionaries: "uma vez e" +Debug: 05-18 19:22:11 some body finished +Debug: 05-18 19:22:11 one not finished. +Debug: 05-18 19:22:11 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 19:22:11 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 19:22:11 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 19:22:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:22:44 translating from clipboard or selection +Debug: 05-18 19:22:44 clipboard data: "amanha vou p igreja com ela " +Debug: 05-18 19:22:44 Current state: true false true true +Debug: 05-18 19:22:44 getResource: "gdlookup://localhost/?word=amanha vou p igreja com ela&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:22:44 scheme: "gdlookup" +Debug: 05-18 19:22:44 host: "localhost" +Debug: 05-18 19:22:44 clear current dictionaries: "amanha vou p igreja com ela" +Debug: 05-18 19:22:44 some body finished +Debug: 05-18 19:22:44 one not finished. +Debug: 05-18 19:22:44 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 19:22:44 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 19:22:44 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 19:22:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:23:06 translating from clipboard or selection +Debug: 05-18 19:23:06 clipboard data: "se quiserem eh so falar q faco " +Debug: 05-18 19:23:06 Current state: true false true true +Debug: 05-18 19:23:06 getResource: "gdlookup://localhost/?word=se quiserem eh so falar q faco&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:23:06 scheme: "gdlookup" +Debug: 05-18 19:23:06 host: "localhost" +Debug: 05-18 19:23:06 clear current dictionaries: "se quiserem eh so falar q faco" +Debug: 05-18 19:23:06 some body finished +Debug: 05-18 19:23:06 one not finished. +Debug: 05-18 19:23:06 ====reading 1433 of (1433) bytes . Finished: 0 +Debug: 05-18 19:23:06 ====reading 0 of (1433) bytes . Finished: 0 +Debug: 05-18 19:23:06 ====reading 0 of (1433) bytes . Finished: 0 +Warning: 05-18 19:23:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:23:35 translating from clipboard or selection +Debug: 05-18 19:23:35 clipboard data: "os cara e" +Debug: 05-18 19:23:35 Current state: true false true true +Debug: 05-18 19:23:35 getResource: "gdlookup://localhost/?word=os cara e&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:23:35 scheme: "gdlookup" +Debug: 05-18 19:23:35 host: "localhost" +Debug: 05-18 19:23:35 clear current dictionaries: "os cara e" +Debug: 05-18 19:23:35 some body finished +Debug: 05-18 19:23:35 one not finished. +Debug: 05-18 19:23:35 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 19:23:35 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 19:23:35 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 19:23:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:24:44 translating from clipboard or selection +Debug: 05-18 19:24:44 clipboard data: "pra mim qiamt" +Debug: 05-18 19:24:44 Current state: true false true true +Debug: 05-18 19:24:44 getResource: "gdlookup://localhost/?word=pra mim qiamt&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:24:44 scheme: "gdlookup" +Debug: 05-18 19:24:44 host: "localhost" +Debug: 05-18 19:24:44 clear current dictionaries: "pra mim qiamt" +Debug: 05-18 19:24:44 some body finished +Debug: 05-18 19:24:44 one not finished. +Debug: 05-18 19:24:44 ====reading 1416 of (1416) bytes . Finished: 0 +Debug: 05-18 19:24:44 ====reading 0 of (1416) bytes . Finished: 0 +Debug: 05-18 19:24:44 ====reading 0 of (1416) bytes . Finished: 0 +Warning: 05-18 19:24:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:24:45 translating from clipboard or selection +Debug: 05-18 19:24:45 clipboard data: "so ouco " +Debug: 05-18 19:24:45 Current state: true false true true +Debug: 05-18 19:24:45 getResource: "gdlookup://localhost/?word=so ouco&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:24:45 scheme: "gdlookup" +Debug: 05-18 19:24:45 host: "localhost" +Debug: 05-18 19:24:45 clear current dictionaries: "so ouco" +Debug: 05-18 19:24:45 some body finished +Debug: 05-18 19:24:45 one not finished. +Debug: 05-18 19:24:45 ====reading 1410 of (1410) bytes . Finished: 0 +Debug: 05-18 19:24:45 ====reading 0 of (1410) bytes . Finished: 0 +Debug: 05-18 19:24:45 ====reading 0 of (1410) bytes . Finished: 0 +Warning: 05-18 19:24:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:25:35 translating from clipboard or selection +Debug: 05-18 19:25:35 clipboard data: "o plot eh" +Debug: 05-18 19:25:35 Current state: true false true true +Debug: 05-18 19:25:35 getResource: "gdlookup://localhost/?word=o plot eh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:25:35 scheme: "gdlookup" +Debug: 05-18 19:25:35 host: "localhost" +Debug: 05-18 19:25:35 clear current dictionaries: "o plot eh" +Debug: 05-18 19:25:35 some body finished +Debug: 05-18 19:25:35 one not finished. +Debug: 05-18 19:25:35 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 19:25:35 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 19:25:35 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 19:25:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:25:37 translating from clipboard or selection +Debug: 05-18 19:25:37 clipboard data: "nao " +Debug: 05-18 19:25:37 Current state: true false true true +Debug: 05-18 19:25:37 getResource: "gdlookup://localhost/?word=nao&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:25:37 scheme: "gdlookup" +Debug: 05-18 19:25:37 host: "localhost" +Debug: 05-18 19:25:37 clear current dictionaries: "nao" +Debug: 05-18 19:25:37 some body finished +Debug: 05-18 19:25:37 one not finished. +Debug: 05-18 19:25:37 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 19:25:37 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 19:25:37 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 19:25:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:25:39 translating from clipboard or selection +Debug: 05-18 19:25:39 clipboard data: "eh " +Debug: 05-18 19:25:39 Current state: true false true true +Debug: 05-18 19:25:39 getResource: "gdlookup://localhost/?word=eh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:25:39 scheme: "gdlookup" +Debug: 05-18 19:25:39 host: "localhost" +Debug: 05-18 19:25:39 clear current dictionaries: "eh" +Debug: 05-18 19:25:39 some body finished +Debug: 05-18 19:25:39 one not finished. +Debug: 05-18 19:25:39 ====reading 1405 of (1405) bytes . Finished: 0 +Debug: 05-18 19:25:39 ====reading 0 of (1405) bytes . Finished: 0 +Debug: 05-18 19:25:39 ====reading 0 of (1405) bytes . Finished: 0 +Warning: 05-18 19:25:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:27:35 translating from clipboard or selection +Debug: 05-18 19:27:35 clipboard data: "era um cara lendo a biblia " +Debug: 05-18 19:27:35 Current state: true false true true +Debug: 05-18 19:27:35 getResource: "gdlookup://localhost/?word=era um cara lendo a biblia&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:27:35 scheme: "gdlookup" +Debug: 05-18 19:27:35 host: "localhost" +Debug: 05-18 19:27:35 clear current dictionaries: "era um cara lendo a biblia" +Debug: 05-18 19:27:35 some body finished +Debug: 05-18 19:27:35 one not finished. +Debug: 05-18 19:27:35 ====reading 1429 of (1429) bytes . Finished: 0 +Debug: 05-18 19:27:35 ====reading 0 of (1429) bytes . Finished: 0 +Debug: 05-18 19:27:35 ====reading 0 of (1429) bytes . Finished: 0 +Warning: 05-18 19:27:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:27:57 translating from clipboard or selection +Debug: 05-18 19:27:57 clipboard data: "" +Debug: 05-18 19:27:59 translating from clipboard or selection +Debug: 05-18 19:27:59 clipboard data: "" +Debug: 05-18 19:28:01 translating from clipboard or selection +Debug: 05-18 19:28:01 clipboard data: "ideos/" +Debug: 05-18 19:28:01 Current state: true false true true +Debug: 05-18 19:28:01 getResource: "gdlookup://localhost/?word=ideos/&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:28:01 scheme: "gdlookup" +Debug: 05-18 19:28:01 host: "localhost" +Debug: 05-18 19:28:01 clear current dictionaries: "ideos/" +Debug: 05-18 19:28:01 some body finished +Debug: 05-18 19:28:01 one not finished. +Debug: 05-18 19:28:01 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 19:28:01 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 19:28:01 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 19:28:01 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:29:59 translating from clipboard or selection +Debug: 05-18 19:29:59 clipboard data: "dai p" +Debug: 05-18 19:29:59 Current state: true false true true +Debug: 05-18 19:29:59 getResource: "gdlookup://localhost/?word=dai p&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:29:59 scheme: "gdlookup" +Debug: 05-18 19:29:59 host: "localhost" +Debug: 05-18 19:29:59 clear current dictionaries: "dai p" +Debug: 05-18 19:29:59 some body finished +Debug: 05-18 19:29:59 one not finished. +Debug: 05-18 19:29:59 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 19:29:59 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 19:29:59 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 19:29:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:30:03 translating from clipboard or selection +Debug: 05-18 19:30:03 clipboard data: "p mim bomba" +Debug: 05-18 19:30:03 Current state: true false true true +Debug: 05-18 19:30:03 getResource: "gdlookup://localhost/?word=p mim bomba&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:30:03 scheme: "gdlookup" +Debug: 05-18 19:30:03 host: "localhost" +Debug: 05-18 19:30:03 clear current dictionaries: "p mim bomba" +Debug: 05-18 19:30:03 some body finished +Debug: 05-18 19:30:03 one not finished. +Debug: 05-18 19:30:03 ====reading 1414 of (1414) bytes . Finished: 0 +Debug: 05-18 19:30:03 ====reading 0 of (1414) bytes . Finished: 0 +Debug: 05-18 19:30:03 ====reading 0 of (1414) bytes . Finished: 0 +Warning: 05-18 19:30:03 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:30:06 translating from clipboard or selection +Debug: 05-18 19:30:06 clipboard data: "nao eh coin" +Debug: 05-18 19:30:06 Current state: true false true true +Debug: 05-18 19:30:06 getResource: "gdlookup://localhost/?word=nao eh coin&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:30:06 scheme: "gdlookup" +Debug: 05-18 19:30:06 host: "localhost" +Debug: 05-18 19:30:06 clear current dictionaries: "nao eh coin" +Debug: 05-18 19:30:06 some body finished +Debug: 05-18 19:30:06 one not finished. +Debug: 05-18 19:30:06 ====reading 1414 of (1414) bytes . Finished: 0 +Debug: 05-18 19:30:06 ====reading 0 of (1414) bytes . Finished: 0 +Debug: 05-18 19:30:06 ====reading 0 of (1414) bytes . Finished: 0 +Warning: 05-18 19:30:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:30:30 translating from clipboard or selection +Debug: 05-18 19:30:30 clipboard data: "judaimos fi," +Debug: 05-18 19:30:30 Current state: true false true true +Debug: 05-18 19:30:30 getResource: "gdlookup://localhost/?word=judaimos fi,&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:30:30 scheme: "gdlookup" +Debug: 05-18 19:30:30 host: "localhost" +Debug: 05-18 19:30:30 clear current dictionaries: "judaimos fi," +Debug: 05-18 19:30:30 some body finished +Debug: 05-18 19:30:30 one not finished. +Debug: 05-18 19:30:30 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 19:30:30 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 19:30:30 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 19:30:30 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:32:52 translating from clipboard or selection +Debug: 05-18 19:32:52 clipboard data: "sex inv" +Debug: 05-18 19:32:52 Current state: true false true true +Debug: 05-18 19:32:52 getResource: "gdlookup://localhost/?word=sex inv&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:32:52 scheme: "gdlookup" +Debug: 05-18 19:32:52 host: "localhost" +Debug: 05-18 19:32:52 clear current dictionaries: "sex inv" +Debug: 05-18 19:32:52 some body finished +Debug: 05-18 19:32:52 one not finished. +Debug: 05-18 19:32:52 ====reading 1410 of (1410) bytes . Finished: 0 +Debug: 05-18 19:32:52 ====reading 0 of (1410) bytes . Finished: 0 +Debug: 05-18 19:32:52 ====reading 0 of (1410) bytes . Finished: 0 +Warning: 05-18 19:32:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:33:24 translating from clipboard or selection +Debug: 05-18 19:33:24 clipboard data: "akai chou\"" +Debug: 05-18 19:33:24 Current state: true false true true +Debug: 05-18 19:33:24 getResource: "gdlookup://localhost/?word=akai chou%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:33:24 scheme: "gdlookup" +Debug: 05-18 19:33:24 host: "localhost" +Debug: 05-18 19:33:24 clear current dictionaries: "akai chou\"" +Debug: 05-18 19:33:24 some body finished +Debug: 05-18 19:33:24 one not finished. +Debug: 05-18 19:33:24 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 19:33:24 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 19:33:24 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 19:33:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:33:25 translating from clipboard or selection +Debug: 05-18 19:33:25 clipboard data: "\"akai chou\"" +Debug: 05-18 19:33:25 Current state: true false true true +Debug: 05-18 19:33:25 getResource: "gdlookup://localhost/?word=%22akai chou%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:33:25 scheme: "gdlookup" +Debug: 05-18 19:33:25 host: "localhost" +Debug: 05-18 19:33:25 clear current dictionaries: "\"akai chou\"" +Debug: 05-18 19:33:25 some body finished +Debug: 05-18 19:33:25 one not finished. +Debug: 05-18 19:33:25 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 19:33:25 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 19:33:25 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 19:33:25 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:33:43 translating from clipboard or selection +Debug: 05-18 19:33:43 clipboard data: "bor" +Debug: 05-18 19:33:43 Current state: true false true true +Debug: 05-18 19:33:43 getResource: "gdlookup://localhost/?word=bor&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:33:43 scheme: "gdlookup" +Debug: 05-18 19:33:43 host: "localhost" +Debug: 05-18 19:33:43 clear current dictionaries: "bor" +Debug: 05-18 19:33:43 some body finished +Debug: 05-18 19:33:43 one not finished. +Debug: 05-18 19:33:43 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 19:33:43 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 19:33:43 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 19:33:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:34:06 translating from clipboard or selection +Debug: 05-18 19:34:06 clipboard data: "principalm" +Debug: 05-18 19:34:06 Current state: true false true true +Debug: 05-18 19:34:06 getResource: "gdlookup://localhost/?word=principalm&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:34:06 scheme: "gdlookup" +Debug: 05-18 19:34:06 host: "localhost" +Debug: 05-18 19:34:06 clear current dictionaries: "principalm" +Debug: 05-18 19:34:06 some body finished +Debug: 05-18 19:34:06 one not finished. +Debug: 05-18 19:34:06 ====reading 1413 of (1413) bytes . Finished: 0 +Debug: 05-18 19:34:06 ====reading 0 of (1413) bytes . Finished: 0 +Debug: 05-18 19:34:06 ====reading 0 of (1413) bytes . Finished: 0 +Warning: 05-18 19:34:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:37:02 translating from clipboard or selection +Debug: 05-18 19:37:02 clipboard data: "" +Debug: 05-18 19:38:21 translating from clipboard or selection +Debug: 05-18 19:38:21 clipboard data: "ha!\n" +Debug: 05-18 19:38:21 Current state: true false true true +Debug: 05-18 19:38:21 getResource: "gdlookup://localhost/?word=ha!&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:38:21 scheme: "gdlookup" +Debug: 05-18 19:38:21 host: "localhost" +Debug: 05-18 19:38:21 clear current dictionaries: "ha!" +Debug: 05-18 19:38:21 some body finished +Debug: 05-18 19:38:21 one not finished. +Debug: 05-18 19:38:21 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 19:38:21 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 19:38:21 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 19:38:21 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:38:59 translating from clipboard or selection +Debug: 05-18 19:38:59 clipboard data: "com" +Debug: 05-18 19:38:59 Current state: true false true true +Debug: 05-18 19:38:59 getResource: "gdlookup://localhost/?word=com&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:38:59 scheme: "gdlookup" +Debug: 05-18 19:38:59 host: "localhost" +Debug: 05-18 19:38:59 clear current dictionaries: "com" +Debug: 05-18 19:38:59 some body finished +Debug: 05-18 19:38:59 one not finished. +Debug: 05-18 19:38:59 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 19:38:59 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 19:38:59 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 19:38:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:44:00 translating from clipboard or selection +Debug: 05-18 19:44:00 clipboard data: "o agricultor" +Debug: 05-18 19:44:00 Current state: true false true true +Debug: 05-18 19:44:00 getResource: "gdlookup://localhost/?word=o agricultor&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:44:00 scheme: "gdlookup" +Debug: 05-18 19:44:00 host: "localhost" +Debug: 05-18 19:44:00 clear current dictionaries: "o agricultor" +Debug: 05-18 19:44:00 some body finished +Debug: 05-18 19:44:00 one not finished. +Debug: 05-18 19:44:00 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 19:44:00 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 19:44:00 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 19:44:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:45:00 translating from clipboard or selection +Debug: 05-18 19:45:00 clipboard data: "carr" +Debug: 05-18 19:45:00 Current state: true false true true +Debug: 05-18 19:45:00 getResource: "gdlookup://localhost/?word=carr&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:45:00 scheme: "gdlookup" +Debug: 05-18 19:45:00 host: "localhost" +Debug: 05-18 19:45:00 clear current dictionaries: "carr" +Debug: 05-18 19:45:00 some body finished +Debug: 05-18 19:45:00 one not finished. +Debug: 05-18 19:45:00 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 19:45:00 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 19:45:00 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 19:45:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:45:17 translating from clipboard or selection +Debug: 05-18 19:45:17 clipboard data: "jamais vao deixar o pobre sem nada pra fazer" +Debug: 05-18 19:45:17 Current state: true false true true +Debug: 05-18 19:45:17 getResource: "gdlookup://localhost/?word=jamais vao deixar o pobre sem nada pra fazer&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:45:17 scheme: "gdlookup" +Debug: 05-18 19:45:17 host: "localhost" +Debug: 05-18 19:45:17 clear current dictionaries: "jamais vao deixar o pobre sem nada pra fazer" +Debug: 05-18 19:45:17 some body finished +Debug: 05-18 19:45:17 one not finished. +Debug: 05-18 19:45:17 ====reading 1447 of (1447) bytes . Finished: 0 +Debug: 05-18 19:45:17 ====reading 0 of (1447) bytes . Finished: 0 +Debug: 05-18 19:45:17 ====reading 0 of (1447) bytes . Finished: 0 +Warning: 05-18 19:45:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:45:22 translating from clipboard or selection +Debug: 05-18 19:45:22 clipboard data: "duvido " +Debug: 05-18 19:45:22 Current state: true false true true +Debug: 05-18 19:45:22 getResource: "gdlookup://localhost/?word=duvido&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:45:22 scheme: "gdlookup" +Debug: 05-18 19:45:22 host: "localhost" +Debug: 05-18 19:45:22 clear current dictionaries: "duvido" +Debug: 05-18 19:45:22 some body finished +Debug: 05-18 19:45:22 one not finished. +Debug: 05-18 19:45:22 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 19:45:22 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 19:45:22 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 19:45:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:45:43 translating from clipboard or selection +Debug: 05-18 19:45:43 clipboard data: "e msm se acontecesse, vc sabe mt bem q precisa d" +Debug: 05-18 19:45:43 Current state: true false true true +Debug: 05-18 19:45:43 getResource: "gdlookup://localhost/?word=e msm se acontecesse, vc sabe mt bem q precisa d&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:45:43 scheme: "gdlookup" +Debug: 05-18 19:45:43 host: "localhost" +Debug: 05-18 19:45:43 clear current dictionaries: "e msm se acontecesse, vc sabe mt bem q precisa d" +Debug: 05-18 19:45:43 some body finished +Debug: 05-18 19:45:43 one not finished. +Debug: 05-18 19:45:43 ====reading 1451 of (1451) bytes . Finished: 0 +Debug: 05-18 19:45:43 ====reading 0 of (1451) bytes . Finished: 0 +Debug: 05-18 19:45:43 ====reading 0 of (1451) bytes . Finished: 0 +Warning: 05-18 19:45:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:46:27 translating from clipboard or selection +Debug: 05-18 19:46:27 clipboard data: "nao vao " +Debug: 05-18 19:46:27 Current state: true false true true +Debug: 05-18 19:46:27 getResource: "gdlookup://localhost/?word=nao vao&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:46:27 scheme: "gdlookup" +Debug: 05-18 19:46:27 host: "localhost" +Debug: 05-18 19:46:27 clear current dictionaries: "nao vao" +Debug: 05-18 19:46:27 some body finished +Debug: 05-18 19:46:27 one not finished. +Debug: 05-18 19:46:27 ====reading 1410 of (1410) bytes . Finished: 0 +Debug: 05-18 19:46:27 ====reading 0 of (1410) bytes . Finished: 0 +Debug: 05-18 19:46:27 ====reading 0 of (1410) bytes . Finished: 0 +Warning: 05-18 19:46:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:47:00 translating from clipboard or selection +Debug: 05-18 19:47:00 clipboard data: "leve " +Debug: 05-18 19:47:00 Current state: true false true true +Debug: 05-18 19:47:00 getResource: "gdlookup://localhost/?word=leve&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:47:00 scheme: "gdlookup" +Debug: 05-18 19:47:00 host: "localhost" +Debug: 05-18 19:47:00 clear current dictionaries: "leve" +Debug: 05-18 19:47:00 some body finished +Debug: 05-18 19:47:00 one not finished. +Debug: 05-18 19:47:00 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 19:47:00 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 19:47:00 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 19:47:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:48:53 translating from clipboard or selection +Debug: 05-18 19:48:53 clipboard data: "(tenho diciomar" +Debug: 05-18 19:48:53 Current state: true false true true +Debug: 05-18 19:48:53 getResource: "gdlookup://localhost/?word=(tenho diciomar&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:48:53 scheme: "gdlookup" +Debug: 05-18 19:48:53 host: "localhost" +Debug: 05-18 19:48:53 clear current dictionaries: "(tenho diciomar" +Debug: 05-18 19:48:53 some body finished +Debug: 05-18 19:48:53 one not finished. +Debug: 05-18 19:48:53 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 19:48:53 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 19:48:53 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 19:48:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:52:16 translating from clipboard or selection +Debug: 05-18 19:52:16 clipboard data: "liberais " +Debug: 05-18 19:52:16 Current state: true false true true +Debug: 05-18 19:52:16 getResource: "gdlookup://localhost/?word=liberais&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:52:16 scheme: "gdlookup" +Debug: 05-18 19:52:16 host: "localhost" +Debug: 05-18 19:52:16 clear current dictionaries: "liberais" +Debug: 05-18 19:52:16 some body finished +Debug: 05-18 19:52:16 one not finished. +Debug: 05-18 19:52:16 ====reading 1411 of (1411) bytes . Finished: 0 +Debug: 05-18 19:52:16 ====reading 0 of (1411) bytes . Finished: 0 +Debug: 05-18 19:52:16 ====reading 0 of (1411) bytes . Finished: 0 +Warning: 05-18 19:52:16 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:52:22 translating from clipboard or selection +Debug: 05-18 19:52:22 clipboard data: "\"let people be a\"" +Debug: 05-18 19:52:22 Current state: true false true true +Debug: 05-18 19:52:22 getResource: "gdlookup://localhost/?word=%22let people be a%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:52:22 scheme: "gdlookup" +Debug: 05-18 19:52:22 host: "localhost" +Debug: 05-18 19:52:22 clear current dictionaries: "\"let people be a\"" +Debug: 05-18 19:52:22 some body finished +Debug: 05-18 19:52:22 one not finished. +Debug: 05-18 19:52:22 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 19:52:22 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 19:52:22 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 19:52:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:52:24 translating from clipboard or selection +Debug: 05-18 19:52:24 clipboard data: "niggas" +Debug: 05-18 19:52:24 Current state: true false true true +Debug: 05-18 19:52:24 getResource: "gdlookup://localhost/?word=niggas&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:52:24 scheme: "gdlookup" +Debug: 05-18 19:52:24 host: "localhost" +Debug: 05-18 19:52:24 clear current dictionaries: "niggas" +Debug: 05-18 19:52:24 some body finished +Debug: 05-18 19:52:24 one not finished. +Debug: 05-18 19:52:24 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 19:52:24 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 19:52:24 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 19:52:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:52:41 translating from clipboard or selection +Debug: 05-18 19:52:41 clipboard data: "😢😅💞🐮🥲🤮😩🇧🇷\n" +Debug: 05-18 19:52:41 Current state: true false true true +Debug: 05-18 19:52:41 getResource: "gdlookup://localhost/?word=😢😅💞🐮🥲🤮😩🇧🇷&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:52:41 scheme: "gdlookup" +Debug: 05-18 19:52:41 host: "localhost" +Debug: 05-18 19:52:41 clear current dictionaries: "😢😅💞🐮🥲🤮😩🇧🇷" +Debug: 05-18 19:52:41 some body finished +Debug: 05-18 19:52:41 one not finished. +Debug: 05-18 19:52:41 ====reading 1439 of (1439) bytes . Finished: 0 +Debug: 05-18 19:52:41 ====reading 0 of (1439) bytes . Finished: 0 +Debug: 05-18 19:52:41 ====reading 0 of (1439) bytes . Finished: 0 +Warning: 05-18 19:52:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:53:40 translating from clipboard or selection +Debug: 05-18 19:53:40 clipboard data: "morte" +Debug: 05-18 19:53:40 Current state: true false true true +Debug: 05-18 19:53:40 getResource: "gdlookup://localhost/?word=morte&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:53:40 scheme: "gdlookup" +Debug: 05-18 19:53:40 host: "localhost" +Debug: 05-18 19:53:40 clear current dictionaries: "morte" +Debug: 05-18 19:53:40 some body finished +Debug: 05-18 19:53:40 one not finished. +Debug: 05-18 19:53:40 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 19:53:40 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 19:53:40 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 19:53:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:54:59 translating from clipboard or selection +Debug: 05-18 19:54:59 clipboard data: "eh tipo eu ameacar um cara e ele " +Debug: 05-18 19:54:59 Current state: true false true true +Debug: 05-18 19:54:59 getResource: "gdlookup://localhost/?word=eh tipo eu ameacar um cara e ele&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:54:59 scheme: "gdlookup" +Debug: 05-18 19:54:59 host: "localhost" +Debug: 05-18 19:54:59 clear current dictionaries: "eh tipo eu ameacar um cara e ele" +Debug: 05-18 19:54:59 some body finished +Debug: 05-18 19:54:59 one not finished. +Debug: 05-18 19:54:59 ====reading 1435 of (1435) bytes . Finished: 0 +Debug: 05-18 19:54:59 ====reading 0 of (1435) bytes . Finished: 0 +Debug: 05-18 19:54:59 ====reading 0 of (1435) bytes . Finished: 0 +Warning: 05-18 19:54:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:55:48 translating from clipboard or selection +Debug: 05-18 19:55:48 clipboard data: "precisam de alguem p" +Debug: 05-18 19:55:48 Current state: true false true true +Debug: 05-18 19:55:48 getResource: "gdlookup://localhost/?word=precisam de alguem p&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:55:48 scheme: "gdlookup" +Debug: 05-18 19:55:48 host: "localhost" +Debug: 05-18 19:55:48 clear current dictionaries: "precisam de alguem p" +Debug: 05-18 19:55:48 some body finished +Debug: 05-18 19:55:48 one not finished. +Debug: 05-18 19:55:48 ====reading 1423 of (1423) bytes . Finished: 0 +Debug: 05-18 19:55:48 ====reading 0 of (1423) bytes . Finished: 0 +Debug: 05-18 19:55:48 ====reading 0 of (1423) bytes . Finished: 0 +Warning: 05-18 19:55:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:56:14 translating from clipboard or selection +Debug: 05-18 19:56:14 clipboard data: "no sentido de que a vida humana nao vale nadinha pra esses caras, querem so msm u" +Debug: 05-18 19:56:14 Current state: true false true true +Debug: 05-18 19:56:14 getResource: "gdlookup://localhost/?word=no sentido de que a vida humana nao vale nadinha pra esses caras, querem so msm u&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:56:14 scheme: "gdlookup" +Debug: 05-18 19:56:14 host: "localhost" +Debug: 05-18 19:56:14 clear current dictionaries: "no sentido de que a vida humana nao vale nadinha pra esses caras, querem so msm u" +Debug: 05-18 19:56:14 some body finished +Debug: 05-18 19:56:14 one not finished. +Debug: 05-18 19:56:14 ====reading 1484 of (1484) bytes . Finished: 0 +Debug: 05-18 19:56:14 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-18 19:56:14 ====reading 0 of (1484) bytes . Finished: 0 +Warning: 05-18 19:56:14 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 19:57:34 translating from clipboard or selection +Debug: 05-18 19:57:34 clipboard data: "n acho q foi sempre," +Debug: 05-18 19:57:34 Current state: true false true true +Debug: 05-18 19:57:35 getResource: "gdlookup://localhost/?word=n acho q foi sempre,&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 19:57:35 scheme: "gdlookup" +Debug: 05-18 19:57:35 host: "localhost" +Debug: 05-18 19:57:35 clear current dictionaries: "n acho q foi sempre," +Debug: 05-18 19:57:35 some body finished +Debug: 05-18 19:57:35 one not finished. +Debug: 05-18 19:57:35 ====reading 1423 of (1423) bytes . Finished: 0 +Debug: 05-18 19:57:35 ====reading 0 of (1423) bytes . Finished: 0 +Debug: 05-18 19:57:35 ====reading 0 of (1423) bytes . Finished: 0 +Warning: 05-18 19:57:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:08:14 translating from clipboard or selection +Debug: 05-18 20:08:14 clipboard data: "o ego comeca quand" +Debug: 05-18 20:08:14 Current state: true false true true +Debug: 05-18 20:08:14 getResource: "gdlookup://localhost/?word=o ego comeca quand&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:08:14 scheme: "gdlookup" +Debug: 05-18 20:08:14 host: "localhost" +Debug: 05-18 20:08:14 clear current dictionaries: "o ego comeca quand" +Debug: 05-18 20:08:14 some body finished +Debug: 05-18 20:08:14 one not finished. +Debug: 05-18 20:08:14 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 20:08:14 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 20:08:14 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 20:08:14 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:09:42 translating from clipboard or selection +Debug: 05-18 20:09:42 clipboard data: "" +Debug: 05-18 20:09:43 translating from clipboard or selection +Debug: 05-18 20:09:43 clipboard data: "" +Debug: 05-18 20:11:10 translating from clipboard or selection +Debug: 05-18 20:11:10 clipboard data: "a aplicacao eh chamada por outra aplicacao e " +Debug: 05-18 20:11:10 Current state: true false true true +Debug: 05-18 20:11:10 getResource: "gdlookup://localhost/?word=a aplicacao eh chamada por outra aplicacao e&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:11:10 scheme: "gdlookup" +Debug: 05-18 20:11:10 host: "localhost" +Debug: 05-18 20:11:10 clear current dictionaries: "a aplicacao eh chamada por outra aplicacao e" +Debug: 05-18 20:11:10 some body finished +Debug: 05-18 20:11:10 one not finished. +Debug: 05-18 20:11:10 ====reading 1447 of (1447) bytes . Finished: 0 +Debug: 05-18 20:11:10 ====reading 0 of (1447) bytes . Finished: 0 +Debug: 05-18 20:11:10 ====reading 0 of (1447) bytes . Finished: 0 +Warning: 05-18 20:11:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:11:13 translating from clipboard or selection +Debug: 05-18 20:11:13 clipboard data: "programa " +Debug: 05-18 20:11:13 Current state: true false true true +Debug: 05-18 20:11:13 getResource: "gdlookup://localhost/?word=programa&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:11:13 scheme: "gdlookup" +Debug: 05-18 20:11:13 host: "localhost" +Debug: 05-18 20:11:13 clear current dictionaries: "programa" +Debug: 05-18 20:11:13 some body finished +Debug: 05-18 20:11:13 one not finished. +Debug: 05-18 20:11:13 ====reading 1411 of (1411) bytes . Finished: 0 +Debug: 05-18 20:11:13 ====reading 0 of (1411) bytes . Finished: 0 +Debug: 05-18 20:11:13 ====reading 0 of (1411) bytes . Finished: 0 +Warning: 05-18 20:11:13 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:12:54 translating from clipboard or selection +Debug: 05-18 20:12:54 clipboard data: "" +Debug: 05-18 20:12:57 translating from clipboard or selection +Debug: 05-18 20:12:57 clipboard data: "" +Debug: 05-18 20:22:30 translating from clipboard or selection +Debug: 05-18 20:22:30 clipboard data: "nunca" +Debug: 05-18 20:22:30 Current state: true false true true +Debug: 05-18 20:22:30 getResource: "gdlookup://localhost/?word=nunca&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:22:30 scheme: "gdlookup" +Debug: 05-18 20:22:30 host: "localhost" +Debug: 05-18 20:22:30 clear current dictionaries: "nunca" +Debug: 05-18 20:22:30 some body finished +Debug: 05-18 20:22:30 one not finished. +Debug: 05-18 20:22:30 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 20:22:30 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 20:22:30 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 20:22:30 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:24:45 translating from clipboard or selection +Debug: 05-18 20:24:45 clipboard data: "resistir a isso eh " +Debug: 05-18 20:24:45 Current state: true false true true +Debug: 05-18 20:24:45 getResource: "gdlookup://localhost/?word=resistir a isso eh&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:24:45 scheme: "gdlookup" +Debug: 05-18 20:24:45 host: "localhost" +Debug: 05-18 20:24:45 clear current dictionaries: "resistir a isso eh" +Debug: 05-18 20:24:45 some body finished +Debug: 05-18 20:24:45 one not finished. +Debug: 05-18 20:24:45 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 20:24:45 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 20:24:45 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 20:24:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:25:26 translating from clipboard or selection +Debug: 05-18 20:25:26 clipboard data: "lost of personality " +Debug: 05-18 20:25:26 Current state: true false true true +Debug: 05-18 20:25:26 getResource: "gdlookup://localhost/?word=lost of personality&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:25:26 scheme: "gdlookup" +Debug: 05-18 20:25:26 host: "localhost" +Debug: 05-18 20:25:26 clear current dictionaries: "lost of personality" +Debug: 05-18 20:25:26 some body finished +Debug: 05-18 20:25:26 one not finished. +Debug: 05-18 20:25:26 ====reading 1422 of (1422) bytes . Finished: 0 +Debug: 05-18 20:25:26 ====reading 0 of (1422) bytes . Finished: 0 +Debug: 05-18 20:25:26 ====reading 0 of (1422) bytes . Finished: 0 +Warning: 05-18 20:25:26 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:25:26 translating from clipboard or selection +Debug: 05-18 20:25:26 clipboard data: "lost of personality " +Debug: 05-18 20:25:26 Current state: true false true true +Debug: 05-18 20:25:26 getResource: "gdlookup://localhost/?word=lost of personality&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:25:26 scheme: "gdlookup" +Debug: 05-18 20:25:26 host: "localhost" +Debug: 05-18 20:25:26 clear current dictionaries: "lost of personality" +Debug: 05-18 20:25:26 some body finished +Debug: 05-18 20:25:26 one not finished. +Debug: 05-18 20:25:26 ====reading 1422 of (1422) bytes . Finished: 0 +Debug: 05-18 20:25:26 ====reading 0 of (1422) bytes . Finished: 0 +Debug: 05-18 20:25:26 ====reading 0 of (1422) bytes . Finished: 0 +Warning: 05-18 20:25:26 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:26:27 translating from clipboard or selection +Debug: 05-18 20:26:27 clipboard data: "This" +Debug: 05-18 20:26:27 Current state: true false true true +Debug: 05-18 20:26:27 getResource: "gdlookup://localhost/?word=This&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:26:27 scheme: "gdlookup" +Debug: 05-18 20:26:27 host: "localhost" +Debug: 05-18 20:26:27 clear current dictionaries: "This" +Debug: 05-18 20:26:27 some body finished +Debug: 05-18 20:26:27 one not finished. +Debug: 05-18 20:26:27 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 20:26:27 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 20:26:27 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 20:26:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:26:52 translating from clipboard or selection +Debug: 05-18 20:26:52 clipboard data: "ou vc ama voce, ou vc " +Debug: 05-18 20:26:52 Current state: true false true true +Debug: 05-18 20:26:52 getResource: "gdlookup://localhost/?word=ou vc ama voce, ou vc&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:26:52 scheme: "gdlookup" +Debug: 05-18 20:26:52 host: "localhost" +Debug: 05-18 20:26:52 clear current dictionaries: "ou vc ama voce, ou vc" +Debug: 05-18 20:26:52 some body finished +Debug: 05-18 20:26:52 one not finished. +Debug: 05-18 20:26:52 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 20:26:52 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 20:26:52 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 20:26:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:26:59 translating from clipboard or selection +Debug: 05-18 20:26:59 clipboard data: "n adi" +Debug: 05-18 20:26:59 Current state: true false true true +Debug: 05-18 20:26:59 getResource: "gdlookup://localhost/?word=n adi&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:26:59 scheme: "gdlookup" +Debug: 05-18 20:26:59 host: "localhost" +Debug: 05-18 20:26:59 clear current dictionaries: "n adi" +Debug: 05-18 20:26:59 some body finished +Debug: 05-18 20:26:59 one not finished. +Debug: 05-18 20:26:59 ====reading 1408 of (1408) bytes . Finished: 0 +Debug: 05-18 20:26:59 ====reading 0 of (1408) bytes . Finished: 0 +Debug: 05-18 20:26:59 ====reading 0 of (1408) bytes . Finished: 0 +Warning: 05-18 20:26:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:27:01 translating from clipboard or selection +Debug: 05-18 20:27:01 clipboard data: "n adianta " +Debug: 05-18 20:27:01 Current state: true false true true +Debug: 05-18 20:27:01 getResource: "gdlookup://localhost/?word=n adianta&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:27:01 scheme: "gdlookup" +Debug: 05-18 20:27:01 host: "localhost" +Debug: 05-18 20:27:01 clear current dictionaries: "n adianta" +Debug: 05-18 20:27:01 some body finished +Debug: 05-18 20:27:01 one not finished. +Debug: 05-18 20:27:01 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:27:01 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:27:01 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:27:01 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:28:00 translating from clipboard or selection +Debug: 05-18 20:28:00 clipboard data: "ate hoje psessa" +Debug: 05-18 20:28:00 Current state: true false true true +Debug: 05-18 20:28:00 getResource: "gdlookup://localhost/?word=ate hoje psessa&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:28:00 scheme: "gdlookup" +Debug: 05-18 20:28:00 host: "localhost" +Debug: 05-18 20:28:00 clear current dictionaries: "ate hoje psessa" +Debug: 05-18 20:28:00 some body finished +Debug: 05-18 20:28:00 one not finished. +Debug: 05-18 20:28:00 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 20:28:00 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 20:28:00 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 20:28:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:28:06 translating from clipboard or selection +Debug: 05-18 20:28:06 clipboard data: "mas dai eu sei mt bem" +Debug: 05-18 20:28:06 Current state: true false true true +Debug: 05-18 20:28:06 getResource: "gdlookup://localhost/?word=mas dai eu sei mt bem&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:28:06 scheme: "gdlookup" +Debug: 05-18 20:28:06 host: "localhost" +Debug: 05-18 20:28:06 clear current dictionaries: "mas dai eu sei mt bem" +Debug: 05-18 20:28:06 some body finished +Debug: 05-18 20:28:06 one not finished. +Debug: 05-18 20:28:06 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 20:28:06 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 20:28:06 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 20:28:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:29:46 translating from clipboard or selection +Debug: 05-18 20:29:46 clipboard data: "minha familia sabe que eu levo is" +Debug: 05-18 20:29:46 Current state: true false true true +Debug: 05-18 20:29:46 getResource: "gdlookup://localhost/?word=minha familia sabe que eu levo is&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:29:46 scheme: "gdlookup" +Debug: 05-18 20:29:46 host: "localhost" +Debug: 05-18 20:29:46 clear current dictionaries: "minha familia sabe que eu levo is" +Debug: 05-18 20:29:46 some body finished +Debug: 05-18 20:29:46 one not finished. +Debug: 05-18 20:29:46 ====reading 1436 of (1436) bytes . Finished: 0 +Debug: 05-18 20:29:46 ====reading 0 of (1436) bytes . Finished: 0 +Debug: 05-18 20:29:46 ====reading 0 of (1436) bytes . Finished: 0 +Warning: 05-18 20:29:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:29:59 translating from clipboard or selection +Debug: 05-18 20:29:59 clipboard data: "bem, nunca liguei pra conquistar respeito, isso nao me " +Debug: 05-18 20:29:59 Current state: true false true true +Debug: 05-18 20:29:59 getResource: "gdlookup://localhost/?word=bem, nunca liguei pra conquistar respeito, isso nao me&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:29:59 scheme: "gdlookup" +Debug: 05-18 20:29:59 host: "localhost" +Debug: 05-18 20:29:59 clear current dictionaries: "bem, nunca liguei pra conquistar respeito, isso nao me" +Debug: 05-18 20:29:59 some body finished +Debug: 05-18 20:29:59 one not finished. +Debug: 05-18 20:29:59 ====reading 1457 of (1457) bytes . Finished: 0 +Debug: 05-18 20:29:59 ====reading 0 of (1457) bytes . Finished: 0 +Debug: 05-18 20:29:59 ====reading 0 of (1457) bytes . Finished: 0 +Warning: 05-18 20:29:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:34:56 translating from clipboard or selection +Debug: 05-18 20:34:56 clipboard data: "\"teu marido pegou gonorreia!\"\nui que emocao " +Debug: 05-18 20:34:56 Current state: true false true true +Debug: 05-18 20:34:56 getResource: "gdlookup://localhost/?word=%22teu marido pegou gonorreia!%22 ui que emocao&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:34:56 scheme: "gdlookup" +Debug: 05-18 20:34:56 host: "localhost" +Debug: 05-18 20:34:56 clear current dictionaries: "\"teu marido pegou gonorreia!\" ui que emocao" +Debug: 05-18 20:34:56 some body finished +Debug: 05-18 20:34:56 one not finished. +Debug: 05-18 20:34:56 ====reading 1456 of (1456) bytes . Finished: 0 +Debug: 05-18 20:34:56 ====reading 0 of (1456) bytes . Finished: 0 +Debug: 05-18 20:34:56 ====reading 0 of (1456) bytes . Finished: 0 +Warning: 05-18 20:34:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:35:19 translating from clipboard or selection +Debug: 05-18 20:35:19 clipboard data: "libof68651@fincainc.com" +Debug: 05-18 20:35:19 Current state: true false true true +Debug: 05-18 20:35:19 getResource: "gdlookup://localhost/?word=libof68651@fincainc.com&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:35:19 scheme: "gdlookup" +Debug: 05-18 20:35:19 host: "localhost" +Debug: 05-18 20:35:19 clear current dictionaries: "libof68651@fincainc.com" +Debug: 05-18 20:35:19 some body finished +Debug: 05-18 20:35:19 one not finished. +Debug: 05-18 20:35:19 ====reading 1426 of (1426) bytes . Finished: 0 +Debug: 05-18 20:35:19 ====reading 0 of (1426) bytes . Finished: 0 +Debug: 05-18 20:35:19 ====reading 0 of (1426) bytes . Finished: 0 +Warning: 05-18 20:35:19 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:37:44 translating from clipboard or selection +Debug: 05-18 20:37:44 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:37:44 Current state: true false true true +Debug: 05-18 20:37:44 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:37:44 scheme: "gdlookup" +Debug: 05-18 20:37:44 host: "localhost" +Debug: 05-18 20:37:44 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:37:44 some body finished +Debug: 05-18 20:37:44 one not finished. +Debug: 05-18 20:37:44 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 20:37:44 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 20:37:44 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 20:37:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:37:44 translating from clipboard or selection +Debug: 05-18 20:37:44 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:37:44 Current state: true false true true +Debug: 05-18 20:37:44 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:37:44 scheme: "gdlookup" +Debug: 05-18 20:37:44 host: "localhost" +Debug: 05-18 20:37:44 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:37:44 some body finished +Debug: 05-18 20:37:44 one not finished. +Debug: 05-18 20:37:44 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 20:37:44 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 20:37:44 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 20:37:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:37:45 translating from clipboard or selection +Debug: 05-18 20:37:45 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:37:45 Current state: true false true true +Debug: 05-18 20:37:45 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:37:45 scheme: "gdlookup" +Debug: 05-18 20:37:45 host: "localhost" +Debug: 05-18 20:37:45 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:37:45 some body finished +Debug: 05-18 20:37:45 one not finished. +Debug: 05-18 20:37:45 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 20:37:45 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 20:37:45 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 20:37:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:39:40 translating from clipboard or selection +Debug: 05-18 20:39:40 clipboard data: "turn the whole " +Debug: 05-18 20:39:40 Current state: true false true true +Debug: 05-18 20:39:40 getResource: "gdlookup://localhost/?word=turn the whole&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:39:40 scheme: "gdlookup" +Debug: 05-18 20:39:40 host: "localhost" +Debug: 05-18 20:39:40 clear current dictionaries: "turn the whole" +Debug: 05-18 20:39:40 some body finished +Debug: 05-18 20:39:40 one not finished. +Debug: 05-18 20:39:40 ====reading 1417 of (1417) bytes . Finished: 0 +Debug: 05-18 20:39:40 ====reading 0 of (1417) bytes . Finished: 0 +Debug: 05-18 20:39:40 ====reading 0 of (1417) bytes . Finished: 0 +Warning: 05-18 20:39:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:39:45 translating from clipboard or selection +Debug: 05-18 20:39:45 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include // Include for file operations\n#include // Include for getting the current time\n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution() {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Error: Unable to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n log_execution(); // Log the execution\n\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:39:45 Current state: true false true true +Debug: 05-18 20:39:45 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E // Include for file operations %23include %3Cctime%3E // Include for getting the current time // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution() %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Error: Unable to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file.close(); %7D int main(const int argc, char* argv[]) %7B log_execution(); // Log the execution bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:39:45 scheme: "gdlookup" +Debug: 05-18 20:39:45 host: "localhost" +Debug: 05-18 20:39:45 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include // Include for file operations #include // Include for getting the current time // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution() { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Error: Unable to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file.close(); } int main(const int argc, char* argv[]) { log_execution(); // Log the execution bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:39:45 some body finished +Debug: 05-18 20:39:45 one not finished. +Debug: 05-18 20:39:45 ====reading 11826 of (11826) bytes . Finished: 0 +Debug: 05-18 20:39:45 ====reading 0 of (11826) bytes . Finished: 0 +Debug: 05-18 20:39:45 ====reading 0 of (11826) bytes . Finished: 0 +Warning: 05-18 20:39:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:39:47 translating from clipboard or selection +Debug: 05-18 20:39:47 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:39:47 Current state: true false true true +Debug: 05-18 20:39:47 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:39:47 scheme: "gdlookup" +Debug: 05-18 20:39:47 host: "localhost" +Debug: 05-18 20:39:47 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:39:47 some body finished +Debug: 05-18 20:39:47 one not finished. +Debug: 05-18 20:39:47 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 20:39:47 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 20:39:47 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 20:39:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:39:48 translating from clipboard or selection +Debug: 05-18 20:39:48 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t // Skip the next argument as it's the dictionary file path\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
\" + substring + \"\";\n\n\t// Adding alternatives for the current substring\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
    \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
  • \" + alt + \"
  • \";\n\t }\n\t output_html += \"
\";\n\t}\n\n\toutput_html += \"
\"; // Close segment div\n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:39:48 Current state: true false true true +Debug: 05-18 20:39:48 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:39:48 scheme: "gdlookup" +Debug: 05-18 20:39:48 host: "localhost" +Debug: 05-18 20:39:48 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:39:48 some body finished +Debug: 05-18 20:39:48 one not finished. +Debug: 05-18 20:39:48 ====reading 11307 of (11307) bytes . Finished: 0 +Debug: 05-18 20:39:48 ====reading 0 of (11307) bytes . Finished: 0 +Debug: 05-18 20:39:48 ====reading 0 of (11307) bytes . Finished: 0 +Warning: 05-18 20:39:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:40:15 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:40:15 scheme: "gdlookup" +Debug: 05-18 20:40:15 host: "localhost" +Debug: 05-18 20:40:15 clear current dictionaries: "違和感" +Debug: 05-18 20:40:15 some body finished +Debug: 05-18 20:40:15 one not finished. +Debug: 05-18 20:40:15 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:15 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:15 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:40:15 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:40:20 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:40:20 scheme: "gdlookup" +Debug: 05-18 20:40:20 host: "localhost" +Debug: 05-18 20:40:20 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:40:20 some body finished +Debug: 05-18 20:40:20 one not finished. +Debug: 05-18 20:40:20 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:40:20 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:40:20 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:40:20 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:40:21 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:40:21 scheme: "gdlookup" +Debug: 05-18 20:40:21 host: "localhost" +Debug: 05-18 20:40:21 clear current dictionaries: "違和感" +Debug: 05-18 20:40:21 some body finished +Debug: 05-18 20:40:21 one not finished. +Debug: 05-18 20:40:21 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:21 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:21 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:40:21 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:40:22 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:40:22 scheme: "gdlookup" +Debug: 05-18 20:40:22 host: "localhost" +Debug: 05-18 20:40:22 clear current dictionaries: "違和感" +Debug: 05-18 20:40:22 some body finished +Debug: 05-18 20:40:22 one not finished. +Debug: 05-18 20:40:22 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:22 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:22 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:40:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:40:23 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:40:23 scheme: "gdlookup" +Debug: 05-18 20:40:23 host: "localhost" +Debug: 05-18 20:40:23 clear current dictionaries: "違和感" +Debug: 05-18 20:40:23 some body finished +Debug: 05-18 20:40:23 one not finished. +Debug: 05-18 20:40:23 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:23 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:23 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:40:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:40:25 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:40:25 scheme: "gdlookup" +Debug: 05-18 20:40:25 host: "localhost" +Debug: 05-18 20:40:25 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:40:25 some body finished +Debug: 05-18 20:40:25 one not finished. +Debug: 05-18 20:40:25 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:40:25 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:40:25 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:40:25 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:40:27 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:40:27 scheme: "gdlookup" +Debug: 05-18 20:40:27 host: "localhost" +Debug: 05-18 20:40:27 clear current dictionaries: "違和感" +Debug: 05-18 20:40:27 some body finished +Debug: 05-18 20:40:27 one not finished. +Debug: 05-18 20:40:27 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:27 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:40:27 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:40:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:24 translating from clipboard or selection +Debug: 05-18 20:42:24 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include // Include for file operations\n#include // Include for getting the current time\n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:42:24 Current state: true true false true +Debug: 05-18 20:42:24 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E // Include for file operations %23include %3Cctime%3E // Include for getting the current time // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:24 scheme: "gdlookup" +Debug: 05-18 20:42:24 host: "localhost" +Debug: 05-18 20:42:24 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include // Include for file operations #include // Include for getting the current time // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:42:24 some body finished +Debug: 05-18 20:42:24 one not finished. +Debug: 05-18 20:42:24 ====reading 12658 of (12658) bytes . Finished: 0 +Debug: 05-18 20:42:24 ====reading 0 of (12658) bytes . Finished: 0 +Debug: 05-18 20:42:24 ====reading 0 of (12658) bytes . Finished: 0 +Warning: 05-18 20:42:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:27 translating from clipboard or selection +Debug: 05-18 20:42:27 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include // Include for file operations\n#include // Include for getting the current time\n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution() {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Error: Unable to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n log_execution(); // Log the execution\n\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:42:27 Current state: true false false true +Debug: 05-18 20:42:27 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E // Include for file operations %23include %3Cctime%3E // Include for getting the current time // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution() %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Error: Unable to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file.close(); %7D int main(const int argc, char* argv[]) %7B log_execution(); // Log the execution bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:27 scheme: "gdlookup" +Debug: 05-18 20:42:27 host: "localhost" +Debug: 05-18 20:42:27 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include // Include for file operations #include // Include for getting the current time // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution() { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Error: Unable to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file.close(); } int main(const int argc, char* argv[]) { log_execution(); // Log the execution bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:42:27 some body finished +Debug: 05-18 20:42:27 one not finished. +Debug: 05-18 20:42:27 ====reading 11826 of (11826) bytes . Finished: 0 +Debug: 05-18 20:42:27 ====reading 0 of (11826) bytes . Finished: 0 +Debug: 05-18 20:42:27 ====reading 0 of (11826) bytes . Finished: 0 +Warning: 05-18 20:42:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:28 translating from clipboard or selection +Debug: 05-18 20:42:28 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include // Include for file operations\n#include // Include for getting the current time\n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution() {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Error: Unable to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n log_execution(); // Log the execution\n\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:42:28 Current state: true false true true +Debug: 05-18 20:42:28 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E // Include for file operations %23include %3Cctime%3E // Include for getting the current time // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution() %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Error: Unable to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file.close(); %7D int main(const int argc, char* argv[]) %7B log_execution(); // Log the execution bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:28 scheme: "gdlookup" +Debug: 05-18 20:42:28 host: "localhost" +Debug: 05-18 20:42:28 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include // Include for file operations #include // Include for getting the current time // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution() { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Error: Unable to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file.close(); } int main(const int argc, char* argv[]) { log_execution(); // Log the execution bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:42:28 some body finished +Debug: 05-18 20:42:28 one not finished. +Debug: 05-18 20:42:28 ====reading 11826 of (11826) bytes . Finished: 0 +Debug: 05-18 20:42:28 ====reading 0 of (11826) bytes . Finished: 0 +Debug: 05-18 20:42:28 ====reading 0 of (11826) bytes . Finished: 0 +Warning: 05-18 20:42:28 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:38 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:38 scheme: "gdlookup" +Debug: 05-18 20:42:38 host: "localhost" +Debug: 05-18 20:42:38 clear current dictionaries: "違和感" +Debug: 05-18 20:42:38 some body finished +Debug: 05-18 20:42:38 one not finished. +Debug: 05-18 20:42:38 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:38 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:38 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:42:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:39 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:39 scheme: "gdlookup" +Debug: 05-18 20:42:39 host: "localhost" +Debug: 05-18 20:42:39 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:42:39 some body finished +Debug: 05-18 20:42:39 one not finished. +Debug: 05-18 20:42:39 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:39 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:39 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:42:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:40 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:40 scheme: "gdlookup" +Debug: 05-18 20:42:40 host: "localhost" +Debug: 05-18 20:42:40 clear current dictionaries: "違和感" +Debug: 05-18 20:42:40 some body finished +Debug: 05-18 20:42:40 one not finished. +Debug: 05-18 20:42:40 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:40 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:40 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:42:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:40 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:40 scheme: "gdlookup" +Debug: 05-18 20:42:40 host: "localhost" +Debug: 05-18 20:42:40 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:42:40 some body finished +Debug: 05-18 20:42:40 one not finished. +Debug: 05-18 20:42:40 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:40 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:40 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:42:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:41 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:41 scheme: "gdlookup" +Debug: 05-18 20:42:41 host: "localhost" +Debug: 05-18 20:42:41 clear current dictionaries: "違和感" +Debug: 05-18 20:42:41 some body finished +Debug: 05-18 20:42:41 one not finished. +Debug: 05-18 20:42:41 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:41 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:41 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:42:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:42 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:42 scheme: "gdlookup" +Debug: 05-18 20:42:42 host: "localhost" +Debug: 05-18 20:42:42 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:42:42 some body finished +Debug: 05-18 20:42:42 one not finished. +Debug: 05-18 20:42:42 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:42 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:42 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:42:42 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:42 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:42 scheme: "gdlookup" +Debug: 05-18 20:42:42 host: "localhost" +Debug: 05-18 20:42:42 clear current dictionaries: "違和感" +Debug: 05-18 20:42:42 some body finished +Debug: 05-18 20:42:42 one not finished. +Debug: 05-18 20:42:42 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:42 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:42 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:42:42 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:48 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:48 scheme: "gdlookup" +Debug: 05-18 20:42:48 host: "localhost" +Debug: 05-18 20:42:48 clear current dictionaries: "ゆっくり" +Debug: 05-18 20:42:48 some body finished +Debug: 05-18 20:42:48 one not finished. +Debug: 05-18 20:42:48 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 20:42:48 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 20:42:48 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 20:42:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:48 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:48 scheme: "gdlookup" +Debug: 05-18 20:42:48 host: "localhost" +Debug: 05-18 20:42:48 clear current dictionaries: "違和感" +Debug: 05-18 20:42:48 some body finished +Debug: 05-18 20:42:48 one not finished. +Debug: 05-18 20:42:48 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:48 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:42:48 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:42:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:53 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:53 scheme: "gdlookup" +Debug: 05-18 20:42:53 host: "localhost" +Debug: 05-18 20:42:53 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:42:53 some body finished +Debug: 05-18 20:42:53 one not finished. +Debug: 05-18 20:42:53 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:53 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:53 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:42:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:42:54 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:42:54 scheme: "gdlookup" +Debug: 05-18 20:42:54 host: "localhost" +Debug: 05-18 20:42:54 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:42:54 some body finished +Debug: 05-18 20:42:54 one not finished. +Debug: 05-18 20:42:54 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:54 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:42:54 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:42:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:43:00 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:43:00 scheme: "gdlookup" +Debug: 05-18 20:43:00 host: "localhost" +Debug: 05-18 20:43:00 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:43:00 some body finished +Debug: 05-18 20:43:00 one not finished. +Debug: 05-18 20:43:00 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:43:00 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:43:00 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:43:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:43:03 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:43:03 scheme: "gdlookup" +Debug: 05-18 20:43:03 host: "localhost" +Debug: 05-18 20:43:03 clear current dictionaries: "違和感" +Debug: 05-18 20:43:03 some body finished +Debug: 05-18 20:43:03 one not finished. +Debug: 05-18 20:43:03 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:43:03 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:43:03 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:43:03 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:43:04 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:43:04 scheme: "gdlookup" +Debug: 05-18 20:43:04 host: "localhost" +Debug: 05-18 20:43:04 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:43:04 some body finished +Debug: 05-18 20:43:04 one not finished. +Debug: 05-18 20:43:04 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:43:04 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:43:04 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:43:04 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:43:06 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:43:06 scheme: "gdlookup" +Debug: 05-18 20:43:06 host: "localhost" +Debug: 05-18 20:43:06 clear current dictionaries: "違和感" +Debug: 05-18 20:43:06 some body finished +Debug: 05-18 20:43:06 one not finished. +Debug: 05-18 20:43:06 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:43:06 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:43:06 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:43:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:43:06 getResource: "gdlookup://localhost/?word=reproductible&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:43:06 scheme: "gdlookup" +Debug: 05-18 20:43:06 host: "localhost" +Debug: 05-18 20:43:06 clear current dictionaries: "reproductible" +Debug: 05-18 20:43:06 some body finished +Debug: 05-18 20:43:06 one not finished. +Debug: 05-18 20:43:06 ====reading 1416 of (1416) bytes . Finished: 0 +Debug: 05-18 20:43:06 ====reading 0 of (1416) bytes . Finished: 0 +Debug: 05-18 20:43:06 ====reading 0 of (1416) bytes . Finished: 0 +Warning: 05-18 20:43:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:43:50 translating from clipboard or selection +Debug: 05-18 20:43:50 clipboard data: "eh o dialogo de " +Debug: 05-18 20:43:50 Current state: true true false true +Debug: 05-18 20:43:50 getResource: "gdlookup://localhost/?word=eh o dialogo de&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:43:50 scheme: "gdlookup" +Debug: 05-18 20:43:50 host: "localhost" +Debug: 05-18 20:43:50 clear current dictionaries: "eh o dialogo de" +Debug: 05-18 20:43:50 some body finished +Debug: 05-18 20:43:50 one not finished. +Debug: 05-18 20:43:50 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 20:43:50 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 20:43:50 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 20:43:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:44:39 translating from clipboard or selection +Debug: 05-18 20:44:39 clipboard data: "自分宛てに" +Debug: 05-18 20:44:39 Current state: true false false true +Debug: 05-18 20:44:39 getResource: "gdlookup://localhost/?word=自分宛てに&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:44:39 scheme: "gdlookup" +Debug: 05-18 20:44:39 host: "localhost" +Debug: 05-18 20:44:39 clear current dictionaries: "自分宛てに" +Debug: 05-18 20:44:39 some body finished +Debug: 05-18 20:44:39 one not finished. +Debug: 05-18 20:44:39 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 20:44:39 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 20:44:39 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 20:44:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:45:28 translating from clipboard or selection +Debug: 05-18 20:45:28 clipboard data: "Texto Platão_Mênon" +Debug: 05-18 20:45:28 Current state: true false true true +Debug: 05-18 20:45:28 getResource: "gdlookup://localhost/?word=Texto Platão_Mênon&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:45:28 scheme: "gdlookup" +Debug: 05-18 20:45:28 host: "localhost" +Debug: 05-18 20:45:28 clear current dictionaries: "Texto Platão_Mênon" +Debug: 05-18 20:45:28 some body finished +Debug: 05-18 20:45:28 one not finished. +Debug: 05-18 20:45:28 ====reading 1423 of (1423) bytes . Finished: 0 +Debug: 05-18 20:45:28 ====reading 0 of (1423) bytes . Finished: 0 +Debug: 05-18 20:45:28 ====reading 0 of (1423) bytes . Finished: 0 +Warning: 05-18 20:45:28 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:45:30 translating from clipboard or selection +Debug: 05-18 20:45:30 clipboard data: "" +Debug: 05-18 20:45:46 translating from clipboard or selection +Debug: 05-18 20:45:46 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:45:46 Current state: true false true true +Debug: 05-18 20:45:46 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:45:46 scheme: "gdlookup" +Debug: 05-18 20:45:46 host: "localhost" +Debug: 05-18 20:45:46 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:45:46 some body finished +Debug: 05-18 20:45:46 one not finished. +Debug: 05-18 20:45:46 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:45:46 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:45:46 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:45:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:45:51 translating from clipboard or selection +Debug: 05-18 20:45:51 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include // Include for file operations\n#include // Include for getting the current time\n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n\n search_string = new_search_string;\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n return 0;\n}\n" +Debug: 05-18 20:45:51 Current state: true false true true +Debug: 05-18 20:45:51 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E // Include for file operations %23include %3Cctime%3E // Include for getting the current time // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D search_string %3D new_search_string; // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:45:51 scheme: "gdlookup" +Debug: 05-18 20:45:51 host: "localhost" +Debug: 05-18 20:45:51 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include // Include for file operations #include // Include for getting the current time // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); if (goldendict_mode && !sentence.empty()) { search_string = sentence; } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; break; } search_string = new_search_string; // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } return 0; }" +Debug: 05-18 20:45:51 some body finished +Debug: 05-18 20:45:51 one not finished. +Debug: 05-18 20:45:51 ====reading 12658 of (12658) bytes . Finished: 0 +Debug: 05-18 20:45:51 ====reading 0 of (12658) bytes . Finished: 0 +Debug: 05-18 20:45:51 ====reading 0 of (12658) bytes . Finished: 0 +Warning: 05-18 20:45:51 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:46:02 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:46:02 scheme: "gdlookup" +Debug: 05-18 20:46:02 host: "localhost" +Debug: 05-18 20:46:02 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:46:02 some body finished +Debug: 05-18 20:46:02 one not finished. +Debug: 05-18 20:46:02 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:46:02 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:46:02 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:46:02 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:46:10 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:46:10 scheme: "gdlookup" +Debug: 05-18 20:46:10 host: "localhost" +Debug: 05-18 20:46:10 clear current dictionaries: "ゆっくり" +Debug: 05-18 20:46:10 some body finished +Debug: 05-18 20:46:10 one not finished. +Debug: 05-18 20:46:10 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 20:46:10 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 20:46:10 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 20:46:10 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:46:16 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:46:16 scheme: "gdlookup" +Debug: 05-18 20:46:16 host: "localhost" +Debug: 05-18 20:46:16 clear current dictionaries: "違和感" +Debug: 05-18 20:46:16 some body finished +Debug: 05-18 20:46:16 one not finished. +Debug: 05-18 20:46:16 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 20:46:16 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 20:46:16 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 20:46:16 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:46:37 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:46:37 scheme: "gdlookup" +Debug: 05-18 20:46:37 host: "localhost" +Debug: 05-18 20:46:37 clear current dictionaries: "議" +Debug: 05-18 20:46:37 some body finished +Debug: 05-18 20:46:37 one not finished. +Debug: 05-18 20:46:37 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 20:46:37 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 20:46:37 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 20:46:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:46:38 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:46:38 scheme: "gdlookup" +Debug: 05-18 20:46:38 host: "localhost" +Debug: 05-18 20:46:38 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 20:46:38 some body finished +Debug: 05-18 20:46:38 one not finished. +Debug: 05-18 20:46:38 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 20:46:38 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 20:46:38 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 20:46:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:46:44 translating from clipboard or selection +Debug: 05-18 20:46:44 clipboard data: "地獄の苦しみ" +Debug: 05-18 20:46:44 Current state: true false false true +Debug: 05-18 20:46:44 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:46:44 scheme: "gdlookup" +Debug: 05-18 20:46:44 host: "localhost" +Debug: 05-18 20:46:44 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 20:46:44 some body finished +Debug: 05-18 20:46:44 one not finished. +Debug: 05-18 20:46:44 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 20:46:44 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 20:46:44 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 20:46:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:47:08 translating from clipboard or selection +Debug: 05-18 20:47:08 clipboard data: "" +Debug: 05-18 20:49:12 translating from clipboard or selection +Debug: 05-18 20:49:12 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n output_html += \"
HTML delivered to GoldenDict successfully.
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* const argv[]) {\n const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) {\n return std::strcmp(arg, \"--goldendict\") == 0;\n });\n\n const std::string search_string = get_input(argc, argv, goldendict_mode);\n\n log_internal(\"Search string: \" + search_string);\n\n std::filesystem::path dic_file;\n try {\n dic_file = find_dic_file();\n } catch (const std::exception& e) {\n std::cerr << e.what() << std::endl;\n log_internal(std::string(\"Error: \") + e.what());\n return 1;\n }\n\n log_internal(\"Dictionary file found: \" + dic_file.string());\n\n xcdat::Xcdat dic;\n dic.load(dic_file.string());\n log_internal(\"Dictionary loaded successfully.\");\n\n std::map> alternatives_map;\n const auto entry = dic.find(search_string);\n std::vector substrings;\n\n if (!entry) {\n std::cerr << \"Not found\" << std::endl;\n log_internal(\"Entry not found for: \" + search_string);\n } else {\n substrings.push_back(search_string);\n alternatives_map.emplace(search_string, std::set());\n\n for (const auto& suffix : entry->suffixes) {\n substrings.push_back(suffix);\n alternatives_map[search_string].insert(suffix);\n }\n }\n\n std::string sentence = search_string;\n wrap_html_output(substrings, alternatives_map, sentence);\n\n if (goldendict_mode) {\n log_internal(\"HTML delivered to GoldenDict successfully.\");\n }\n\n return 0;\n}\n" +Debug: 05-18 20:49:12 Current state: true true false true +Debug: 05-18 20:49:12 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cdiv style%3D%27color: green; font-weight: bold;%27%3EHTML delivered to GoldenDict successfully.%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* const argv[]) %7B const bool goldendict_mode %3D std::any_of(argv, argv + argc, [](const char* arg) %7B return std::strcmp(arg, %22--goldendict%22) %3D%3D 0; %7D); const std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); std::filesystem::path dic_file; try %7B dic_file %3D find_dic_file(); %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C e.what() %3C%3C std::endl; log_internal(std::string(%22Error: %22) + e.what()); return 1; %7D log_internal(%22Dictionary file found: %22 + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(%22Dictionary loaded successfully.%22); std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; const auto entry %3D dic.find(search_string); std::vector%3Cstd::string%3E substrings; if (!entry) %7B std::cerr %3C%3C %22Not found%22 %3C%3C std::endl; log_internal(%22Entry not found for: %22 + search_string); %7D else %7B substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set%3Cstd::string%3E()); for (const auto%26 suffix : entry-%3Esuffixes) %7B substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); %7D %7D std::string sentence %3D search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) %7B log_internal(%22HTML delivered to GoldenDict successfully.%22); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:49:12 scheme: "gdlookup" +Debug: 05-18 20:49:12 host: "localhost" +Debug: 05-18 20:49:12 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; output_html += \"
HTML delivered to GoldenDict successfully.
\"; std::cout << output_html << std::endl; } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* const argv[]) { const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) { return std::strcmp(arg, \"--goldendict\") == 0; }); const std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); std::filesystem::path dic_file; try { dic_file = find_dic_file(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; log_internal(std::string(\"Error: \") + e.what()); return 1; } log_internal(\"Dictionary file found: \" + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(\"Dictionary loaded successfully.\"); std::map> alternatives_map; const auto entry = dic.find(search_string); std::vector substrings; if (!entry) { std::cerr << \"Not found\" << std::endl; log_internal(\"Entry not found for: \" + search_string); } else { substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set()); for (const auto& suffix : entry->suffixes) { substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); } } std::string sentence = search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) { log_internal(\"HTML delivered to GoldenDict successfully.\"); } return 0; }" +Debug: 05-18 20:49:12 some body finished +Debug: 05-18 20:49:12 one not finished. +Debug: 05-18 20:49:12 ====reading 10415 of (10415) bytes . Finished: 0 +Debug: 05-18 20:49:12 ====reading 0 of (10415) bytes . Finished: 0 +Debug: 05-18 20:49:12 ====reading 0 of (10415) bytes . Finished: 0 +Warning: 05-18 20:49:12 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:49:16 translating from clipboard or selection +Debug: 05-18 20:49:16 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:49:16 Current state: true false false true +Debug: 05-18 20:49:16 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:49:16 scheme: "gdlookup" +Debug: 05-18 20:49:16 host: "localhost" +Debug: 05-18 20:49:16 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:49:16 some body finished +Debug: 05-18 20:49:16 one not finished. +Debug: 05-18 20:49:16 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:49:16 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:49:16 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:49:16 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:50:28 translating from clipboard or selection +Debug: 05-18 20:50:28 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:50:28 Current state: true true false true +Debug: 05-18 20:50:28 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:50:28 scheme: "gdlookup" +Debug: 05-18 20:50:28 host: "localhost" +Debug: 05-18 20:50:28 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:50:28 some body finished +Debug: 05-18 20:50:28 one not finished. +Debug: 05-18 20:50:28 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:50:28 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:50:28 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:50:28 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:22 translating from clipboard or selection +Debug: 05-18 20:51:22 clipboard data: "\n log_internal(\"Program finished\");\n return 0;\n}" +Debug: 05-18 20:51:22 Current state: true false false true +Debug: 05-18 20:51:22 getResource: "gdlookup://localhost/?word=log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:22 scheme: "gdlookup" +Debug: 05-18 20:51:22 host: "localhost" +Debug: 05-18 20:51:22 clear current dictionaries: "log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:51:22 some body finished +Debug: 05-18 20:51:22 one not finished. +Debug: 05-18 20:51:22 ====reading 1458 of (1458) bytes . Finished: 0 +Debug: 05-18 20:51:22 ====reading 0 of (1458) bytes . Finished: 0 +Debug: 05-18 20:51:22 ====reading 0 of (1458) bytes . Finished: 0 +Warning: 05-18 20:51:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:25 translating from clipboard or selection +Debug: 05-18 20:51:25 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n output_html += \"
HTML delivered to GoldenDict successfully.
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* const argv[]) {\n const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) {\n return std::strcmp(arg, \"--goldendict\") == 0;\n });\n\n const std::string search_string = get_input(argc, argv, goldendict_mode);\n\n log_internal(\"Search string: \" + search_string);\n\n std::filesystem::path dic_file;\n try {\n dic_file = find_dic_file();\n } catch (const std::exception& e) {\n std::cerr << e.what() << std::endl;\n log_internal(std::string(\"Error: \") + e.what());\n return 1;\n }\n\n log_internal(\"Dictionary file found: \" + dic_file.string());\n\n xcdat::Xcdat dic;\n dic.load(dic_file.string());\n log_internal(\"Dictionary loaded successfully.\");\n\n std::map> alternatives_map;\n const auto entry = dic.find(search_string);\n std::vector substrings;\n\n if (!entry) {\n std::cerr << \"Not found\" << std::endl;\n log_internal(\"Entry not found for: \" + search_string);\n } else {\n substrings.push_back(search_string);\n alternatives_map.emplace(search_string, std::set());\n\n for (const auto& suffix : entry->suffixes) {\n substrings.push_back(suffix);\n alternatives_map[search_string].insert(suffix);\n }\n }\n\n std::string sentence = search_string;\n wrap_html_output(substrings, alternatives_map, sentence);\n\n if (goldendict_mode) {\n log_internal(\"HTML delivered to GoldenDict successfully.\");\n }\n\n return 0;\n}\n" +Debug: 05-18 20:51:25 Current state: true false true true +Debug: 05-18 20:51:25 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cdiv style%3D%27color: green; font-weight: bold;%27%3EHTML delivered to GoldenDict successfully.%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* const argv[]) %7B const bool goldendict_mode %3D std::any_of(argv, argv + argc, [](const char* arg) %7B return std::strcmp(arg, %22--goldendict%22) %3D%3D 0; %7D); const std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); std::filesystem::path dic_file; try %7B dic_file %3D find_dic_file(); %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C e.what() %3C%3C std::endl; log_internal(std::string(%22Error: %22) + e.what()); return 1; %7D log_internal(%22Dictionary file found: %22 + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(%22Dictionary loaded successfully.%22); std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; const auto entry %3D dic.find(search_string); std::vector%3Cstd::string%3E substrings; if (!entry) %7B std::cerr %3C%3C %22Not found%22 %3C%3C std::endl; log_internal(%22Entry not found for: %22 + search_string); %7D else %7B substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set%3Cstd::string%3E()); for (const auto%26 suffix : entry-%3Esuffixes) %7B substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); %7D %7D std::string sentence %3D search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) %7B log_internal(%22HTML delivered to GoldenDict successfully.%22); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:25 scheme: "gdlookup" +Debug: 05-18 20:51:25 host: "localhost" +Debug: 05-18 20:51:25 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; output_html += \"
HTML delivered to GoldenDict successfully.
\"; std::cout << output_html << std::endl; } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* const argv[]) { const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) { return std::strcmp(arg, \"--goldendict\") == 0; }); const std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); std::filesystem::path dic_file; try { dic_file = find_dic_file(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; log_internal(std::string(\"Error: \") + e.what()); return 1; } log_internal(\"Dictionary file found: \" + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(\"Dictionary loaded successfully.\"); std::map> alternatives_map; const auto entry = dic.find(search_string); std::vector substrings; if (!entry) { std::cerr << \"Not found\" << std::endl; log_internal(\"Entry not found for: \" + search_string); } else { substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set()); for (const auto& suffix : entry->suffixes) { substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); } } std::string sentence = search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) { log_internal(\"HTML delivered to GoldenDict successfully.\"); } return 0; }" +Debug: 05-18 20:51:25 some body finished +Debug: 05-18 20:51:25 one not finished. +Debug: 05-18 20:51:25 ====reading 10415 of (10415) bytes . Finished: 0 +Debug: 05-18 20:51:25 ====reading 0 of (10415) bytes . Finished: 0 +Debug: 05-18 20:51:25 ====reading 0 of (10415) bytes . Finished: 0 +Warning: 05-18 20:51:25 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:25 translating from clipboard or selection +Debug: 05-18 20:51:25 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Struct to hold the view and id of each entry\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\n// Function to remove one UTF-8 character and return the character along with the new string\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { // 1-byte character\n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { // 2-byte character\n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { // 3-byte character\n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { // 4-byte character\n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\n// Function to check input from command line or piped input\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n\n if (!isatty(fileno(stdin))) { // If input is piped\n std::getline(std::cin, search_string);\n } else { // If input is provided as command line argument\n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n // Skip the next argument as it's the dictionary file path\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; // Open container div\n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n // Adding alternatives for the current substring\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; // Close segment div\n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; // Close container div\n output_html += \"
\";\n output_html += \"
HTML delivered to GoldenDict successfully.
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* const argv[]) {\n const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) {\n return std::strcmp(arg, \"--goldendict\") == 0;\n });\n\n const std::string search_string = get_input(argc, argv, goldendict_mode);\n\n log_internal(\"Search string: \" + search_string);\n\n std::filesystem::path dic_file;\n try {\n dic_file = find_dic_file();\n } catch (const std::exception& e) {\n std::cerr << e.what() << std::endl;\n log_internal(std::string(\"Error: \") + e.what());\n return 1;\n }\n\n log_internal(\"Dictionary file found: \" + dic_file.string());\n\n xcdat::Xcdat dic;\n dic.load(dic_file.string());\n log_internal(\"Dictionary loaded successfully.\");\n\n std::map> alternatives_map;\n const auto entry = dic.find(search_string);\n std::vector substrings;\n\n if (!entry) {\n std::cerr << \"Not found\" << std::endl;\n log_internal(\"Entry not found for: \" + search_string);\n } else {\n substrings.push_back(search_string);\n alternatives_map.emplace(search_string, std::set());\n\n for (const auto& suffix : entry->suffixes) {\n substrings.push_back(suffix);\n alternatives_map[search_string].insert(suffix);\n }\n }\n\n std::string sentence = search_string;\n wrap_html_output(substrings, alternatives_map, sentence);\n\n if (goldendict_mode) {\n log_internal(\"HTML delivered to GoldenDict successfully.\");\n }\n\n return 0;\n}\n" +Debug: 05-18 20:51:25 Current state: true false true true +Debug: 05-18 20:51:25 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E // Struct to hold the view and id of each entry struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B // 1-byte character return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B // 2-byte character return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B // 3-byte character return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B // 4-byte character return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B // If input is piped std::getline(std::cin, search_string); %7D else %7B // If input is provided as command line argument if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B // Skip the next argument as it%27s the dictionary file path i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; // Open container div while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; // Adding alternatives for the current substring auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; // Close segment div output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; // Adjusted container class output_html +%3D %22.segment %7B display: inline-block; %7D%22; // Adjusted segment class output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; // Close container div output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cdiv style%3D%27color: green; font-weight: bold;%27%3EHTML delivered to GoldenDict successfully.%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* const argv[]) %7B const bool goldendict_mode %3D std::any_of(argv, argv + argc, [](const char* arg) %7B return std::strcmp(arg, %22--goldendict%22) %3D%3D 0; %7D); const std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); std::filesystem::path dic_file; try %7B dic_file %3D find_dic_file(); %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C e.what() %3C%3C std::endl; log_internal(std::string(%22Error: %22) + e.what()); return 1; %7D log_internal(%22Dictionary file found: %22 + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(%22Dictionary loaded successfully.%22); std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; const auto entry %3D dic.find(search_string); std::vector%3Cstd::string%3E substrings; if (!entry) %7B std::cerr %3C%3C %22Not found%22 %3C%3C std::endl; log_internal(%22Entry not found for: %22 + search_string); %7D else %7B substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set%3Cstd::string%3E()); for (const auto%26 suffix : entry-%3Esuffixes) %7B substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); %7D %7D std::string sentence %3D search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) %7B log_internal(%22HTML delivered to GoldenDict successfully.%22); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:25 scheme: "gdlookup" +Debug: 05-18 20:51:25 host: "localhost" +Debug: 05-18 20:51:25 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include // Struct to hold the view and id of each entry struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; // Function to remove one UTF-8 character and return the character along with the new string inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { // 1-byte character return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { // 2-byte character return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { // 3-byte character return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { // 4-byte character return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } // Function to check input from command line or piped input inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { // If input is piped std::getline(std::cin, search_string); } else { // If input is provided as command line argument if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { // Skip the next argument as it's the dictionary file path i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; // Open container div while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; // Adding alternatives for the current substring auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; // Close segment div output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; // Close container div output_html += \"
\"; output_html += \"
HTML delivered to GoldenDict successfully.
\"; std::cout << output_html << std::endl; } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* const argv[]) { const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) { return std::strcmp(arg, \"--goldendict\") == 0; }); const std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); std::filesystem::path dic_file; try { dic_file = find_dic_file(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; log_internal(std::string(\"Error: \") + e.what()); return 1; } log_internal(\"Dictionary file found: \" + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(\"Dictionary loaded successfully.\"); std::map> alternatives_map; const auto entry = dic.find(search_string); std::vector substrings; if (!entry) { std::cerr << \"Not found\" << std::endl; log_internal(\"Entry not found for: \" + search_string); } else { substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set()); for (const auto& suffix : entry->suffixes) { substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); } } std::string sentence = search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) { log_internal(\"HTML delivered to GoldenDict successfully.\"); } return 0; }" +Debug: 05-18 20:51:26 some body finished +Debug: 05-18 20:51:26 one not finished. +Debug: 05-18 20:51:26 ====reading 10415 of (10415) bytes . Finished: 0 +Debug: 05-18 20:51:26 ====reading 0 of (10415) bytes . Finished: 0 +Debug: 05-18 20:51:26 ====reading 0 of (10415) bytes . Finished: 0 +Warning: 05-18 20:51:26 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:35 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:35 scheme: "gdlookup" +Debug: 05-18 20:51:35 host: "localhost" +Debug: 05-18 20:51:35 clear current dictionaries: "議" +Debug: 05-18 20:51:35 some body finished +Debug: 05-18 20:51:35 one not finished. +Debug: 05-18 20:51:35 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 20:51:35 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 20:51:35 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 20:51:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:40 translating from clipboard or selection +Debug: 05-18 20:51:40 clipboard data: "!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* const argv[]) { const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) { return std::strcmp(arg, \"--goldendict\") == 0; }); const std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); std::filesystem::path dic_file; try { dic_file = find_dic_file(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; log_internal(std::string(\"Error: \") + e.what()); return 1; } log_internal(\"Dictionary file found: \" + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(\"Dictionary loaded successfully.\"); std::map> alternatives_map; const auto entry = dic.find(search_string); std::vector substrings; if (!entry) { std::cerr << \"Not found\" << std::endl; log_internal(\"Entry not found for: \" + search_string); } else { substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set()); for (const auto& suffix : entry->suffixes) { substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); } } std::string sentence = search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) { log_internal(\"HTML delivered to GoldenDict successfully.\"); } return 0; }" +Debug: 05-18 20:51:40 Current state: true false false true +Debug: 05-18 20:51:40 getResource: "gdlookup://localhost/?word=!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* const argv[]) %7B const bool goldendict_mode %3D std::any_of(argv, argv + argc, [](const char* arg) %7B return std::strcmp(arg, %22--goldendict%22) %3D%3D 0; %7D); const std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); std::filesystem::path dic_file; try %7B dic_file %3D find_dic_file(); %7D catch (const std::exception%26 e) %7B std::cerr %3C%3C e.what() %3C%3C std::endl; log_internal(std::string(%22Error: %22) + e.what()); return 1; %7D log_internal(%22Dictionary file found: %22 + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(%22Dictionary loaded successfully.%22); std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; const auto entry %3D dic.find(search_string); std::vector%3Cstd::string%3E substrings; if (!entry) %7B std::cerr %3C%3C %22Not found%22 %3C%3C std::endl; log_internal(%22Entry not found for: %22 + search_string); %7D else %7B substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set%3Cstd::string%3E()); for (const auto%26 suffix : entry-%3Esuffixes) %7B substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); %7D %7D std::string sentence %3D search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) %7B log_internal(%22HTML delivered to GoldenDict successfully.%22); %7D return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:40 scheme: "gdlookup" +Debug: 05-18 20:51:40 host: "localhost" +Debug: 05-18 20:51:40 clear current dictionaries: "!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* const argv[]) { const bool goldendict_mode = std::any_of(argv, argv + argc, [](const char* arg) { return std::strcmp(arg, \"--goldendict\") == 0; }); const std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); std::filesystem::path dic_file; try { dic_file = find_dic_file(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; log_internal(std::string(\"Error: \") + e.what()); return 1; } log_internal(\"Dictionary file found: \" + dic_file.string()); xcdat::Xcdat dic; dic.load(dic_file.string()); log_internal(\"Dictionary loaded successfully.\"); std::map> alternatives_map; const auto entry = dic.find(search_string); std::vector substrings; if (!entry) { std::cerr << \"Not found\" << std::endl; log_internal(\"Entry not found for: \" + search_string); } else { substrings.push_back(search_string); alternatives_map.emplace(search_string, std::set()); for (const auto& suffix : entry->suffixes) { substrings.push_back(suffix); alternatives_map[search_string].insert(suffix); } } std::string sentence = search_string; wrap_html_output(substrings, alternatives_map, sentence); if (goldendict_mode) { log_internal(\"HTML delivered to GoldenDict successfully.\"); } return 0; }" +Debug: 05-18 20:51:40 some body finished +Debug: 05-18 20:51:40 one not finished. +Debug: 05-18 20:51:40 ====reading 3140 of (3140) bytes . Finished: 0 +Debug: 05-18 20:51:40 ====reading 0 of (3140) bytes . Finished: 0 +Debug: 05-18 20:51:40 ====reading 0 of (3140) bytes . Finished: 0 +Warning: 05-18 20:51:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:45 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:45 scheme: "gdlookup" +Debug: 05-18 20:51:45 host: "localhost" +Debug: 05-18 20:51:45 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 20:51:45 some body finished +Debug: 05-18 20:51:45 one not finished. +Debug: 05-18 20:51:45 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 20:51:45 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 20:51:45 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 20:51:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:56 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:56 scheme: "gdlookup" +Debug: 05-18 20:51:56 host: "localhost" +Debug: 05-18 20:51:56 clear current dictionaries: "ゆっくり" +Debug: 05-18 20:51:56 some body finished +Debug: 05-18 20:51:56 one not finished. +Debug: 05-18 20:51:56 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 20:51:56 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 20:51:56 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 20:51:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:51:57 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:51:57 scheme: "gdlookup" +Debug: 05-18 20:51:57 host: "localhost" +Debug: 05-18 20:51:57 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:51:57 some body finished +Debug: 05-18 20:51:57 one not finished. +Debug: 05-18 20:51:57 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:51:57 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:51:57 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:51:57 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:52:10 translating from clipboard or selection +Debug: 05-18 20:52:10 clipboard data: "転生したら剣でした" +Debug: 05-18 20:52:10 Current state: true false false true +Debug: 05-18 20:52:10 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:52:10 scheme: "gdlookup" +Debug: 05-18 20:52:10 host: "localhost" +Debug: 05-18 20:52:10 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 20:52:10 some body finished +Debug: 05-18 20:52:10 one not finished. +Debug: 05-18 20:52:10 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 20:52:10 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 20:52:10 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 20:52:10 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:52:23 getResource: "gdlookup://localhost/?word=意識&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:52:23 scheme: "gdlookup" +Debug: 05-18 20:52:23 host: "localhost" +Debug: 05-18 20:52:23 clear current dictionaries: "意識" +Debug: 05-18 20:52:23 some body finished +Debug: 05-18 20:52:23 one not finished. +Debug: 05-18 20:52:23 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 20:52:23 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 20:52:23 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 20:52:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:52:23 getResource: "gdlookup://localhost/?word=猿猴捉月。&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:52:23 scheme: "gdlookup" +Debug: 05-18 20:52:23 host: "localhost" +Debug: 05-18 20:52:23 clear current dictionaries: "猿猴捉月。" +Debug: 05-18 20:52:23 some body finished +Debug: 05-18 20:52:23 one not finished. +Debug: 05-18 20:52:23 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 20:52:23 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 20:52:23 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 20:52:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:53:58 translating from clipboard or selection +Debug: 05-18 20:53:58 clipboard data: "rixope2409@huleos.com" +Debug: 05-18 20:53:58 Current state: true true false true +Debug: 05-18 20:53:58 getResource: "gdlookup://localhost/?word=rixope2409@huleos.com&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:53:58 scheme: "gdlookup" +Debug: 05-18 20:53:58 host: "localhost" +Debug: 05-18 20:53:58 clear current dictionaries: "rixope2409@huleos.com" +Debug: 05-18 20:53:58 some body finished +Debug: 05-18 20:53:58 one not finished. +Debug: 05-18 20:53:58 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 20:53:58 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 20:53:58 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 20:53:58 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:55:39 translating from clipboard or selection +Debug: 05-18 20:55:39 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:55:39 Current state: true false false true +Debug: 05-18 20:55:39 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:55:39 scheme: "gdlookup" +Debug: 05-18 20:55:39 host: "localhost" +Debug: 05-18 20:55:39 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:55:39 some body finished +Debug: 05-18 20:55:39 one not finished. +Debug: 05-18 20:55:39 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:55:39 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:55:39 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:55:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:55:39 translating from clipboard or selection +Debug: 05-18 20:55:39 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:55:39 Current state: true false true true +Debug: 05-18 20:55:39 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:55:39 scheme: "gdlookup" +Debug: 05-18 20:55:39 host: "localhost" +Debug: 05-18 20:55:39 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:55:39 some body finished +Debug: 05-18 20:55:39 one not finished. +Debug: 05-18 20:55:39 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:55:39 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:55:39 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:55:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:55:40 translating from clipboard or selection +Debug: 05-18 20:55:40 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:55:40 Current state: true false true true +Debug: 05-18 20:55:40 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:55:40 scheme: "gdlookup" +Debug: 05-18 20:55:40 host: "localhost" +Debug: 05-18 20:55:40 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:55:40 some body finished +Debug: 05-18 20:55:40 one not finished. +Debug: 05-18 20:55:40 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:55:40 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:55:40 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:55:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:56:45 translating from clipboard or selection +Debug: 05-18 20:56:45 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// Other includes and function definitions remain unchanged\n\nvoid print_success_message() {\n std::cout << \"\\033[32mSuccessfully delivered HTML to GoldenDict!\\033[0m\" << std::endl;\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n print_success_message(); // Print success message when HTML is delivered\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:56:45 Current state: true false true true +Debug: 05-18 20:56:45 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E // Other includes and function definitions remain unchanged void print_success_message() %7B std::cout %3C%3C %22%5C033[32mSuccessfully delivered HTML to GoldenDict!%5C033[0m%22 %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); print_success_message(); // Print success message when HTML is delivered %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:56:45 scheme: "gdlookup" +Debug: 05-18 20:56:45 host: "localhost" +Debug: 05-18 20:56:45 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include // Other includes and function definitions remain unchanged void print_success_message() { std::cout << \"\\033[32mSuccessfully delivered HTML to GoldenDict!\\033[0m\" << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); print_success_message(); // Print success message when HTML is delivered } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:56:45 some body finished +Debug: 05-18 20:56:45 one not finished. +Debug: 05-18 20:56:45 ====reading 6028 of (6028) bytes . Finished: 0 +Debug: 05-18 20:56:45 ====reading 0 of (6028) bytes . Finished: 0 +Debug: 05-18 20:56:45 ====reading 0 of (6028) bytes . Finished: 0 +Warning: 05-18 20:56:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:56:54 translating from clipboard or selection +Debug: 05-18 20:56:54 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:56:54 Current state: true true false true +Debug: 05-18 20:56:54 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:56:54 scheme: "gdlookup" +Debug: 05-18 20:56:54 host: "localhost" +Debug: 05-18 20:56:54 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:56:54 some body finished +Debug: 05-18 20:56:54 one not finished. +Debug: 05-18 20:56:54 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:56:54 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:56:54 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:56:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:56:55 translating from clipboard or selection +Debug: 05-18 20:56:55 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:56:55 Current state: true false false true +Debug: 05-18 20:56:55 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:56:55 scheme: "gdlookup" +Debug: 05-18 20:56:55 host: "localhost" +Debug: 05-18 20:56:55 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:56:55 some body finished +Debug: 05-18 20:56:55 one not finished. +Debug: 05-18 20:56:55 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:56:55 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:56:55 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:56:55 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:57:31 translating from clipboard or selection +Debug: 05-18 20:57:31 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:57:31 Current state: true false true true +Debug: 05-18 20:57:31 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:57:31 scheme: "gdlookup" +Debug: 05-18 20:57:31 host: "localhost" +Debug: 05-18 20:57:31 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:57:31 some body finished +Debug: 05-18 20:57:31 one not finished. +Debug: 05-18 20:57:31 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:57:31 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:57:31 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:57:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:57:31 translating from clipboard or selection +Debug: 05-18 20:57:31 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:57:31 Current state: true false true true +Debug: 05-18 20:57:31 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:57:31 scheme: "gdlookup" +Debug: 05-18 20:57:31 host: "localhost" +Debug: 05-18 20:57:31 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:57:31 some body finished +Debug: 05-18 20:57:31 one not finished. +Debug: 05-18 20:57:31 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:57:31 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:57:31 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:57:31 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:58:44 translating from clipboard or selection +Debug: 05-18 20:58:44 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:58:44 Current state: true false true true +Debug: 05-18 20:58:44 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:58:44 scheme: "gdlookup" +Debug: 05-18 20:58:44 host: "localhost" +Debug: 05-18 20:58:44 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:58:44 some body finished +Debug: 05-18 20:58:44 one not finished. +Debug: 05-18 20:58:44 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:58:44 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:58:44 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:58:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:58:46 translating from clipboard or selection +Debug: 05-18 20:58:46 clipboard data: "" +Debug: 05-18 20:58:47 translating from clipboard or selection +Debug: 05-18 20:58:47 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 20:58:47 Current state: true false true true +Debug: 05-18 20:58:47 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:58:47 scheme: "gdlookup" +Debug: 05-18 20:58:47 host: "localhost" +Debug: 05-18 20:58:47 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 20:58:47 some body finished +Debug: 05-18 20:58:47 one not finished. +Debug: 05-18 20:58:47 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 20:58:47 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 20:58:47 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 20:58:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:58:56 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:58:56 scheme: "gdlookup" +Debug: 05-18 20:58:56 host: "localhost" +Debug: 05-18 20:58:56 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 20:58:56 some body finished +Debug: 05-18 20:58:56 one not finished. +Debug: 05-18 20:58:56 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 20:58:56 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 20:58:56 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 20:58:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:58:58 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:58:58 scheme: "gdlookup" +Debug: 05-18 20:58:58 host: "localhost" +Debug: 05-18 20:58:58 clear current dictionaries: "議" +Debug: 05-18 20:58:58 some body finished +Debug: 05-18 20:58:58 one not finished. +Debug: 05-18 20:58:58 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 20:58:58 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 20:58:58 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 20:58:58 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 20:59:05 translating from clipboard or selection +Debug: 05-18 20:59:05 clipboard data: "\"Program finished\"); " +Debug: 05-18 20:59:05 Current state: true false false true +Debug: 05-18 20:59:05 getResource: "gdlookup://localhost/?word=%22Program finished%22);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 20:59:05 scheme: "gdlookup" +Debug: 05-18 20:59:05 host: "localhost" +Debug: 05-18 20:59:05 clear current dictionaries: "\"Program finished\");" +Debug: 05-18 20:59:05 some body finished +Debug: 05-18 20:59:05 one not finished. +Debug: 05-18 20:59:05 ====reading 1433 of (1433) bytes . Finished: 0 +Debug: 05-18 20:59:05 ====reading 0 of (1433) bytes . Finished: 0 +Debug: 05-18 20:59:05 ====reading 0 of (1433) bytes . Finished: 0 +Warning: 05-18 20:59:05 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:00:28 translating from clipboard or selection +Debug: 05-18 21:00:28 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:00:28 Current state: true true true true +Debug: 05-18 21:00:28 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:00:28 scheme: "gdlookup" +Debug: 05-18 21:00:28 host: "localhost" +Debug: 05-18 21:00:28 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:00:28 some body finished +Debug: 05-18 21:00:28 one not finished. +Debug: 05-18 21:00:28 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 21:00:28 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 21:00:28 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 21:00:28 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:00:28 translating from clipboard or selection +Debug: 05-18 21:00:28 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:00:28 Current state: true false true true +Debug: 05-18 21:00:28 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:00:28 scheme: "gdlookup" +Debug: 05-18 21:00:28 host: "localhost" +Debug: 05-18 21:00:28 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:00:28 some body finished +Debug: 05-18 21:00:28 one not finished. +Debug: 05-18 21:00:28 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 21:00:28 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 21:00:28 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 21:00:28 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:20:00 translating from clipboard or selection +Debug: 05-18 21:20:00 clipboard data: "" +Debug: 05-18 21:20:01 translating from clipboard or selection +Debug: 05-18 21:20:01 clipboard data: "" +Debug: 05-18 21:20:40 translating from clipboard or selection +Debug: 05-18 21:20:40 clipboard data: "" +Debug: 05-18 21:20:41 translating from clipboard or selection +Debug: 05-18 21:20:41 clipboard data: "" +Debug: 05-18 21:21:18 translating from clipboard or selection +Debug: 05-18 21:21:18 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:21:18 Current state: true false true true +Debug: 05-18 21:21:18 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:18 scheme: "gdlookup" +Debug: 05-18 21:21:18 host: "localhost" +Debug: 05-18 21:21:18 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:21:18 some body finished +Debug: 05-18 21:21:18 one not finished. +Debug: 05-18 21:21:18 ====reading 13355 of (13355) bytes . Finished: 0 +Debug: 05-18 21:21:18 ====reading 0 of (13355) bytes . Finished: 0 +Debug: 05-18 21:21:18 ====reading 0 of (13355) bytes . Finished: 0 +Warning: 05-18 21:21:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:20 translating from clipboard or selection +Debug: 05-18 21:21:20 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:21:20 Current state: true false true true +Debug: 05-18 21:21:20 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:20 scheme: "gdlookup" +Debug: 05-18 21:21:20 host: "localhost" +Debug: 05-18 21:21:20 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:21:20 some body finished +Debug: 05-18 21:21:20 one not finished. +Debug: 05-18 21:21:20 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 21:21:20 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 21:21:20 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 21:21:20 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:21 translating from clipboard or selection +Debug: 05-18 21:21:21 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:21:21 Current state: true false true true +Debug: 05-18 21:21:21 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:21 scheme: "gdlookup" +Debug: 05-18 21:21:21 host: "localhost" +Debug: 05-18 21:21:21 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:21:21 some body finished +Debug: 05-18 21:21:21 one not finished. +Debug: 05-18 21:21:21 ====reading 13346 of (13346) bytes . Finished: 0 +Debug: 05-18 21:21:21 ====reading 0 of (13346) bytes . Finished: 0 +Debug: 05-18 21:21:21 ====reading 0 of (13346) bytes . Finished: 0 +Warning: 05-18 21:21:21 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:36 translating from clipboard or selection +Debug: 05-18 21:21:36 clipboard data: "src/main.cc: In function ‘int main(int, char* const*)’:\nsrc/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’\n 206 | xcdat::Xcdat dic;\n | ^~~~~\nsrc/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’?\n 207 | dic.load(dic_file.string());\n | ^~~\n | div\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ " +Debug: 05-18 21:21:36 Current state: true true false true +Debug: 05-18 21:21:36 getResource: "gdlookup://localhost/?word=src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 %7C xcdat::Xcdat dic; %7C %5E~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 %7C dic.load(dic_file.string()); %7C %5E~~ %7C div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:36 scheme: "gdlookup" +Debug: 05-18 21:21:36 host: "localhost" +Debug: 05-18 21:21:36 clear current dictionaries: "src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 | xcdat::Xcdat dic; | ^~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 | dic.load(dic_file.string()); | ^~~ | div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $" +Debug: 05-18 21:21:36 some body finished +Debug: 05-18 21:21:36 one not finished. +Debug: 05-18 21:21:36 ====reading 1844 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:36 ====reading 0 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:36 ====reading 0 of (1844) bytes . Finished: 0 +Warning: 05-18 21:21:36 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:37 translating from clipboard or selection +Debug: 05-18 21:21:37 clipboard data: "src/main.cc: In function ‘int main(int, char* const*)’:\nsrc/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’\n 206 | xcdat::Xcdat dic;\n | ^~~~~\nsrc/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’?\n 207 | dic.load(dic_file.string());\n | ^~~\n | div\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ " +Debug: 05-18 21:21:37 Current state: true false false true +Debug: 05-18 21:21:37 getResource: "gdlookup://localhost/?word=src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 %7C xcdat::Xcdat dic; %7C %5E~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 %7C dic.load(dic_file.string()); %7C %5E~~ %7C div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:37 scheme: "gdlookup" +Debug: 05-18 21:21:37 host: "localhost" +Debug: 05-18 21:21:37 clear current dictionaries: "src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 | xcdat::Xcdat dic; | ^~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 | dic.load(dic_file.string()); | ^~~ | div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $" +Debug: 05-18 21:21:37 some body finished +Debug: 05-18 21:21:37 one not finished. +Debug: 05-18 21:21:37 ====reading 1844 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:37 ====reading 0 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:37 ====reading 0 of (1844) bytes . Finished: 0 +Warning: 05-18 21:21:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:38 translating from clipboard or selection +Debug: 05-18 21:21:38 clipboard data: "src/main.cc: In function ‘int main(int, char* const*)’:\nsrc/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’\n 206 | xcdat::Xcdat dic;\n | ^~~~~\nsrc/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’?\n 207 | dic.load(dic_file.string());\n | ^~~\n | div\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ " +Debug: 05-18 21:21:38 Current state: true false true true +Debug: 05-18 21:21:38 getResource: "gdlookup://localhost/?word=src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 %7C xcdat::Xcdat dic; %7C %5E~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 %7C dic.load(dic_file.string()); %7C %5E~~ %7C div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:38 scheme: "gdlookup" +Debug: 05-18 21:21:38 host: "localhost" +Debug: 05-18 21:21:38 clear current dictionaries: "src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 | xcdat::Xcdat dic; | ^~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 | dic.load(dic_file.string()); | ^~~ | div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $" +Debug: 05-18 21:21:38 some body finished +Debug: 05-18 21:21:38 one not finished. +Debug: 05-18 21:21:38 ====reading 1844 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:38 ====reading 0 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:38 ====reading 0 of (1844) bytes . Finished: 0 +Warning: 05-18 21:21:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:39 translating from clipboard or selection +Debug: 05-18 21:21:39 clipboard data: "src/main.cc: In function ‘int main(int, char* const*)’:\nsrc/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’\n 206 | xcdat::Xcdat dic;\n | ^~~~~\nsrc/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’?\n 207 | dic.load(dic_file.string());\n | ^~~\n | div\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ g++ src/main.cc -o hakurei\n/tmp/Hakurei $ " +Debug: 05-18 21:21:39 Current state: true false true true +Debug: 05-18 21:21:39 getResource: "gdlookup://localhost/?word=src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 %7C xcdat::Xcdat dic; %7C %5E~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 %7C dic.load(dic_file.string()); %7C %5E~~ %7C div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:39 scheme: "gdlookup" +Debug: 05-18 21:21:39 host: "localhost" +Debug: 05-18 21:21:39 clear current dictionaries: "src/main.cc: In function ‘int main(int, char* const*)’: src/main.cc:206:12: error: ‘Xcdat’ is not a member of ‘xcdat’ 206 | xcdat::Xcdat dic; | ^~~~~ src/main.cc:207:5: error: ‘dic’ was not declared in this scope; did you mean ‘div’? 207 | dic.load(dic_file.string()); | ^~~ | div /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $ g++ src/main.cc -o hakurei /tmp/Hakurei $" +Debug: 05-18 21:21:39 some body finished +Debug: 05-18 21:21:39 one not finished. +Debug: 05-18 21:21:39 ====reading 1844 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:39 ====reading 0 of (1844) bytes . Finished: 0 +Debug: 05-18 21:21:39 ====reading 0 of (1844) bytes . Finished: 0 +Warning: 05-18 21:21:39 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:52 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:52 scheme: "gdlookup" +Debug: 05-18 21:21:52 host: "localhost" +Debug: 05-18 21:21:52 clear current dictionaries: "ゆっくり" +Debug: 05-18 21:21:52 some body finished +Debug: 05-18 21:21:52 one not finished. +Debug: 05-18 21:21:52 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 21:21:52 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 21:21:52 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 21:21:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:21:57 translating from clipboard or selection +Debug: 05-18 21:21:57 clipboard data: " to: ゆっくり\n\n\n\n" +Debug: 05-18 21:21:57 Current state: true false false true +Debug: 05-18 21:21:57 getResource: "gdlookup://localhost/?word=to: ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:21:57 scheme: "gdlookup" +Debug: 05-18 21:21:57 host: "localhost" +Debug: 05-18 21:21:57 clear current dictionaries: "to: ゆっくり" +Debug: 05-18 21:21:57 some body finished +Debug: 05-18 21:21:57 one not finished. +Debug: 05-18 21:21:57 ====reading 1419 of (1419) bytes . Finished: 0 +Debug: 05-18 21:21:57 ====reading 0 of (1419) bytes . Finished: 0 +Debug: 05-18 21:21:57 ====reading 0 of (1419) bytes . Finished: 0 +Warning: 05-18 21:21:57 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:22:00 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:22:00 scheme: "gdlookup" +Debug: 05-18 21:22:00 host: "localhost" +Debug: 05-18 21:22:00 clear current dictionaries: "納得が行く" +Debug: 05-18 21:22:00 some body finished +Debug: 05-18 21:22:00 one not finished. +Debug: 05-18 21:22:00 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 21:22:00 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 21:22:00 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 21:22:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:22:20 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:22:20 scheme: "gdlookup" +Debug: 05-18 21:22:20 host: "localhost" +Debug: 05-18 21:22:20 clear current dictionaries: "納得が行く" +Debug: 05-18 21:22:20 some body finished +Debug: 05-18 21:22:20 one not finished. +Debug: 05-18 21:22:20 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 21:22:20 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 21:22:21 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 21:22:21 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:22:27 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:22:27 scheme: "gdlookup" +Debug: 05-18 21:22:27 host: "localhost" +Debug: 05-18 21:22:27 clear current dictionaries: "納得が行く" +Debug: 05-18 21:22:27 some body finished +Debug: 05-18 21:22:27 one not finished. +Debug: 05-18 21:22:27 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 21:22:27 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 21:22:27 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 21:22:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:23:36 translating from clipboard or selection +Debug: 05-18 21:23:36 clipboard data: "inline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n" +Debug: 05-18 21:23:36 Current state: true true false true +Debug: 05-18 21:23:36 getResource: "gdlookup://localhost/?word=inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:23:36 scheme: "gdlookup" +Debug: 05-18 21:23:36 host: "localhost" +Debug: 05-18 21:23:36 clear current dictionaries: "inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; }" +Debug: 05-18 21:23:36 some body finished +Debug: 05-18 21:23:36 one not finished. +Debug: 05-18 21:23:36 ====reading 4907 of (4907) bytes . Finished: 0 +Debug: 05-18 21:23:36 ====reading 0 of (4907) bytes . Finished: 0 +Debug: 05-18 21:23:36 ====reading 0 of (4907) bytes . Finished: 0 +Warning: 05-18 21:23:36 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:23:37 translating from clipboard or selection +Debug: 05-18 21:23:37 clipboard data: "cpp\n" +Debug: 05-18 21:23:37 Current state: true false false true +Debug: 05-18 21:23:37 getResource: "gdlookup://localhost/?word=cpp&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:23:37 scheme: "gdlookup" +Debug: 05-18 21:23:37 host: "localhost" +Debug: 05-18 21:23:37 clear current dictionaries: "cpp" +Debug: 05-18 21:23:37 some body finished +Debug: 05-18 21:23:37 one not finished. +Debug: 05-18 21:23:37 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 21:23:37 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 21:23:37 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 21:23:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:23:47 translating from clipboard or selection +Debug: 05-18 21:23:47 clipboard data: "ze) / 4); max-width: 100%; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; }\";\n output_html += \".hakurei .alternatives > ul { list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0% 50% / 0.05); box-shadow: 0 0 4px hsl(0 0% 0% / 0.1); border-radius: 0.2rem; }\";\n output_html += \".hakurei .alternatives > ul > li { margin-right: 1rem; }\";\n output_html += \".container { display: flex; flex-wrap: wrap; gap: 10px; }\"; \n output_html += \".segment { display: inline-block; }\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"\"; \n output_html += \"\";\n std::cout << output_html << std::endl;\n}\n" +Debug: 05-18 21:23:47 Current state: true false true true +Debug: 05-18 21:23:47 getResource: "gdlookup://localhost/?word=ze) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:23:47 scheme: "gdlookup" +Debug: 05-18 21:23:47 host: "localhost" +Debug: 05-18 21:23:47 clear current dictionaries: "ze) / 4); max-width: 100%; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; }\"; output_html += \".hakurei .alternatives > ul { list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0% 50% / 0.05); box-shadow: 0 0 4px hsl(0 0% 0% / 0.1); border-radius: 0.2rem; }\"; output_html += \".hakurei .alternatives > ul > li { margin-right: 1rem; }\"; output_html += \".container { display: flex; flex-wrap: wrap; gap: 10px; }\"; output_html += \".segment { display: inline-block; }\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"\"; output_html += \"\"; std::cout << output_html << std::endl; }" +Debug: 05-18 21:23:47 some body finished +Debug: 05-18 21:23:47 one not finished. +Debug: 05-18 21:23:47 ====reading 2762 of (2762) bytes . Finished: 0 +Debug: 05-18 21:23:47 ====reading 0 of (2762) bytes . Finished: 0 +Debug: 05-18 21:23:47 ====reading 0 of (2762) bytes . Finished: 0 +Warning: 05-18 21:23:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:23:55 translating from clipboard or selection +Debug: 05-18 21:23:55 clipboard data: "inline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n" +Debug: 05-18 21:23:55 Current state: true false true true +Debug: 05-18 21:23:55 getResource: "gdlookup://localhost/?word=inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:23:55 scheme: "gdlookup" +Debug: 05-18 21:23:55 host: "localhost" +Debug: 05-18 21:23:55 clear current dictionaries: "inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; }" +Debug: 05-18 21:23:55 some body finished +Debug: 05-18 21:23:55 one not finished. +Debug: 05-18 21:23:55 ====reading 4768 of (4768) bytes . Finished: 0 +Debug: 05-18 21:23:55 ====reading 0 of (4768) bytes . Finished: 0 +Debug: 05-18 21:23:55 ====reading 0 of (4768) bytes . Finished: 0 +Warning: 05-18 21:23:55 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:23:56 translating from clipboard or selection +Debug: 05-18 21:23:56 clipboard data: "inline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n" +Debug: 05-18 21:23:56 Current state: true false true true +Debug: 05-18 21:23:56 getResource: "gdlookup://localhost/?word=inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:23:56 scheme: "gdlookup" +Debug: 05-18 21:23:56 host: "localhost" +Debug: 05-18 21:23:56 clear current dictionaries: "inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; }" +Debug: 05-18 21:23:56 some body finished +Debug: 05-18 21:23:56 one not finished. +Debug: 05-18 21:23:56 ====reading 4768 of (4768) bytes . Finished: 0 +Debug: 05-18 21:23:56 ====reading 0 of (4768) bytes . Finished: 0 +Debug: 05-18 21:23:56 ====reading 0 of (4768) bytes . Finished: 0 +Warning: 05-18 21:23:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:24:01 translating from clipboard or selection +Debug: 05-18 21:24:01 clipboard data: "void log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n" +Debug: 05-18 21:24:01 Current state: true false true true +Debug: 05-18 21:24:01 getResource: "gdlookup://localhost/?word=void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:24:01 scheme: "gdlookup" +Debug: 05-18 21:24:01 host: "localhost" +Debug: 05-18 21:24:01 clear current dictionaries: "void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); }" +Debug: 05-18 21:24:01 some body finished +Debug: 05-18 21:24:01 one not finished. +Debug: 05-18 21:24:01 ====reading 1804 of (1804) bytes . Finished: 0 +Debug: 05-18 21:24:01 ====reading 0 of (1804) bytes . Finished: 0 +Debug: 05-18 21:24:01 ====reading 0 of (1804) bytes . Finished: 0 +Warning: 05-18 21:24:01 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:24:06 translating from clipboard or selection +Debug: 05-18 21:24:06 clipboard data: "void log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n" +Debug: 05-18 21:24:06 Current state: true false true true +Debug: 05-18 21:24:06 getResource: "gdlookup://localhost/?word=void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:24:06 scheme: "gdlookup" +Debug: 05-18 21:24:06 host: "localhost" +Debug: 05-18 21:24:06 clear current dictionaries: "void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); }" +Debug: 05-18 21:24:06 some body finished +Debug: 05-18 21:24:06 one not finished. +Debug: 05-18 21:24:06 ====reading 1804 of (1804) bytes . Finished: 0 +Debug: 05-18 21:24:06 ====reading 0 of (1804) bytes . Finished: 0 +Debug: 05-18 21:24:06 ====reading 0 of (1804) bytes . Finished: 0 +Warning: 05-18 21:24:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:24:15 translating from clipboard or selection +Debug: 05-18 21:24:15 clipboard data: "mp/Hakurei $ g++ src/main.cc -o hakurei\nsrc/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’:\nsrc/main.cc:110:5: error: ‘log_internal’ was not declared in this scope\n 110 | log_internal(\"HTML output is being called\");\n | ^~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 21:24:15 Current state: true false true true +Debug: 05-18 21:24:15 getResource: "gdlookup://localhost/?word=mp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘void wrap_html_output(const std::vector%3Cstd::__cxx11::basic_string%3Cchar%3E %3E%26, const std::map%3Cstd::__cxx11::basic_string%3Cchar%3E, std::set%3Cstd::__cxx11::basic_string%3Cchar%3E %3E %3E%26, std::string%26)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 %7C log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); %7C %5E~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:24:15 scheme: "gdlookup" +Debug: 05-18 21:24:15 host: "localhost" +Debug: 05-18 21:24:15 clear current dictionaries: "mp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 | log_internal(\"HTML output is being called\"); | ^~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 21:24:15 some body finished +Debug: 05-18 21:24:15 one not finished. +Debug: 05-18 21:24:15 ====reading 1933 of (1933) bytes . Finished: 0 +Debug: 05-18 21:24:15 ====reading 0 of (1933) bytes . Finished: 0 +Debug: 05-18 21:24:15 ====reading 0 of (1933) bytes . Finished: 0 +Warning: 05-18 21:24:15 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:24:16 translating from clipboard or selection +Debug: 05-18 21:24:16 clipboard data: "src/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’:\nsrc/main.cc:110:5: error: ‘log_internal’ was not declared in this scope\n 110 | log_internal(\"HTML output is being called\");\n | ^~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 21:24:16 Current state: true false true true +Debug: 05-18 21:24:16 getResource: "gdlookup://localhost/?word=src/main.cc: In function ‘void wrap_html_output(const std::vector%3Cstd::__cxx11::basic_string%3Cchar%3E %3E%26, const std::map%3Cstd::__cxx11::basic_string%3Cchar%3E, std::set%3Cstd::__cxx11::basic_string%3Cchar%3E %3E %3E%26, std::string%26)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 %7C log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); %7C %5E~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:24:16 scheme: "gdlookup" +Debug: 05-18 21:24:16 host: "localhost" +Debug: 05-18 21:24:16 clear current dictionaries: "src/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 | log_internal(\"HTML output is being called\"); | ^~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 21:24:16 some body finished +Debug: 05-18 21:24:16 one not finished. +Debug: 05-18 21:24:16 ====reading 1893 of (1893) bytes . Finished: 0 +Debug: 05-18 21:24:16 ====reading 0 of (1893) bytes . Finished: 0 +Debug: 05-18 21:24:16 ====reading 0 of (1893) bytes . Finished: 0 +Warning: 05-18 21:24:16 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:24:17 translating from clipboard or selection +Debug: 05-18 21:24:17 clipboard data: "/tmp/Hakurei $ g++ src/main.cc -o hakurei\nsrc/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’:\nsrc/main.cc:110:5: error: ‘log_internal’ was not declared in this scope\n 110 | log_internal(\"HTML output is being called\");\n | ^~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 21:24:17 Current state: true false true true +Debug: 05-18 21:24:17 getResource: "gdlookup://localhost/?word=/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘void wrap_html_output(const std::vector%3Cstd::__cxx11::basic_string%3Cchar%3E %3E%26, const std::map%3Cstd::__cxx11::basic_string%3Cchar%3E, std::set%3Cstd::__cxx11::basic_string%3Cchar%3E %3E %3E%26, std::string%26)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 %7C log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); %7C %5E~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:24:17 scheme: "gdlookup" +Debug: 05-18 21:24:17 host: "localhost" +Debug: 05-18 21:24:17 clear current dictionaries: "/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 | log_internal(\"HTML output is being called\"); | ^~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 21:24:17 some body finished +Debug: 05-18 21:24:17 one not finished. +Debug: 05-18 21:24:17 ====reading 1935 of (1935) bytes . Finished: 0 +Debug: 05-18 21:24:17 ====reading 0 of (1935) bytes . Finished: 0 +Debug: 05-18 21:24:17 ====reading 0 of (1935) bytes . Finished: 0 +Warning: 05-18 21:24:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:24:18 translating from clipboard or selection +Debug: 05-18 21:24:18 clipboard data: "/tmp/Hakurei $ g++ src/main.cc -o hakurei\nsrc/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’:\nsrc/main.cc:110:5: error: ‘log_internal’ was not declared in this scope\n 110 | log_internal(\"HTML output is being called\");\n | ^~~~~~~~~~~~\n/tmp/Hakurei $ " +Debug: 05-18 21:24:18 Current state: true false true true +Debug: 05-18 21:24:18 getResource: "gdlookup://localhost/?word=/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘void wrap_html_output(const std::vector%3Cstd::__cxx11::basic_string%3Cchar%3E %3E%26, const std::map%3Cstd::__cxx11::basic_string%3Cchar%3E, std::set%3Cstd::__cxx11::basic_string%3Cchar%3E %3E %3E%26, std::string%26)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 %7C log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); %7C %5E~~~~~~~~~~~ /tmp/Hakurei $&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:24:18 scheme: "gdlookup" +Debug: 05-18 21:24:18 host: "localhost" +Debug: 05-18 21:24:18 clear current dictionaries: "/tmp/Hakurei $ g++ src/main.cc -o hakurei src/main.cc: In function ‘void wrap_html_output(const std::vector >&, const std::map, std::set > >&, std::string&)’: src/main.cc:110:5: error: ‘log_internal’ was not declared in this scope 110 | log_internal(\"HTML output is being called\"); | ^~~~~~~~~~~~ /tmp/Hakurei $" +Debug: 05-18 21:24:18 some body finished +Debug: 05-18 21:24:18 one not finished. +Debug: 05-18 21:24:18 ====reading 1935 of (1935) bytes . Finished: 0 +Debug: 05-18 21:24:18 ====reading 0 of (1935) bytes . Finished: 0 +Debug: 05-18 21:24:18 ====reading 0 of (1935) bytes . Finished: 0 +Warning: 05-18 21:24:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:27:08 translating from clipboard or selection +Debug: 05-18 21:27:08 clipboard data: "jaremos598@huleos.com" +Debug: 05-18 21:27:08 Current state: true false true true +Debug: 05-18 21:27:08 getResource: "gdlookup://localhost/?word=jaremos598@huleos.com&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:27:08 scheme: "gdlookup" +Debug: 05-18 21:27:08 host: "localhost" +Debug: 05-18 21:27:08 clear current dictionaries: "jaremos598@huleos.com" +Debug: 05-18 21:27:08 some body finished +Debug: 05-18 21:27:08 one not finished. +Debug: 05-18 21:27:08 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 21:27:08 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 21:27:08 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 21:27:08 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:27:53 translating from clipboard or selection +Debug: 05-18 21:27:53 clipboard data: "tudo" +Debug: 05-18 21:27:53 Current state: true false true true +Debug: 05-18 21:27:53 getResource: "gdlookup://localhost/?word=tudo&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:27:53 scheme: "gdlookup" +Debug: 05-18 21:27:53 host: "localhost" +Debug: 05-18 21:27:53 clear current dictionaries: "tudo" +Debug: 05-18 21:27:53 some body finished +Debug: 05-18 21:27:53 one not finished. +Debug: 05-18 21:27:53 ====reading 1407 of (1407) bytes . Finished: 0 +Debug: 05-18 21:27:53 ====reading 0 of (1407) bytes . Finished: 0 +Debug: 05-18 21:27:53 ====reading 0 of (1407) bytes . Finished: 0 +Warning: 05-18 21:27:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:29:11 translating from clipboard or selection +Debug: 05-18 21:29:11 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:29:11 Current state: true false true true +Debug: 05-18 21:29:11 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:29:11 scheme: "gdlookup" +Debug: 05-18 21:29:11 host: "localhost" +Debug: 05-18 21:29:11 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:29:11 some body finished +Debug: 05-18 21:29:11 one not finished. +Debug: 05-18 21:29:11 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 21:29:11 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 21:29:11 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 21:29:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:29:11 translating from clipboard or selection +Debug: 05-18 21:29:11 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:29:11 Current state: true false true true +Debug: 05-18 21:29:11 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:29:11 scheme: "gdlookup" +Debug: 05-18 21:29:11 host: "localhost" +Debug: 05-18 21:29:11 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:29:11 some body finished +Debug: 05-18 21:29:11 one not finished. +Debug: 05-18 21:29:11 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 21:29:11 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 21:29:11 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 21:29:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:29:11 translating from clipboard or selection +Debug: 05-18 21:29:11 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:29:11 Current state: true false true true +Debug: 05-18 21:29:11 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:29:11 scheme: "gdlookup" +Debug: 05-18 21:29:11 host: "localhost" +Debug: 05-18 21:29:11 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:29:11 some body finished +Debug: 05-18 21:29:11 one not finished. +Debug: 05-18 21:29:11 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 21:29:11 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 21:29:11 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 21:29:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:39:51 translating from clipboard or selection +Debug: 05-18 21:39:51 clipboard data: "void log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n" +Debug: 05-18 21:39:51 Current state: true false true true +Debug: 05-18 21:39:51 getResource: "gdlookup://localhost/?word=void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:39:51 scheme: "gdlookup" +Debug: 05-18 21:39:51 host: "localhost" +Debug: 05-18 21:39:51 clear current dictionaries: "void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); }" +Debug: 05-18 21:39:51 some body finished +Debug: 05-18 21:39:51 one not finished. +Debug: 05-18 21:39:51 ====reading 1804 of (1804) bytes . Finished: 0 +Debug: 05-18 21:39:51 ====reading 0 of (1804) bytes . Finished: 0 +Debug: 05-18 21:39:51 ====reading 0 of (1804) bytes . Finished: 0 +Warning: 05-18 21:39:51 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:39:51 translating from clipboard or selection +Debug: 05-18 21:39:52 clipboard data: "void log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n" +Debug: 05-18 21:39:52 Current state: true false true true +Debug: 05-18 21:39:52 getResource: "gdlookup://localhost/?word=void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:39:52 scheme: "gdlookup" +Debug: 05-18 21:39:52 host: "localhost" +Debug: 05-18 21:39:52 clear current dictionaries: "void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); }" +Debug: 05-18 21:39:52 some body finished +Debug: 05-18 21:39:52 one not finished. +Debug: 05-18 21:39:52 ====reading 1804 of (1804) bytes . Finished: 0 +Debug: 05-18 21:39:52 ====reading 0 of (1804) bytes . Finished: 0 +Debug: 05-18 21:39:52 ====reading 0 of (1804) bytes . Finished: 0 +Warning: 05-18 21:39:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:39:52 translating from clipboard or selection +Debug: 05-18 21:39:52 clipboard data: "void log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n" +Debug: 05-18 21:39:52 Current state: true false true true +Debug: 05-18 21:39:52 getResource: "gdlookup://localhost/?word=void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:39:52 scheme: "gdlookup" +Debug: 05-18 21:39:52 host: "localhost" +Debug: 05-18 21:39:52 clear current dictionaries: "void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); }" +Debug: 05-18 21:39:52 some body finished +Debug: 05-18 21:39:52 one not finished. +Debug: 05-18 21:39:52 ====reading 1804 of (1804) bytes . Finished: 0 +Debug: 05-18 21:39:52 ====reading 0 of (1804) bytes . Finished: 0 +Debug: 05-18 21:39:52 ====reading 0 of (1804) bytes . Finished: 0 +Warning: 05-18 21:39:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:40:07 translating from clipboard or selection +Debug: 05-18 21:40:07 clipboard data: "void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n" +Debug: 05-18 21:40:07 Current state: true false true true +Debug: 05-18 21:40:07 getResource: "gdlookup://localhost/?word=void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:40:07 scheme: "gdlookup" +Debug: 05-18 21:40:07 host: "localhost" +Debug: 05-18 21:40:07 clear current dictionaries: "void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); }" +Debug: 05-18 21:40:07 some body finished +Debug: 05-18 21:40:07 one not finished. +Debug: 05-18 21:40:07 ====reading 2523 of (2523) bytes . Finished: 0 +Debug: 05-18 21:40:07 ====reading 0 of (2523) bytes . Finished: 0 +Debug: 05-18 21:40:07 ====reading 0 of (2523) bytes . Finished: 0 +Warning: 05-18 21:40:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:40:07 translating from clipboard or selection +Debug: 05-18 21:40:07 clipboard data: "void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n" +Debug: 05-18 21:40:07 Current state: true false true true +Debug: 05-18 21:40:07 getResource: "gdlookup://localhost/?word=void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:40:07 scheme: "gdlookup" +Debug: 05-18 21:40:07 host: "localhost" +Debug: 05-18 21:40:07 clear current dictionaries: "void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); }" +Debug: 05-18 21:40:07 some body finished +Debug: 05-18 21:40:07 one not finished. +Debug: 05-18 21:40:07 ====reading 2523 of (2523) bytes . Finished: 0 +Debug: 05-18 21:40:07 ====reading 0 of (2523) bytes . Finished: 0 +Debug: 05-18 21:40:07 ====reading 0 of (2523) bytes . Finished: 0 +Warning: 05-18 21:40:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:40:26 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:40:26 scheme: "gdlookup" +Debug: 05-18 21:40:26 host: "localhost" +Debug: 05-18 21:40:26 clear current dictionaries: "ゆっくり" +Debug: 05-18 21:40:26 some body finished +Debug: 05-18 21:40:26 one not finished. +Debug: 05-18 21:40:26 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 21:40:26 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 21:40:26 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 21:40:26 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:41:37 translating from clipboard or selection +Debug: 05-18 21:41:37 clipboard data: "\n // Print debug information if in debug mode\n if (debug\n" +Debug: 05-18 21:41:37 Current state: true true false true +Debug: 05-18 21:41:37 getResource: "gdlookup://localhost/?word=// Print debug information if in debug mode if (debug&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:41:37 scheme: "gdlookup" +Debug: 05-18 21:41:37 host: "localhost" +Debug: 05-18 21:41:37 clear current dictionaries: "// Print debug information if in debug mode if (debug" +Debug: 05-18 21:41:37 some body finished +Debug: 05-18 21:41:37 one not finished. +Debug: 05-18 21:41:37 ====reading 1456 of (1456) bytes . Finished: 0 +Debug: 05-18 21:41:37 ====reading 0 of (1456) bytes . Finished: 0 +Debug: 05-18 21:41:37 ====reading 0 of (1456) bytes . Finished: 0 +Debug: 05-18 21:41:37 some body finished +Debug: 05-18 21:41:37 one finished. +Debug: 05-18 21:41:37 erasing.. +Debug: 05-18 21:41:37 erase done.. +Debug: 05-18 21:41:37 send dicts(finished): "groupId:1,word:// Print debug information if in debug mode if (debug,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:41:37 ====reading 1292 of (2748) bytes . Finished: 1 +Debug: 05-18 21:41:37 receive dicts, current word: "// Print debug information if in debug mode if (debug" "// Print debug information if in debug mode if (debug" : QList("9dfe38c28e4eb0d417245e761da52517") +Warning: 05-18 21:41:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:41:37 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:41:37 scheme: "gico" +Debug: 05-18 21:41:37 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:41:37 article view loaded url: "gdlookup://localhost/?word=// Print debug information if in debug mode if (debug&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f4" true +Debug: 05-18 21:42:07 translating from clipboard or selection +Debug: 05-18 21:42:07 clipboard data: "how to delete the last commit " +Debug: 05-18 21:42:07 Current state: true false false true +Debug: 05-18 21:42:07 getResource: "gdlookup://localhost/?word=how to delete the last commit&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:42:07 scheme: "gdlookup" +Debug: 05-18 21:42:07 host: "localhost" +Debug: 05-18 21:42:07 clear current dictionaries: "how to delete the last commit" +Debug: 05-18 21:42:07 some body finished +Debug: 05-18 21:42:07 one not finished. +Debug: 05-18 21:42:07 ====reading 1432 of (1432) bytes . Finished: 0 +Debug: 05-18 21:42:07 ====reading 0 of (1432) bytes . Finished: 0 +Debug: 05-18 21:42:07 ====reading 0 of (1432) bytes . Finished: 0 +Debug: 05-18 21:42:07 some body finished +Debug: 05-18 21:42:07 one finished. +Debug: 05-18 21:42:07 erasing.. +Debug: 05-18 21:42:07 erase done.. +Debug: 05-18 21:42:07 send dicts(finished): "groupId:1,word:how to delete the last commit,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:42:07 receive dicts, current word: "how to delete the last commit" "how to delete the last commit" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:42:07 ====reading 1292 of (2724) bytes . Finished: 1 +Debug: 05-18 21:42:07 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:42:07 scheme: "gico" +Debug: 05-18 21:42:07 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:42:07 article view loaded url: "gdlookup://localhost/?word=how to delete the last commit&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae276920" true +Debug: 05-18 21:42:41 translating from clipboard or selection +Debug: 05-18 21:42:41 clipboard data: "git reset --hard HEAD~1\n" +Debug: 05-18 21:42:41 Current state: true false true true +Debug: 05-18 21:42:41 getResource: "gdlookup://localhost/?word=git reset --hard HEAD~1&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:42:41 scheme: "gdlookup" +Debug: 05-18 21:42:41 host: "localhost" +Debug: 05-18 21:42:41 clear current dictionaries: "git reset --hard HEAD~1" +Debug: 05-18 21:42:41 some body finished +Debug: 05-18 21:42:41 one not finished. +Debug: 05-18 21:42:41 ====reading 1426 of (1426) bytes . Finished: 0 +Debug: 05-18 21:42:41 ====reading 0 of (1426) bytes . Finished: 0 +Debug: 05-18 21:42:41 ====reading 0 of (1426) bytes . Finished: 0 +Debug: 05-18 21:42:41 some body finished +Debug: 05-18 21:42:41 one finished. +Debug: 05-18 21:42:41 erasing.. +Debug: 05-18 21:42:41 erase done.. +Debug: 05-18 21:42:41 send dicts(finished): "groupId:1,word:git reset --hard HEAD~1,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:42:41 ====reading 1292 of (2718) bytes . Finished: 1 +Debug: 05-18 21:42:41 receive dicts, current word: "git reset --hard HEAD~1" "git reset --hard HEAD~1" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:42:41 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:42:41 scheme: "gico" +Debug: 05-18 21:42:41 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:42:41 article view loaded url: "gdlookup://localhost/?word=git reset --hard HEAD~1&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6da" true +Debug: 05-18 21:44:45 translating from clipboard or selection +Debug: 05-18 21:44:45 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:44:45 Current state: true false true true +Debug: 05-18 21:44:45 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:44:45 scheme: "gdlookup" +Debug: 05-18 21:44:45 host: "localhost" +Debug: 05-18 21:44:45 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:44:45 some body finished +Debug: 05-18 21:44:45 one not finished. +Debug: 05-18 21:44:45 some body finished +Debug: 05-18 21:44:45 one finished. +Debug: 05-18 21:44:45 erasing.. +Debug: 05-18 21:44:45 erase done.. +Debug: 05-18 21:44:45 send dicts(finished): "groupId:1,word:#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; },dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:44:45 ====reading 14786 of (14786) bytes . Finished: 1 +Debug: 05-18 21:44:45 receive dicts, current word: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:44:45 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:44:45 scheme: "gico" +Debug: 05-18 21:44:45 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:44:45 article view loaded url: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp" true +Debug: 05-18 21:44:46 translating from clipboard or selection +Debug: 05-18 21:44:46 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:44:46 Current state: true false true true +Debug: 05-18 21:44:46 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:44:46 scheme: "gdlookup" +Debug: 05-18 21:44:46 host: "localhost" +Debug: 05-18 21:44:46 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:44:46 some body finished +Debug: 05-18 21:44:46 one not finished. +Debug: 05-18 21:44:46 some body finished +Debug: 05-18 21:44:46 one finished. +Debug: 05-18 21:44:46 erasing.. +Debug: 05-18 21:44:46 erase done.. +Debug: 05-18 21:44:46 send dicts(finished): "groupId:1,word:#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; },dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:44:46 ====reading 14786 of (14786) bytes . Finished: 1 +Debug: 05-18 21:44:46 receive dicts, current word: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:44:46 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:44:46 scheme: "gico" +Debug: 05-18 21:44:46 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:44:46 article view loaded url: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp" true +Debug: 05-18 21:44:46 translating from clipboard or selection +Debug: 05-18 21:44:46 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:44:46 Current state: true false true true +Debug: 05-18 21:44:46 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:44:46 scheme: "gdlookup" +Debug: 05-18 21:44:46 host: "localhost" +Debug: 05-18 21:44:46 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:44:46 some body finished +Debug: 05-18 21:44:46 one not finished. +Debug: 05-18 21:44:46 some body finished +Debug: 05-18 21:44:46 one finished. +Debug: 05-18 21:44:46 erasing.. +Debug: 05-18 21:44:46 erase done.. +Debug: 05-18 21:44:46 send dicts(finished): "groupId:1,word:#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; },dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:44:46 ====reading 14786 of (14786) bytes . Finished: 1 +Debug: 05-18 21:44:46 receive dicts, current word: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:44:46 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:44:46 scheme: "gico" +Debug: 05-18 21:44:46 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:44:46 article view loaded url: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp" true +Debug: 05-18 21:45:15 translating from clipboard or selection +Debug: 05-18 21:45:15 clipboard data: "" +Debug: 05-18 21:45:34 translating from clipboard or selection +Debug: 05-18 21:45:34 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 21:45:34 Current state: true false true true +Debug: 05-18 21:45:34 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:45:34 scheme: "gdlookup" +Debug: 05-18 21:45:34 host: "localhost" +Debug: 05-18 21:45:34 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:45:34 some body finished +Debug: 05-18 21:45:34 one not finished. +Debug: 05-18 21:45:34 some body finished +Debug: 05-18 21:45:34 one finished. +Debug: 05-18 21:45:34 erasing.. +Debug: 05-18 21:45:34 erase done.. +Debug: 05-18 21:45:34 send dicts(finished): "groupId:1,word:#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; },dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:45:34 ====reading 14786 of (14786) bytes . Finished: 1 +Debug: 05-18 21:45:34 receive dicts, current word: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:45:34 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:45:34 scheme: "gico" +Debug: 05-18 21:45:34 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:45:34 article view loaded url: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp" true +Debug: 05-18 21:45:38 translating from clipboard or selection +Debug: 05-18 21:45:38 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
\";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
\"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
\" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
  • \" + alt + \"
  • \";\n }\n output_html += \"
\";\n }\n\n output_html += \"
\"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
\" + removed_char + \"
\";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
\"; \n output_html += \"
\";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}" +Debug: 05-18 21:45:38 Current state: true false true true +Debug: 05-18 21:45:38 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:45:38 scheme: "gdlookup" +Debug: 05-18 21:45:38 host: "localhost" +Debug: 05-18 21:45:38 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 21:45:38 some body finished +Debug: 05-18 21:45:38 one not finished. +Debug: 05-18 21:45:38 some body finished +Debug: 05-18 21:45:38 one finished. +Debug: 05-18 21:45:38 erasing.. +Debug: 05-18 21:45:38 erase done.. +Debug: 05-18 21:45:38 send dicts(finished): "groupId:1,word:#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; },dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:45:38 ====reading 14786 of (14786) bytes . Finished: 1 +Debug: 05-18 21:45:38 receive dicts, current word: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
\"; std::string sentence_copy = sentence; output_html += \"
\"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
\" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
    \"; for (const auto& alt : alt_itr->second) { output_html += \"
  • \" + alt + \"
  • \"; } output_html += \"
\"; } output_html += \"
\"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
\" + removed_char + \"
\"; sentence_copy = new_sentence_copy; } } output_html += \"
\"; output_html += \"
\"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:45:38 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:45:38 scheme: "gico" +Debug: 05-18 21:45:38 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:45:38 article view loaded url: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp" true +Debug: 05-18 21:46:36 translating from clipboard or selection +Debug: 05-18 21:46:36 clipboard data: "" +Debug: 05-18 21:46:43 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:46:43 scheme: "gdlookup" +Debug: 05-18 21:46:43 host: "localhost" +Debug: 05-18 21:46:43 clear current dictionaries: "違和感" +Debug: 05-18 21:46:43 some body finished +Debug: 05-18 21:46:43 one not finished. +Debug: 05-18 21:46:43 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 21:46:43 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 21:46:43 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 21:46:43 some body finished +Debug: 05-18 21:46:43 one finished. +Debug: 05-18 21:46:43 erasing.. +Debug: 05-18 21:46:43 erase done.. +Debug: 05-18 21:46:43 send dicts(finished): "groupId:1,word:違和感,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:43 receive dicts, current word: "違和感" "違和感" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:46:43 ====reading 1292 of (2704) bytes . Finished: 1 +Debug: 05-18 21:46:43 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:46:43 scheme: "gico" +Debug: 05-18 21:46:43 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:43 article view loaded url: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96631" true +Debug: 05-18 21:46:44 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:46:44 scheme: "gdlookup" +Debug: 05-18 21:46:44 host: "localhost" +Debug: 05-18 21:46:44 clear current dictionaries: "ゆっくり" +Debug: 05-18 21:46:44 some body finished +Debug: 05-18 21:46:44 one not finished. +Debug: 05-18 21:46:44 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 21:46:44 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 21:46:44 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 21:46:44 some body finished +Debug: 05-18 21:46:44 one finished. +Debug: 05-18 21:46:44 erasing.. +Debug: 05-18 21:46:44 erase done.. +Debug: 05-18 21:46:44 send dicts(finished): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:44 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:46:44 ====reading 1292 of (2707) bytes . Finished: 1 +Debug: 05-18 21:46:44 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:46:44 scheme: "gico" +Debug: 05-18 21:46:44 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:44 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b9663" true +Debug: 05-18 21:46:45 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:46:45 scheme: "gdlookup" +Debug: 05-18 21:46:45 host: "localhost" +Debug: 05-18 21:46:45 clear current dictionaries: "議" +Debug: 05-18 21:46:45 some body finished +Debug: 05-18 21:46:45 one not finished. +Debug: 05-18 21:46:45 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 21:46:45 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 21:46:45 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 21:46:45 some body finished +Debug: 05-18 21:46:45 one finished. +Debug: 05-18 21:46:45 erasing.. +Debug: 05-18 21:46:45 erase done.. +Debug: 05-18 21:46:45 send dicts(finished): "groupId:1,word:議,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:45 receive dicts, current word: "議" "議" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:46:45 ====reading 1292 of (2698) bytes . Finished: 1 +Debug: 05-18 21:46:45 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:46:45 scheme: "gico" +Debug: 05-18 21:46:45 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:45 article view loaded url: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a" true +Debug: 05-18 21:46:46 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:46:46 scheme: "gdlookup" +Debug: 05-18 21:46:46 host: "localhost" +Debug: 05-18 21:46:46 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 21:46:46 some body finished +Debug: 05-18 21:46:46 one not finished. +Debug: 05-18 21:46:46 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 21:46:46 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 21:46:46 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 21:46:46 some body finished +Debug: 05-18 21:46:46 one finished. +Debug: 05-18 21:46:46 erasing.. +Debug: 05-18 21:46:46 erase done.. +Debug: 05-18 21:46:46 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:46 ====reading 1292 of (2713) bytes . Finished: 1 +Debug: 05-18 21:46:46 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:46:46 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:46:46 scheme: "gico" +Debug: 05-18 21:46:46 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:46:46 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 21:52:47 translating from clipboard or selection +Debug: 05-18 21:52:47 clipboard data: "diff --git a/hakurei.cpp b/hakurei.cpp\nindex 1234567..89abcde 100644\n--- a/hakurei.cpp\n+++ b/hakurei.cpp\n@@ -1,6 +1,7 @@\n #include \n #include \n #include \n+#include \n #include \n #include \n #include \n@@ -9,6 +10,7 @@\n #include \n #include \n #include \n+#include \n #include \n \n struct Entry {\n@@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n+ log_internal(\"Received search string from stdin: \" + search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n@@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n search_string = argv[i + 1];\n break;\n }\n+ log_internal(\"Received search string from command line in goldendict mode: \" + search_string);\n }\n } else {\n if (argc < 2) {\n@@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n+ log_internal(\"Parsing command line arguments\");\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n@@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n+ log_internal(\"Search string not provided\");\n exit(1);\n }\n return search_string;\n@@ -131,12 +138,18 @@ inline void wrap_html_output(\n output_html += \"
\";\n \n std::string sentence_copy = sentence;\n+ log_internal(\"HTML output is being called\");\n \n output_html += \"
\"; \n \n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n+ log_internal(\"Processing substring: \" + substring);\n if (sentence_copy.rfind(substring, 0) == 0) {\n+ log_internal(\"Found substring match: \" + substring);\n output_html += \"
\" + substring + \"\";\n \n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
    \";\n@@ -179,6 +192,8 @@ inline void wrap_html_output(\n found = true;\n break;\n }\n+ log_internal(\"No match found for substring: \" + substring);\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n+ log_internal(\"Removed one UTF-8 character: \" + removed_char);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\");\n@@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string& search_strin\n }\n \n void log_internal(const std::string& message) {\n+ log_internal(\"Logging message: \" + message);\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n@@ -283,6 +299,17 @@ void log_internal(const std::string& message) {\n }\n \n std::string get_current_time() {\n+ std::time_t now = std::time(nullptr);\n+ char buf[80];\n+ std::strftime(buf, sizeof(buf), \"%Y-%m-%d %H:%M:%S\", std::localtime(&now));\n+ return std::string(buf);\n+}\n+\n+int main(const int argc, char* argv[]) {\n+ bool debug_mode = false;\n+ bool goldendict_mode = false;\n+ std::string word, sentence;\n+ std::string dict_file = find_dic_file().string(); // Default dictionary file path\n \n log_internal(\"Program started at \" + get_current_time());\n \n@@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) {\n \n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string + \" at \" + get_current_time());\n+ log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string + \" at \" + get_current_time());\n@@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) {\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n+ log_internal(\"Current search string: \" + search_string);\n auto itr = trie.make_prefix_iterator(search_string);\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()) + \" at \" + get_current_time());\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n@@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) {\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring + \" at \" + get_current_time());\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n \n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char + \" at \" + get_current_time());\n \n@@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at \" + get_current_time());\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string + \" at \" + get_current_time());\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n@@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) {\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n \n log_internal(\"Program finished at \" + get_current_time());\n return 0;\n }\n" +Debug: 05-18 21:52:47 Current state: true true false true +Debug: 05-18 21:52:47 getResource: "gdlookup://localhost/?word=diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E +%23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E @@ -9,6 +10,7 @@ %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E +%23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B @@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); + log_internal(%22Received search string from stdin: %22 + search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B @@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold search_string %3D argv[i + 1]; break; %7D + log_internal(%22Received search string from command line in goldendict mode: %22 + search_string); %7D %7D else %7B if (argc %3C 2) %7B @@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B + log_internal(%22Parsing command line arguments%22); if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B @@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; + log_internal(%22Search string not provided%22); exit(1); %7D return search_string; @@ -131,12 +138,18 @@ inline void wrap_html_output( output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; + log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B + log_internal(%22Processing substring: %22 + substring); if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B + log_internal(%22Found substring match: %22 + substring); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; @@ -179,6 +192,8 @@ inline void wrap_html_output( found %3D true; break; %7D + log_internal(%22No match found for substring: %22 + substring); %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); + log_internal(%22Removed one UTF-8 character: %22 + removed_char); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22); @@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string%26 search_strin %7D void log_internal(const std::string%26 message) %7B + log_internal(%22Logging message: %22 + message); std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B @@ -283,6 +299,17 @@ void log_internal(const std::string%26 message) %7B %7D std::string get_current_time() %7B + std::time_t now %3D std::time(nullptr); + char buf[80]; + std::strftime(buf, sizeof(buf), %22%25Y-%25m-%25d %25H:%25M:%25S%22, std::localtime(%26now)); + return std::string(buf); +%7D + +int main(const int argc, char* argv[]) %7B + bool debug_mode %3D false; + bool goldendict_mode %3D false; + std::string word, sentence; + std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started at %22 + get_current_time()); @@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) %7B std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string + %22 at %22 + get_current_time()); + log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string + %22 at %22 + get_current_time()); @@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) %7B std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B + log_internal(%22Current search string: %22 + search_string); auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view()) + %22 at %22 + get_current_time()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); @@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) %7B alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring + %22 at %22 + get_current_time()); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char + %22 at %22 + get_current_time()); @@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at %22 + get_current_time()); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string + %22 at %22 + get_current_time()); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); @@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) %7B // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished at %22 + get_current_time()); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:52:47 scheme: "gdlookup" +Debug: 05-18 21:52:47 host: "localhost" +Debug: 05-18 21:52:47 clear current dictionaries: "diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include struct Entry { @@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); + log_internal(\"Received search string from stdin: \" + search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { @@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold search_string = argv[i + 1]; break; } + log_internal(\"Received search string from command line in goldendict mode: \" + search_string); } } else { if (argc < 2) { @@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold exit(1); } for (int i = 1; i < argc; ++i) { + log_internal(\"Parsing command line arguments\"); if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { @@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; + log_internal(\"Search string not provided\"); exit(1); } return search_string; @@ -131,12 +138,18 @@ inline void wrap_html_output( output_html += \"
    \"; std::string sentence_copy = sentence; + log_internal(\"HTML output is being called\"); output_html += \"
    \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { + log_internal(\"Processing substring: \" + substring); if (sentence_copy.rfind(substring, 0) == 0) { + log_internal(\"Found substring match: \" + substring); output_html += \"
    \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
      \"; @@ -179,6 +192,8 @@ inline void wrap_html_output( found = true; break; } + log_internal(\"No match found for substring: \" + substring); } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); + log_internal(\"Removed one UTF-8 character: \" + removed_char); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\"); @@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string& search_strin } void log_internal(const std::string& message) { + log_internal(\"Logging message: \" + message); std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { @@ -283,6 +299,17 @@ void log_internal(const std::string& message) { } std::string get_current_time() { + std::time_t now = std::time(nullptr); + char buf[80]; + std::strftime(buf, sizeof(buf), \"%Y-%m-%d %H:%M:%S\", std::localtime(&now)); + return std::string(buf); +} + +int main(const int argc, char* argv[]) { + bool debug_mode = false; + bool goldendict_mode = false; + std::string word, sentence; + std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started at \" + get_current_time()); @@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) { std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string + \" at \" + get_current_time()); + log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string + \" at \" + get_current_time()); @@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) { std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { + log_internal(\"Current search string: \" + search_string); auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view()) + \" at \" + get_current_time()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); @@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) { alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring + \" at \" + get_current_time()); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char + \" at \" + get_current_time()); @@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at \" + get_current_time()); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string + \" at \" + get_current_time()); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); @@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) { // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished at \" + get_current_time()); return 0; }" +Debug: 05-18 21:52:47 some body finished +Debug: 05-18 21:52:47 one not finished. +Debug: 05-18 21:52:47 some body finished +Debug: 05-18 21:52:47 one finished. +Debug: 05-18 21:52:47 erasing.. +Debug: 05-18 21:52:47 erase done.. +Debug: 05-18 21:52:47 send dicts(finished): "groupId:1,word:diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include struct Entry { @@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); + log_internal(\"Received search string from stdin: \" + search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { @@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold search_string = argv[i + 1]; break; } + log_internal(\"Received search string from command line in goldendict mode: \" + search_string); } } else { if (argc < 2) { @@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold exit(1); } for (int i = 1; i < argc; ++i) { + log_internal(\"Parsing command line arguments\"); if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { @@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; + log_internal(\"Search string not provided\"); exit(1); } return search_string; @@ -131,12 +138,18 @@ inline void wrap_html_output( output_html += \"
      \"; std::string sentence_copy = sentence; + log_internal(\"HTML output is being called\"); output_html += \"
      \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { + log_internal(\"Processing substring: \" + substring); if (sentence_copy.rfind(substring, 0) == 0) { + log_internal(\"Found substring match: \" + substring); output_html += \"
      \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
        \"; @@ -179,6 +192,8 @@ inline void wrap_html_output( found = true; break; } + log_internal(\"No match found for substring: \" + substring); } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); + log_internal(\"Removed one UTF-8 character: \" + removed_char); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\"); @@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string& search_strin } void log_internal(const std::string& message) { + log_internal(\"Logging message: \" + message); std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { @@ -283,6 +299,17 @@ void log_internal(const std::string& message) { } std::string get_current_time() { + std::time_t now = std::time(nullptr); + char buf[80]; + std::strftime(buf, sizeof(buf), \"%Y-%m-%d %H:%M:%S\", std::localtime(&now)); + return std::string(buf); +} + +int main(const int argc, char* argv[]) { + bool debug_mode = false; + bool goldendict_mode = false; + std::string word, sentence; + std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started at \" + get_current_time()); @@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) { std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string + \" at \" + get_current_time()); + log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string + \" at \" + get_current_time()); @@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) { std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { + log_internal(\"Current search string: \" + search_string); auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view()) + \" at \" + get_current_time()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); @@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) { alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring + \" at \" + get_current_time()); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char + \" at \" + get_current_time()); @@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at \" + get_current_time()); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string + \" at \" + get_current_time()); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); @@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) { // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished at \" + get_current_time()); return 0; },dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:52:47 receive dicts, current word: "diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include struct Entry { @@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); + log_internal(\"Received search string from stdin: \" + search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { @@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold search_string = argv[i + 1]; break; } + log_internal(\"Received search string from command line in goldendict mode: \" + search_string); } } else { if (argc < 2) { @@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold exit(1); } for (int i = 1; i < argc; ++i) { + log_internal(\"Parsing command line arguments\"); if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { @@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; + log_internal(\"Search string not provided\"); exit(1); } return search_string; @@ -131,12 +138,18 @@ inline void wrap_html_output( output_html += \"
        \"; std::string sentence_copy = sentence; + log_internal(\"HTML output is being called\"); output_html += \"
        \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { + log_internal(\"Processing substring: \" + substring); if (sentence_copy.rfind(substring, 0) == 0) { + log_internal(\"Found substring match: \" + substring); output_html += \"
        \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
          \"; @@ -179,6 +192,8 @@ inline void wrap_html_output( found = true; break; } + log_internal(\"No match found for substring: \" + substring); } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); + log_internal(\"Removed one UTF-8 character: \" + removed_char); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\"); @@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string& search_strin } void log_internal(const std::string& message) { + log_internal(\"Logging message: \" + message); std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { @@ -283,6 +299,17 @@ void log_internal(const std::string& message) { } std::string get_current_time() { + std::time_t now = std::time(nullptr); + char buf[80]; + std::strftime(buf, sizeof(buf), \"%Y-%m-%d %H:%M:%S\", std::localtime(&now)); + return std::string(buf); +} + +int main(const int argc, char* argv[]) { + bool debug_mode = false; + bool goldendict_mode = false; + std::string word, sentence; + std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started at \" + get_current_time()); @@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) { std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string + \" at \" + get_current_time()); + log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string + \" at \" + get_current_time()); @@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) { std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { + log_internal(\"Current search string: \" + search_string); auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view()) + \" at \" + get_current_time()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); @@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) { alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring + \" at \" + get_current_time()); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char + \" at \" + get_current_time()); @@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at \" + get_current_time()); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string + \" at \" + get_current_time()); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); @@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) { // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished at \" + get_current_time()); return 0; }" "diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include struct Entry { @@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); + log_internal(\"Received search string from stdin: \" + search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { @@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold search_string = argv[i + 1]; break; } + log_internal(\"Received search string from command line in goldendict mode: \" + search_string); } } else { if (argc < 2) { @@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold exit(1); } for (int i = 1; i < argc; ++i) { + log_internal(\"Parsing command line arguments\"); if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { @@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; + log_internal(\"Search string not provided\"); exit(1); } return search_string; @@ -131,12 +138,18 @@ inline void wrap_html_output( output_html += \"
          \"; std::string sentence_copy = sentence; + log_internal(\"HTML output is being called\"); output_html += \"
          \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { + log_internal(\"Processing substring: \" + substring); if (sentence_copy.rfind(substring, 0) == 0) { + log_internal(\"Found substring match: \" + substring); output_html += \"
          \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
            \"; @@ -179,6 +192,8 @@ inline void wrap_html_output( found = true; break; } + log_internal(\"No match found for substring: \" + substring); } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); + log_internal(\"Removed one UTF-8 character: \" + removed_char); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\"); @@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string& search_strin } void log_internal(const std::string& message) { + log_internal(\"Logging message: \" + message); std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { @@ -283,6 +299,17 @@ void log_internal(const std::string& message) { } std::string get_current_time() { + std::time_t now = std::time(nullptr); + char buf[80]; + std::strftime(buf, sizeof(buf), \"%Y-%m-%d %H:%M:%S\", std::localtime(&now)); + return std::string(buf); +} + +int main(const int argc, char* argv[]) { + bool debug_mode = false; + bool goldendict_mode = false; + std::string word, sentence; + std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started at \" + get_current_time()); @@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) { std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string + \" at \" + get_current_time()); + log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string + \" at \" + get_current_time()); @@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) { std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { + log_internal(\"Current search string: \" + search_string); auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view()) + \" at \" + get_current_time()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); @@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) { alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring + \" at \" + get_current_time()); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char + \" at \" + get_current_time()); @@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at \" + get_current_time()); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string + \" at \" + get_current_time()); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); @@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) { // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished at \" + get_current_time()); return 0; }" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:52:47 ====reading 9857 of (9857) bytes . Finished: 1 +Debug: 05-18 21:52:47 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:52:47 scheme: "gico" +Debug: 05-18 21:52:47 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:52:47 article view loaded url: "gdlookup://localhost/?word=diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ %23include %3Ciostream%3E %23include %3Cvector%3E %2" true +Debug: 05-18 21:53:28 translating from clipboard or selection +Debug: 05-18 21:53:28 clipboard data: "MOVE(*" +Debug: 05-18 21:53:28 Current state: true false false true +Debug: 05-18 21:53:28 getResource: "gdlookup://localhost/?word=MOVE(*&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:53:28 scheme: "gdlookup" +Debug: 05-18 21:53:28 host: "localhost" +Debug: 05-18 21:53:28 clear current dictionaries: "MOVE(*" +Debug: 05-18 21:53:28 some body finished +Debug: 05-18 21:53:28 one not finished. +Debug: 05-18 21:53:28 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 21:53:28 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 21:53:28 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 21:53:28 some body finished +Debug: 05-18 21:53:28 one finished. +Debug: 05-18 21:53:28 erasing.. +Debug: 05-18 21:53:28 erase done.. +Debug: 05-18 21:53:28 send dicts(finished): "groupId:1,word:MOVE(*,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:53:28 receive dicts, current word: "MOVE(*" "MOVE(*" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:53:28 ====reading 1292 of (2701) bytes . Finished: 1 +Debug: 05-18 21:53:28 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:53:28 scheme: "gico" +Debug: 05-18 21:53:28 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:53:28 article view loaded url: "gdlookup://localhost/?word=MOVE(*&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 21:53:28 translating from clipboard or selection +Debug: 05-18 21:53:28 clipboard data: "MOVE(*(__first" +Debug: 05-18 21:53:28 Current state: true false true true +Debug: 05-18 21:53:28 getResource: "gdlookup://localhost/?word=MOVE(*(__first&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:53:28 scheme: "gdlookup" +Debug: 05-18 21:53:28 host: "localhost" +Debug: 05-18 21:53:28 clear current dictionaries: "MOVE(*(__first" +Debug: 05-18 21:53:28 some body finished +Debug: 05-18 21:53:28 one not finished. +Debug: 05-18 21:53:28 ====reading 1417 of (1417) bytes . Finished: 0 +Debug: 05-18 21:53:28 ====reading 0 of (1417) bytes . Finished: 0 +Debug: 05-18 21:53:28 ====reading 0 of (1417) bytes . Finished: 0 +Debug: 05-18 21:53:28 some body finished +Debug: 05-18 21:53:28 one finished. +Debug: 05-18 21:53:28 erasing.. +Debug: 05-18 21:53:28 erase done.. +Debug: 05-18 21:53:28 send dicts(finished): "groupId:1,word:MOVE(*(__first,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:53:28 ====reading 1292 of (2709) bytes . Finished: 1 +Debug: 05-18 21:53:28 receive dicts, current word: "MOVE(*(__first" "MOVE(*(__first" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 21:53:28 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 21:53:28 scheme: "gico" +Debug: 05-18 21:53:28 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 21:53:28 article view loaded url: "gdlookup://localhost/?word=MOVE(*(__first&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb32" true +Debug: 05-18 21:56:09 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:56:09 scheme: "gdlookup" +Debug: 05-18 21:56:09 host: "localhost" +Debug: 05-18 21:56:09 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 21:56:09 some body finished +Debug: 05-18 21:56:09 one not finished. +Debug: 05-18 21:56:09 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 21:56:09 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 21:56:09 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 21:56:22 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:56:22 scheme: "gdlookup" +Debug: 05-18 21:56:22 host: "localhost" +Debug: 05-18 21:56:22 clear current dictionaries: "ゆっくり" +Debug: 05-18 21:56:22 some body finished +Debug: 05-18 21:56:22 one not finished. +Debug: 05-18 21:56:22 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 21:56:22 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 21:56:22 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 21:56:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:56:23 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:56:23 scheme: "gdlookup" +Debug: 05-18 21:56:23 host: "localhost" +Debug: 05-18 21:56:23 clear current dictionaries: "違和感" +Debug: 05-18 21:56:23 some body finished +Debug: 05-18 21:56:23 one not finished. +Debug: 05-18 21:56:23 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 21:56:23 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 21:56:23 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 21:56:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:56:24 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:56:24 scheme: "gdlookup" +Debug: 05-18 21:56:24 host: "localhost" +Debug: 05-18 21:56:24 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 21:56:24 some body finished +Debug: 05-18 21:56:24 one not finished. +Debug: 05-18 21:56:24 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 21:56:24 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 21:56:24 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 21:56:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:56:28 translating from clipboard or selection +Debug: 05-18 21:56:28 clipboard data: "転生したら剣でした" +Debug: 05-18 21:56:28 Current state: true false false true +Debug: 05-18 21:56:28 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:56:28 scheme: "gdlookup" +Debug: 05-18 21:56:28 host: "localhost" +Debug: 05-18 21:56:28 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 21:56:28 some body finished +Debug: 05-18 21:56:28 one not finished. +Debug: 05-18 21:56:28 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 21:56:28 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 21:56:28 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 21:56:28 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 21:56:29 translating from clipboard or selection +Debug: 05-18 21:56:29 clipboard data: "転生したら剣でした" +Debug: 05-18 21:56:29 Current state: true false true true +Debug: 05-18 21:56:29 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 21:56:29 scheme: "gdlookup" +Debug: 05-18 21:56:29 host: "localhost" +Debug: 05-18 21:56:29 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 21:56:29 some body finished +Debug: 05-18 21:56:29 one not finished. +Debug: 05-18 21:56:29 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 21:56:29 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 21:56:29 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 21:56:29 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:07:16 translating from clipboard or selection +Debug: 05-18 22:07:16 clipboard data: "slc" +Debug: 05-18 22:07:16 Current state: true true true true +Debug: 05-18 22:07:16 getResource: "gdlookup://localhost/?word=slc&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:07:16 scheme: "gdlookup" +Debug: 05-18 22:07:16 host: "localhost" +Debug: 05-18 22:07:16 clear current dictionaries: "slc" +Debug: 05-18 22:07:16 some body finished +Debug: 05-18 22:07:16 one not finished. +Debug: 05-18 22:07:16 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 22:07:16 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 22:07:16 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 22:07:16 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:07:20 translating from clipboard or selection +Debug: 05-18 22:07:20 clipboard data: "" +Debug: 05-18 22:08:10 translating from clipboard or selection +Debug: 05-18 22:08:10 clipboard data: "lofiga3778@huleos.com" +Debug: 05-18 22:08:10 Current state: true false true true +Debug: 05-18 22:08:10 getResource: "gdlookup://localhost/?word=lofiga3778@huleos.com&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:08:10 scheme: "gdlookup" +Debug: 05-18 22:08:10 host: "localhost" +Debug: 05-18 22:08:10 clear current dictionaries: "lofiga3778@huleos.com" +Debug: 05-18 22:08:10 some body finished +Debug: 05-18 22:08:10 one not finished. +Debug: 05-18 22:08:10 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 22:08:10 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 22:08:10 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 22:08:10 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Info: 05-18 22:08:25 libpng warning: iCCP: known incorrect sRGB profile +Info: 05-18 22:08:25 libpng warning: iCCP: cHRM chunk does not match sRGB +Debug: 05-18 22:08:27 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 22:08:27 Epwing: found "EIDAI6" +Debug: 05-18 22:08:27 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 22:08:27 Epwing: found "HYOGEN" +Debug: 05-18 22:08:27 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:08:27 Epwing: found "RUIGIGO" +Debug: 05-18 22:08:27 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:08:27 Epwing: found "RUIGIGO" +Debug: 05-18 22:08:28 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 22:08:28 Epwing: found "ENCY" +Debug: 05-18 22:08:28 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 22:08:28 Epwing: found "Snmkg99" +Debug: 05-18 22:08:28 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 22:08:28 Epwing: found "BODY" +Debug: 05-18 22:08:28 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 22:08:28 Epwing: found "MEIKYOJJ" +Info: 05-18 22:08:28 libpng warning: iCCP: known incorrect sRGB profile +Info: 05-18 22:08:29 libpng warning: iCCP: known incorrect sRGB profile +Info: 05-18 22:08:29 libpng warning: iCCP: known incorrect sRGB profile +Debug: 05-18 22:08:31 "OrderAndProps" +Debug: 05-18 22:08:32 "Sources" +Debug: 05-18 22:08:51 handle path: "/mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:08:51 handle path: "/mnt/Data/Chinese caligraphy dictionaries" +Debug: 05-18 22:08:51 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts" +Debug: 05-18 22:08:54 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 22:08:54 Epwing: found "EIDAI6" +Warning: 05-18 22:08:54 "Epwing dictionary initializing failed: , error: EB library report error EB \"eb_set_subbook\" function error: EB_ERR_FAIL_OPEN_TEXT (failed to open a text file)\n" +Debug: 05-18 22:08:54 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 22:08:54 Epwing: found "HYOGEN" +Debug: 05-18 22:08:54 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:08:54 Epwing: found "RUIGIGO" +Debug: 05-18 22:09:17 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:09:17 Epwing: found "RUIGIGO" +Debug: 05-18 22:09:18 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 22:09:18 Epwing: found "ENCY" +Debug: 05-18 22:09:19 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 22:09:19 Epwing: found "Snmkg99" +Debug: 05-18 22:09:19 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 22:09:19 Epwing: found "BODY" +Debug: 05-18 22:09:19 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 22:09:19 Epwing: found "MEIKYOJJ" +Debug: 05-18 22:09:19 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation" +Debug: 05-18 22:09:19 handle path: "/mnt/Reading/Wikipedia Japa" +Debug: 05-18 22:09:19 handle path: "/mnt/Data/Documents/dict - concise encyclopedia of mathematics" +Debug: 05-18 22:09:19 handle path: "/home/hashirama/Downloads/Port" +Debug: 05-18 22:09:19 handle path: "/mnt/Data/Documents/english_dictionary" +Debug: 05-18 22:09:19 handle path: "/mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0]" +Debug: 05-18 22:09:19 handle path: "/mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:09:20 Load done + +Debug: 05-18 22:09:20 Loading 198 abbrv + +Debug: 05-18 22:09:20 Loading 210 abbrv + +Debug: 05-18 22:09:20 Loading 183 abbrv + +Debug: 05-18 22:09:21 Loading 200 abbrv + +Debug: 05-18 22:09:21 received: "220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <312122721.20588.1716084561@dict.dict.org>\r\n" +Debug: 05-18 22:09:21 received: "110 166 databases present\r\n" +Debug: 05-18 22:09:21 receive db: "gcide \"The Collaborative International Dictionary of English v.0.48\"" +Debug: 05-18 22:09:21 receive db: "wn \"WordNet (r) 3.0 (2006)\"" +Debug: 05-18 22:09:21 receive db: "moby-thesaurus \"Moby Thesaurus II by Grady Ward, 1.0\"" +Debug: 05-18 22:09:21 receive db: "elements \"The Elements (07Nov00)\"" +Debug: 05-18 22:09:21 receive db: "vera \"V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\"" +Debug: 05-18 22:09:21 receive db: "jargon \"The Jargon File (version 4.4.7, 29 Dec 2003)\"" +Debug: 05-18 22:09:21 receive db: "foldoc \"The Free On-line Dictionary of Computing (30 December 2018)\"" +Debug: 05-18 22:09:21 receive db: "easton \"Easton's 1897 Bible Dictionary\"" +Debug: 05-18 22:09:21 receive db: "hitchcock \"Hitchcock's Bible Names Dictionary (late 1800's)\"" +Debug: 05-18 22:09:21 receive db: "bouvier \"Bouvier's Law Dictionary, Revised 6th Ed (1856)\"" +Debug: 05-18 22:09:21 receive db: "devil \"The Devil's Dictionary (1881-1906)\"" +Debug: 05-18 22:09:21 receive db: "world02 \"CIA World Factbook 2002\"" +Debug: 05-18 22:09:21 receive db: "gaz2k-counties \"U.S. Gazetteer Counties (2000)\"" +Debug: 05-18 22:09:21 receive db: "gaz2k-places \"U.S. Gazetteer Places (2000)\"" +Debug: 05-18 22:09:21 receive db: "gaz2k-zips \"U.S. Gazetteer Zip Code Tabulation Areas (2000)\"" +Debug: 05-18 22:09:21 receive db: "fd-hrv-eng \"Croatian-English FreeDict Dictionary ver. 0.1.2\"" +Debug: 05-18 22:09:21 receive db: "fd-fin-por \"suomi-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:09:21 receive db: "fd-fin-bul \"suomi-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:09:21 receive db: "fd-fra-bul \"fran\xC3\xA7""ais-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:09:21 receive db: "fd-deu-swe \"Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:09:21 receive db: "fd-fin-swe \"suomi-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:09:21 receive db: "fd-jpn-rus \"Japanese-Russian FreeDict Dictionary ver. 0.1\"" +Debug: 05-18 22:09:21 receive db: "fd-wol-fra \"Wolof - French FreeDict dictionary ver. 0.1\"" +Debug: 05-18 22:09:21 receive db: "fd-fra-pol \"fran\xC3\xA7""ais-j\xC4\x99zyk" +Debug: 05-18 22:09:21 received: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-deu \"English-German FreeDict Dictionary ver. 0.3.7\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-nld \"German-Dutch FreeDict Dictionary ver. 0.1.4\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-por-eng \"Portuguese-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-spa-deu \"Spanish-German FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ces-eng \"Czech-English FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-fin \"Svenska-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-pol \"English - Polish Piotrowski+Saloni/FreeDict dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-nor \"j\xC4\x99zyk polski-Norsk FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-rom \"English-Romanian FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-fra \"English-French FreeDict Dictionary ver. 0.1.6\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fin-ell \"suomi-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-lit \"English-Lithuanian FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ckb-kmr \"Sorani-Kurmanji Ferheng/FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-eng \"Italian-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-eng \"j\xC4\x99zyk polski-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-gle-eng \"Irish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-tur \"English-Turkish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-gle-pol \"Irish-Polish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-deu \"j\xC4\x99zyk polski-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-spa \"fran\xC3\xA7""ais-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-lit-eng \"Lithuanian-English FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-jpn \"English-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ara-eng \"Arabic-English FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-nld-ita \"Nederlands-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-lat \"English-Latin FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-hun \"English-Hungarian FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-jpn \"italiano-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-dan-eng \"Danish-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-hun-eng \"Hungarian-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-gle \"Polish-Irish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-fin \"fran\xC3\xA7""ais-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-nld-swe \"Nederlands-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-nld-eng \"Dutch-English Freedict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-kur \"German-Kurdish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-spa \"Deutsch-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-afr \"English-Afrikaans FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-swe \"English-Swedish FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-jpn-deu \"Japanese-German FreeDict Dictionary ver. 0.2.0\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-epo-eng \"Esperanto-English FreeDict dictionary ver. 1.0.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-nld \"j\xC4\x99zyk polski-Nederlands FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-lat-deu \"Lateinisch-Deutsch FreeDict-W\xC3\xB6rterbuch ver. 1.0.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-cym \"Eurfa Saesneg, English-Welsh Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-por-spa \"portugu\xC3\xAAs-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-spa \"English-Spanish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-tur \"Svenska-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-tur-eng \"Turkish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-tur-deu \"Turkish-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-fra \"j\xC4\x99zyk polski-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-por \"English-Portuguese FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-pol \"italiano-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-ces \"English-Czech dicts.info/FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-tur \"German-Turkish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-jpn \"fran\xC3\xA7""ais-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-cym-eng \"Eurfa Cymraeg, Welsh-English Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-bre-fra \"Breton-French FreeDict Dictionary (Geriadur Tomaz) ver. 0.8.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-jpn-fra \"Japanese-French FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-nld-deu \"Dutch-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-nld \"English-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-por \"German-Portuguese FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-hrv \"English-Croatian FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-mkd-bul \"Macedonian - Bulgarian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-eng \"Swedish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-spa \"j\xC4\x99zyk polski-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-jpn-eng \"Japanese-English FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-ell \"English - Modern Greek XDXF/FreeDict dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-por \"italiano-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-swe \"j\xC4\x99zyk polski-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-fin \"j\xC4\x99zyk polski-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-kur-tur \"Kurdish-Turkish Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-swe \"italiano-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-swh \"English-Swahili xFried/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-kha-eng \"Khasi-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fin-eng \"suomi-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-hin \"English-Hindi FreeDict Dictionary ver. 1.6\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-spa-eng \"Spanish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-afr-eng \"Afrikaans-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-fin \"italiano-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-fin \"English-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-ita \"fran\xC3\xA7""ais-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-rus \"Deutsch-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-bul \"Deutsch-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-pol \"Deutsch-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-kur-deu \"Kurdish-German Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-spa-por \"Spanish-Portuguese FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-pol \"Svenska-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-rus \"Svenska-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-nld-spa \"Nederlands-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swh-pol \"Swahili-Polish SSSP/FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-oci-cat \"Lenga d'\xC3\xB2""c - Catal\xC3\xA0 FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-rus \"italiano-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-ell \"fran\xC3\xA7""ais-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-srp \"English-Serbian FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-tur \"fran\xC3\xA7""ais-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-eng \"French-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-ita-ell \"italiano-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-kur-eng \"Kurdish-English Ferheng/FreeDict Dictionary ver. 1.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-deu \"Svenska-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-fra \"Svenska-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-lat \"Svenska-latine FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-ell \"Svenska-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-rus \"English-Russian FreeDict Dictionary ver. 0.3.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-por \"j\xC4\x99zyk polski-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-gla-deu \"Scottish Gaelic-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-ita \"English-Italian FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-pol-ita \"j\xC4\x99zyk polski-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-swe \"fran\xC3\xA7""ais-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-isl-eng \"\xC3\xADslenska - English FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-spa \"Svenska-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-nno-nob \"Norwegian Nynorsk-Norwegian Bokm\xC3\xA5l FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swe-ita \"Svenska-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-deu \"fran\xC3\xA7""ais-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fin-ita \"suomi-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-nld-fra \"Nederlands-French FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-eng-ara \"English-Arabic FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-slk-eng \"Slovak-English FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fra-por \"fran\xC3\xA7""ais-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-spa-ast \"Spanish - Asturian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fin-jpn \"suomi-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-deu-ita \"German-Italian FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-swh-eng \"Swahili-English xFried/FreeDict Dictionary ver. 0.4.4\"\r\n" +Debug: 05-18 22:09:21 receive db: "fd-fin-nor \"suomi-Norsk FreeDict+WikDict dictionary ver. 2018" +Debug: 05-18 22:09:22 received: ".09.13\"\r\n" +Debug: 05-18 22:09:22 receive db: ".09.13\"\r\n" +Debug: 05-18 22:09:22 received: "fd-fra-nld \"French-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:09:23 Reloading all the tabs... +Debug: 05-18 22:09:23 starting create the fts with thread: 11 +Debug: 05-18 22:09:23 waiting for all the fts creation to finish. +Debug: 05-18 22:09:23 finished/cancel all the fts creation +Debug: 05-18 22:09:23 getResource: "gdlookup://localhost/?word=lofiga3778@huleos.com&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:09:23 scheme: "gdlookup" +Debug: 05-18 22:09:23 host: "localhost" +Debug: 05-18 22:09:23 clear current dictionaries: "lofiga3778@huleos.com" +Debug: 05-18 22:09:23 some body finished +Debug: 05-18 22:09:23 one not finished. +Debug: 05-18 22:09:23 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 22:09:23 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 22:09:23 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 22:09:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:09:26 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:09:26 scheme: "gdlookup" +Debug: 05-18 22:09:26 host: "localhost" +Debug: 05-18 22:09:26 clear current dictionaries: "ゆっくり" +Debug: 05-18 22:09:26 some body finished +Debug: 05-18 22:09:26 one not finished. +Debug: 05-18 22:09:26 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 22:09:26 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 22:09:26 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 22:09:26 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:10:07 translating from clipboard or selection +Debug: 05-18 22:10:07 clipboard data: "" +Debug: 05-18 22:10:30 getResource: "gdlookup://localhost/?word=猿猴捉月。&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:10:30 scheme: "gdlookup" +Debug: 05-18 22:10:30 host: "localhost" +Debug: 05-18 22:10:30 clear current dictionaries: "猿猴捉月。" +Debug: 05-18 22:10:30 some body finished +Debug: 05-18 22:10:30 one not finished. +Debug: 05-18 22:10:30 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 22:10:30 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 22:10:30 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 22:10:30 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:10:35 translating from clipboard or selection +Debug: 05-18 22:10:35 clipboard data: ": 猿猴捉月" +Debug: 05-18 22:10:35 Current state: true false false true +Debug: 05-18 22:10:35 getResource: "gdlookup://localhost/?word=: 猿猴捉月&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:10:35 scheme: "gdlookup" +Debug: 05-18 22:10:35 host: "localhost" +Debug: 05-18 22:10:35 clear current dictionaries: ": 猿猴捉月" +Debug: 05-18 22:10:35 some body finished +Debug: 05-18 22:10:35 one not finished. +Debug: 05-18 22:10:35 ====reading 1417 of (1417) bytes . Finished: 0 +Debug: 05-18 22:10:35 ====reading 0 of (1417) bytes . Finished: 0 +Debug: 05-18 22:10:35 ====reading 0 of (1417) bytes . Finished: 0 +Warning: 05-18 22:10:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:11:12 handle path: "/mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:11:12 handle path: "/mnt/Data/Chinese caligraphy dictionaries" +Debug: 05-18 22:11:12 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts" +Debug: 05-18 22:11:12 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 22:11:12 Epwing: found "EIDAI6" +Warning: 05-18 22:11:12 "Epwing dictionary initializing failed: , error: EB library report error EB \"eb_set_subbook\" function error: EB_ERR_FAIL_OPEN_TEXT (failed to open a text file)\n" +Debug: 05-18 22:11:12 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 22:11:12 Epwing: found "HYOGEN" +Debug: 05-18 22:11:12 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:11:12 Epwing: found "RUIGIGO" +Debug: 05-18 22:11:13 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:11:13 Epwing: found "RUIGIGO" +Debug: 05-18 22:11:14 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 22:11:14 Epwing: found "ENCY" +Debug: 05-18 22:11:14 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 22:11:14 Epwing: found "Snmkg99" +Debug: 05-18 22:11:14 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 22:11:14 Epwing: found "BODY" +Debug: 05-18 22:11:14 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 22:11:14 Epwing: found "MEIKYOJJ" +Debug: 05-18 22:11:14 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation" +Debug: 05-18 22:11:14 handle path: "/mnt/Reading/Wikipedia Japa" +Debug: 05-18 22:11:14 handle path: "/mnt/Data/Documents/dict - concise encyclopedia of mathematics" +Debug: 05-18 22:11:14 handle path: "/home/hashirama/Downloads/Port" +Debug: 05-18 22:11:14 handle path: "/mnt/Data/Documents/english_dictionary" +Debug: 05-18 22:11:14 handle path: "/mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0]" +Debug: 05-18 22:11:14 handle path: "/mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:11:14 Load done + +Debug: 05-18 22:11:14 Loading 183 abbrv + +Debug: 05-18 22:11:14 Loading 200 abbrv + +Debug: 05-18 22:11:14 Loading 198 abbrv + +Debug: 05-18 22:11:14 Loading 210 abbrv + +Debug: 05-18 22:11:14 received: "220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <312123469.22099.1716084674@dict.dict.org>\r\n" +Debug: 05-18 22:11:14 received: "110 166 databases present\r\n" +Debug: 05-18 22:11:14 receive db: "gcide \"The Collaborative International Dictionary of English v.0.48\"" +Debug: 05-18 22:11:14 receive db: "wn \"WordNet (r) 3.0 (2006)\"" +Debug: 05-18 22:11:14 receive db: "moby-thesaurus \"Moby Thesaurus II by Grady Ward, 1.0\"" +Debug: 05-18 22:11:14 receive db: "elements \"The Elements (07Nov00)\"" +Debug: 05-18 22:11:14 receive db: "vera \"V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\"" +Debug: 05-18 22:11:14 receive db: "jargon \"The Jargon File (version 4.4.7, 29 Dec 2003)\"" +Debug: 05-18 22:11:14 receive db: "foldoc \"The Free On-line Dictionary of Computing (30 December 2018)\"" +Debug: 05-18 22:11:14 receive db: "easton \"Easton's 1897 Bible Dictionary\"" +Debug: 05-18 22:11:14 receive db: "hitchcock \"Hitchcock's Bible Names Dictionary (late 1800's)\"" +Debug: 05-18 22:11:14 receive db: "bouvier \"Bouvier's Law Dictionary, Revised 6th Ed (1856)\"" +Debug: 05-18 22:11:14 receive db: "devil \"The Devil's Dictionary (1881-1906)\"" +Debug: 05-18 22:11:14 receive db: "world02 \"CIA World Factbook 2002\"" +Debug: 05-18 22:11:14 receive db: "gaz2k-counties \"U.S. Gazetteer Counties (2000)\"" +Debug: 05-18 22:11:14 receive db: "gaz2k-places \"U.S. Gazetteer Places (2000)\"" +Debug: 05-18 22:11:14 receive db: "gaz2k-zips \"U.S. Gazetteer Zip Code Tabulation Areas (2000)\"" +Debug: 05-18 22:11:14 receive db: "fd-hrv-eng \"Croatian-English FreeDict Dictionary ver. 0.1.2\"" +Debug: 05-18 22:11:14 receive db: "fd-fin-por \"suomi-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:14 receive db: "fd-fin-bul \"suomi-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:14 receive db: "fd-fra-bul \"fran\xC3\xA7""ais-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:14 receive db: "fd-deu-swe \"Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:14 receive db: "fd-fin-swe \"suomi-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:14 receive db: "fd-jpn-rus \"Japanese-Russian FreeDict Dictionary ver. 0.1\"" +Debug: 05-18 22:11:14 receive db: "fd-wol-fra \"Wolof - French FreeDict dictionary ver. 0.1\"" +Debug: 05-18 22:11:14 receive db: "fd-fra-pol \"fran\xC3\xA7""ais-j\xC4\x99zyk" +Debug: 05-18 22:11:14 received: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-deu \"English-German FreeDict Dictionary ver. 0.3.7\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-nld \"German-Dutch FreeDict Dictionary ver. 0.1.4\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-por-eng \"Portuguese-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-spa-deu \"Spanish-German FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ces-eng \"Czech-English FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-fin \"Svenska-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-pol \"English - Polish Piotrowski+Saloni/FreeDict dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-nor \"j\xC4\x99zyk polski-Norsk FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-rom \"English-Romanian FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-fra \"English-French FreeDict Dictionary ver. 0.1.6\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fin-ell \"suomi-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-lit \"English-Lithuanian FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ckb-kmr \"Sorani-Kurmanji Ferheng/FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-eng \"Italian-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-eng \"j\xC4\x99zyk polski-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-gle-eng \"Irish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-tur \"English-Turkish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-gle-pol \"Irish-Polish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-deu \"j\xC4\x99zyk polski-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-spa \"fran\xC3\xA7""ais-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-lit-eng \"Lithuanian-English FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-jpn \"English-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ara-eng \"Arabic-English FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-nld-ita \"Nederlands-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-lat \"English-Latin FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-hun \"English-Hungarian FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-jpn \"italiano-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-dan-eng \"Danish-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-hun-eng \"Hungarian-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-gle \"Polish-Irish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-fin \"fran\xC3\xA7""ais-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-nld-swe \"Nederlands-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-nld-eng \"Dutch-English Freedict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-kur \"German-Kurdish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-spa \"Deutsch-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-afr \"English-Afrikaans FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-swe \"English-Swedish FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-jpn-deu \"Japanese-German FreeDict Dictionary ver. 0.2.0\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-epo-eng \"Esperanto-English FreeDict dictionary ver. 1.0.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-nld \"j\xC4\x99zyk polski-Nederlands FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-lat-deu \"Lateinisch-Deutsch FreeDict-W\xC3\xB6rterbuch ver. 1.0.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-cym \"Eurfa Saesneg, English-Welsh Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-por-spa \"portugu\xC3\xAAs-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-spa \"English-Spanish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-tur \"Svenska-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-tur-eng \"Turkish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-tur-deu \"Turkish-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-fra \"j\xC4\x99zyk polski-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-por \"English-Portuguese FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-pol \"italiano-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-ces \"English-Czech dicts.info/FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-tur \"German-Turkish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-jpn \"fran\xC3\xA7""ais-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-cym-eng \"Eurfa Cymraeg, Welsh-English Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-bre-fra \"Breton-French FreeDict Dictionary (Geriadur Tomaz) ver. 0.8.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-jpn-fra \"Japanese-French FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-nld-deu \"Dutch-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-nld \"English-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-por \"German-Portuguese FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-hrv \"English-Croatian FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-mkd-bul \"Macedonian - Bulgarian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-eng \"Swedish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-spa \"j\xC4\x99zyk polski-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-jpn-eng \"Japanese-English FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-ell \"English - Modern Greek XDXF/FreeDict dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-por \"italiano-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-swe \"j\xC4\x99zyk polski-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-fin \"j\xC4\x99zyk polski-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-kur-tur \"Kurdish-Turkish Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-swe \"italiano-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-swh \"English-Swahili xFried/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-kha-eng \"Khasi-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fin-eng \"suomi-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-hin \"English-Hindi FreeDict Dictionary ver. 1.6\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-spa-eng \"Spanish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-afr-eng \"Afrikaans-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-fin \"italiano-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-fin \"English-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-ita \"fran\xC3\xA7""ais-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-rus \"Deutsch-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-bul \"Deutsch-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-pol \"Deutsch-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-" +Debug: 05-18 22:11:14 received: "srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-kur-deu \"Kurdish-German Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-spa-por \"Spanish-Portuguese FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-pol \"Svenska-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-rus \"Svenska-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-nld-spa \"Nederlands-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swh-pol \"Swahili-Polish SSSP/FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-oci-cat \"Lenga d'\xC3\xB2""c - Catal\xC3\xA0 FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-rus \"italiano-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-ell \"fran\xC3\xA7""ais-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-srp \"English-Serbian FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-tur \"fran\xC3\xA7""ais-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-eng \"French-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-ita-ell \"italiano-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-kur-eng \"Kurdish-English Ferheng/FreeDict Dictionary ver. 1.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-deu \"Svenska-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-fra \"Svenska-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-lat \"Svenska-latine FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-ell \"Svenska-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-rus \"English-Russian FreeDict Dictionary ver. 0.3.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-por \"j\xC4\x99zyk polski-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-gla-deu \"Scottish Gaelic-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-ita \"English-Italian FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-pol-ita \"j\xC4\x99zyk polski-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-swe \"fran\xC3\xA7""ais-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-isl-eng \"\xC3\xADslenska - English FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-spa \"Svenska-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-nno-nob \"Norwegian Nynorsk-Norwegian Bokm\xC3\xA5l FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swe-ita \"Svenska-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-deu \"fran\xC3\xA7""ais-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fin-ita \"suomi-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-nld-fra \"Nederlands-French FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-eng-ara \"English-Arabic FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-slk-eng \"Slovak-English FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fra-por \"fran\xC3\xA7""ais-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-spa-ast \"Spanish - Asturian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fin-jpn \"suomi-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-deu-ita \"German-Italian FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-swh-eng \"Swahili-English xFried/FreeDict Dictionary ver. 0.4.4\"\r\n" +Debug: 05-18 22:11:14 receive db: "fd-fin-nor \"suomi-Norsk FreeDict+WikDict dictionary ver. 2018" +Debug: 05-18 22:11:15 received: ".09.13\"\r\n" +Debug: 05-18 22:11:15 receive db: ".09.13\"\r\n" +Debug: 05-18 22:11:15 received: "fd-fra-nld \"French-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:15 Reloading all the tabs... +Debug: 05-18 22:11:15 starting create the fts with thread: 11 +Debug: 05-18 22:11:15 waiting for all the fts creation to finish. +Debug: 05-18 22:11:15 finished/cancel all the fts creation +Debug: 05-18 22:11:15 getResource: "gdlookup://localhost/?word=: 猿猴捉月&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:11:15 scheme: "gdlookup" +Debug: 05-18 22:11:15 host: "localhost" +Debug: 05-18 22:11:15 clear current dictionaries: ": 猿猴捉月" +Debug: 05-18 22:11:15 some body finished +Debug: 05-18 22:11:15 one not finished. +Debug: 05-18 22:11:15 ====reading 1417 of (1417) bytes . Finished: 0 +Debug: 05-18 22:11:15 ====reading 0 of (1417) bytes . Finished: 0 +Debug: 05-18 22:11:15 ====reading 0 of (1417) bytes . Finished: 0 +Warning: 05-18 22:11:15 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:11:29 handle path: "/mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:11:29 handle path: "/mnt/Data/Chinese caligraphy dictionaries" +Debug: 05-18 22:11:29 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts" +Debug: 05-18 22:11:29 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 22:11:29 Epwing: found "EIDAI6" +Warning: 05-18 22:11:29 "Epwing dictionary initializing failed: , error: EB library report error EB \"eb_set_subbook\" function error: EB_ERR_FAIL_OPEN_TEXT (failed to open a text file)\n" +Debug: 05-18 22:11:29 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 22:11:29 Epwing: found "HYOGEN" +Debug: 05-18 22:11:29 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:11:29 Epwing: found "RUIGIGO" +Debug: 05-18 22:11:30 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:11:30 Epwing: found "RUIGIGO" +Debug: 05-18 22:11:30 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 22:11:30 Epwing: found "ENCY" +Debug: 05-18 22:11:30 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 22:11:30 Epwing: found "Snmkg99" +Debug: 05-18 22:11:30 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 22:11:30 Epwing: found "BODY" +Debug: 05-18 22:11:30 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 22:11:30 Epwing: found "MEIKYOJJ" +Debug: 05-18 22:11:30 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation" +Debug: 05-18 22:11:31 handle path: "/mnt/Reading/Wikipedia Japa" +Debug: 05-18 22:11:31 handle path: "/mnt/Data/Documents/dict - concise encyclopedia of mathematics" +Debug: 05-18 22:11:31 handle path: "/home/hashirama/Downloads/Port" +Debug: 05-18 22:11:31 handle path: "/mnt/Data/Documents/english_dictionary" +Debug: 05-18 22:11:31 handle path: "/mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0]" +Debug: 05-18 22:11:31 handle path: "/mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:11:31 Load done + +Debug: 05-18 22:11:31 Loading 198 abbrv + +Debug: 05-18 22:11:31 Loading 183 abbrv + +Debug: 05-18 22:11:31 Loading 200 abbrv + +Debug: 05-18 22:11:31 Loading 210 abbrv + +Debug: 05-18 22:11:31 received: "220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <312123564.22288.1716084691@dict.dict.org>\r\n" +Debug: 05-18 22:11:31 received: "110 166 databases present\r\n" +Debug: 05-18 22:11:31 receive db: "gcide \"The Collaborative International Dictionary of English v.0.48\"" +Debug: 05-18 22:11:31 receive db: "wn \"WordNet (r) 3.0 (2006)\"" +Debug: 05-18 22:11:31 receive db: "moby-thesaurus \"Moby Thesaurus II by Grady Ward, 1.0\"" +Debug: 05-18 22:11:31 receive db: "elements \"The Elements (07Nov00)\"" +Debug: 05-18 22:11:31 receive db: "vera \"V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\"" +Debug: 05-18 22:11:31 receive db: "jargon \"The Jargon File (version 4.4.7, 29 Dec 2003)\"" +Debug: 05-18 22:11:31 receive db: "foldoc \"The Free On-line Dictionary of Computing (30 December 2018)\"" +Debug: 05-18 22:11:31 receive db: "easton \"Easton's 1897 Bible Dictionary\"" +Debug: 05-18 22:11:31 receive db: "hitchcock \"Hitchcock's Bible Names Dictionary (late 1800's)\"" +Debug: 05-18 22:11:31 receive db: "bouvier \"Bouvier's Law Dictionary, Revised 6th Ed (1856)\"" +Debug: 05-18 22:11:31 receive db: "devil \"The Devil's Dictionary (1881-1906)\"" +Debug: 05-18 22:11:31 receive db: "world02 \"CIA World Factbook 2002\"" +Debug: 05-18 22:11:31 receive db: "gaz2k-counties \"U.S. Gazetteer Counties (2000)\"" +Debug: 05-18 22:11:31 receive db: "gaz2k-places \"U.S. Gazetteer Places (2000)\"" +Debug: 05-18 22:11:31 receive db: "gaz2k-zips \"U.S. Gazetteer Zip Code Tabulation Areas (2000)\"" +Debug: 05-18 22:11:31 receive db: "fd-hrv-eng \"Croatian-English FreeDict Dictionary ver. 0.1.2\"" +Debug: 05-18 22:11:31 receive db: "fd-fin-por \"suomi-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:31 receive db: "fd-fin-bul \"suomi-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:31 receive db: "fd-fra-bul \"fran\xC3\xA7""ais-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:31 receive db: "fd-deu-swe \"Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:31 receive db: "fd-fin-swe \"suomi-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:31 receive db: "fd-jpn-rus \"Japanese-Russian FreeDict Dictionary ver. 0.1\"" +Debug: 05-18 22:11:31 receive db: "fd-wol-fra \"Wolof - French FreeDict dictionary ver. 0.1\"" +Debug: 05-18 22:11:31 receive db: "fd-fra-pol \"fran\xC3\xA7""ais-j\xC4\x99zyk" +Debug: 05-18 22:11:31 received: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-deu \"English-German FreeDict Dictionary ver. 0.3.7\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-nld \"German-Dutch FreeDict Dictionary ver. 0.1.4\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-por-eng \"Portuguese-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-spa-deu \"Spanish-German FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ces-eng \"Czech-English FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-fin \"Svenska-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-pol \"English - Polish Piotrowski+Saloni/FreeDict dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-nor \"j\xC4\x99zyk polski-Norsk FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-rom \"English-Romanian FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-fra \"English-French FreeDict Dictionary ver. 0.1.6\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fin-ell \"suomi-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-lit \"English-Lithuanian FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ckb-kmr \"Sorani-Kurmanji Ferheng/FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-eng \"Italian-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-eng \"j\xC4\x99zyk polski-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-gle-eng \"Irish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-tur \"English-Turkish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-gle-pol \"Irish-Polish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-deu \"j\xC4\x99zyk polski-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-spa \"fran\xC3\xA7""ais-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-lit-eng \"Lithuanian-English FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-jpn \"English-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ara-eng \"Arabic-English FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-nld-ita \"Nederlands-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-lat \"English-Latin FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-hun \"English-Hungarian FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-jpn \"italiano-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-dan-eng \"Danish-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-hun-eng \"Hungarian-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-gle \"Polish-Irish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-fin \"fran\xC3\xA7""ais-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-nld-swe \"Nederlands-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-nld-eng \"Dutch-English Freedict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-kur \"German-Kurdish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-spa \"Deutsch-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-afr \"English-Afrikaans FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-swe \"English-Swedish FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-jpn-deu \"Japanese-German FreeDict Dictionary ver. 0.2.0\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-epo-eng \"Esperanto-English FreeDict dictionary ver. 1.0.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-nld \"j\xC4\x99zyk polski-Nederlands FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-lat-deu \"Lateinisch-Deutsch FreeDict-W\xC3\xB6rterbuch ver. 1.0.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-cym \"Eurfa Saesneg, English-Welsh Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-por-spa \"portugu\xC3\xAAs-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-spa \"English-Spanish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-tur \"Svenska-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-tur-eng \"Turkish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-tur-deu \"Turkish-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-fra \"j\xC4\x99zyk polski-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-por \"English-Portuguese FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-pol \"italiano-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-ces \"English-Czech dicts.info/FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-tur \"German-Turkish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-jpn \"fran\xC3\xA7""ais-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-cym-eng \"Eurfa Cymraeg, Welsh-English Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-bre-fra \"Breton-French FreeDict Dictionary (Geriadur Tomaz) ver. 0.8.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-jpn-fra \"Japanese-French FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-nld-deu \"Dutch-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-nld \"English-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-por \"German-Portuguese FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-hrv \"English-Croatian FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-mkd-bul \"Macedonian - Bulgarian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-eng \"Swedish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-spa \"j\xC4\x99zyk polski-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-jpn-eng \"Japanese-English FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-ell \"English - Modern Greek XDXF/FreeDict dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-por \"italiano-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-swe \"j\xC4\x99zyk polski-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-fin \"j\xC4\x99zyk polski-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-kur-tur \"Kurdish-Turkish Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-swe \"italiano-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-swh \"English-Swahili xFried/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-kha-eng \"Khasi-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fin-eng \"suomi-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-hin \"English-Hindi FreeDict Dictionary ver. 1.6\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-spa-eng \"Spanish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-afr-eng \"Afrikaans-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-fin \"italiano-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-fin \"English-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-ita \"fran\xC3\xA7""ais-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-rus \"Deutsch-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-bul \"Deutsch-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-pol \"Deutsch-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-kur-deu \"Kurdish-German Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-spa-por \"Spanish-Portuguese FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-pol \"Svenska-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-rus \"Svenska-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-nld-spa \"Nederlands-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swh-pol \"Swahili-Polish SSSP/FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-oci-cat \"Lenga d'\xC3\xB2""c - Catal\xC3\xA0 FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-rus \"italiano-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-ell \"fran\xC3\xA7""ais-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-srp \"English-Serbian FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-tur \"fran\xC3\xA7""ais-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-eng \"French-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-ita-ell \"italiano-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-kur-eng \"Kurdish-English Ferheng/FreeDict Dictionary ver. 1.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-deu \"Svenska-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-fra \"Svenska-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-lat \"Svenska-latine FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-ell \"Svenska-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-rus \"English-Russian FreeDict Dictionary ver. 0.3.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-por \"j\xC4\x99zyk polski-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-gla-deu \"Scottish Gaelic-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-ita \"English-Italian FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-pol-ita \"j\xC4\x99zyk polski-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-swe \"fran\xC3\xA7""ais-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-isl-eng \"\xC3\xADslenska - English FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-spa \"Svenska-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-nno-nob \"Norwegian Nynorsk-Norwegian Bokm\xC3\xA5l FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swe-ita \"Svenska-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-deu \"fran\xC3\xA7""ais-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fin-ita \"suomi-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-nld-fra \"Nederlands-French FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-eng-ara \"English-Arabic FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-slk-eng \"Slovak-English FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fra-por \"fran\xC3\xA7""ais-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-spa-ast \"Spanish - Asturian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fin-jpn \"suomi-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-deu-ita \"German-Italian FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-swh-eng \"Swahili-English xFried/FreeDict Dictionary ver. 0.4.4\"\r\n" +Debug: 05-18 22:11:31 receive db: "fd-fin-nor \"suomi-Norsk FreeDict+WikDict dictionary ver. 2018" +Debug: 05-18 22:11:31 received: ".09.13\"\r\n" +Debug: 05-18 22:11:31 receive db: ".09.13\"\r\n" +Debug: 05-18 22:11:31 received: "fd-fra-nld \"French-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:40 handle path: "/mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:11:40 handle path: "/mnt/Data/Chinese caligraphy dictionaries" +Debug: 05-18 22:11:40 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts" +Debug: 05-18 22:11:40 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 22:11:40 Epwing: found "EIDAI6" +Warning: 05-18 22:11:40 "Epwing dictionary initializing failed: , error: EB library report error EB \"eb_set_subbook\" function error: EB_ERR_FAIL_OPEN_TEXT (failed to open a text file)\n" +Debug: 05-18 22:11:40 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 22:11:40 Epwing: found "HYOGEN" +Debug: 05-18 22:11:40 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:11:40 Epwing: found "RUIGIGO" +Debug: 05-18 22:11:41 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:11:41 Epwing: found "RUIGIGO" +Debug: 05-18 22:11:41 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 22:11:41 Epwing: found "ENCY" +Debug: 05-18 22:11:41 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 22:11:41 Epwing: found "Snmkg99" +Debug: 05-18 22:11:41 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 22:11:41 Epwing: found "BODY" +Debug: 05-18 22:11:41 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 22:11:41 Epwing: found "MEIKYOJJ" +Debug: 05-18 22:11:41 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation" +Debug: 05-18 22:11:41 handle path: "/mnt/Reading/Wikipedia Japa" +Debug: 05-18 22:11:41 handle path: "/mnt/Data/Documents/dict - concise encyclopedia of mathematics" +Debug: 05-18 22:11:41 handle path: "/home/hashirama/Downloads/Port" +Debug: 05-18 22:11:41 handle path: "/mnt/Data/Documents/english_dictionary" +Debug: 05-18 22:11:41 handle path: "/mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0]" +Debug: 05-18 22:11:41 handle path: "/mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:11:42 Load done + +Debug: 05-18 22:11:42 Loading 210 abbrv + +Debug: 05-18 22:11:42 Loading 198 abbrv + +Debug: 05-18 22:11:42 Loading 183 abbrv + +Debug: 05-18 22:11:42 Loading 200 abbrv + +Debug: 05-18 22:11:42 received: "220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <312123626.22414.1716084702@dict.dict.org>\r\n" +Debug: 05-18 22:11:42 received: "110 166 databases present\r\n" +Debug: 05-18 22:11:42 receive db: "gcide \"The Collaborative International Dictionary of English v.0.48\"" +Debug: 05-18 22:11:42 receive db: "wn \"WordNet (r) 3.0 (2006)\"" +Debug: 05-18 22:11:42 receive db: "moby-thesaurus \"Moby Thesaurus II by Grady Ward, 1.0\"" +Debug: 05-18 22:11:42 receive db: "elements \"The Elements (07Nov00)\"" +Debug: 05-18 22:11:42 receive db: "vera \"V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\"" +Debug: 05-18 22:11:42 receive db: "jargon \"The Jargon File (version 4.4.7, 29 Dec 2003)\"" +Debug: 05-18 22:11:42 receive db: "foldoc \"The Free On-line Dictionary of Computing (30 December 2018)\"" +Debug: 05-18 22:11:42 receive db: "easton \"Easton's 1897 Bible Dictionary\"" +Debug: 05-18 22:11:42 receive db: "hitchcock \"Hitchcock's Bible Names Dictionary (late 1800's)\"" +Debug: 05-18 22:11:42 receive db: "bouvier \"Bouvier's Law Dictionary, Revised 6th Ed (1856)\"" +Debug: 05-18 22:11:42 receive db: "devil \"The Devil's Dictionary (1881-1906)\"" +Debug: 05-18 22:11:42 receive db: "world02 \"CIA World Factbook 2002\"" +Debug: 05-18 22:11:42 receive db: "gaz2k-counties \"U.S. Gazetteer Counties (2000)\"" +Debug: 05-18 22:11:42 receive db: "gaz2k-places \"U.S. Gazetteer Places (2000)\"" +Debug: 05-18 22:11:42 receive db: "gaz2k-zips \"U.S. Gazetteer Zip Code Tabulation Areas (2000)\"" +Debug: 05-18 22:11:42 receive db: "fd-hrv-eng \"Croatian-English FreeDict Dictionary ver. 0.1.2\"" +Debug: 05-18 22:11:42 receive db: "fd-fin-por \"suomi-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:42 receive db: "fd-fin-bul \"suomi-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:42 receive db: "fd-fra-bul \"fran\xC3\xA7""ais-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:42 receive db: "fd-deu-swe \"Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:42 receive db: "fd-fin-swe \"suomi-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:11:42 receive db: "fd-jpn-rus \"Japanese-Russian FreeDict Dictionary ver. 0.1\"" +Debug: 05-18 22:11:42 receive db: "fd-wol-fra \"Wolof - French FreeDict dictionary ver. 0.1\"" +Debug: 05-18 22:11:42 receive db: "fd-fra-pol \"fran\xC3\xA7""ais-j\xC4\x99zyk" +Debug: 05-18 22:11:42 received: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-deu \"English-German FreeDict Dictionary ver. 0.3.7\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-nld \"German-Dutch FreeDict Dictionary ver. 0.1.4\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-por-eng \"Portuguese-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-spa-deu \"Spanish-German FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ces-eng \"Czech-English FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-fin \"Svenska-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-pol \"English - Polish Piotrowski+Saloni/FreeDict dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-nor \"j\xC4\x99zyk polski-Norsk FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-rom \"English-Romanian FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-fra \"English-French FreeDict Dictionary ver. 0.1.6\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fin-ell \"suomi-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-lit \"English-Lithuanian FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ckb-kmr \"Sorani-Kurmanji Ferheng/FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-eng \"Italian-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-eng \"j\xC4\x99zyk polski-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-gle-eng \"Irish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-tur \"English-Turkish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-gle-pol \"Irish-Polish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-deu \"j\xC4\x99zyk polski-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-spa \"fran\xC3\xA7""ais-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-lit-eng \"Lithuanian-English FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-jpn \"English-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ara-eng \"Arabic-English FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-nld-ita \"Nederlands-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-lat \"English-Latin FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-hun \"English-Hungarian FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-jpn \"italiano-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-dan-eng \"Danish-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-hun-eng \"Hungarian-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-gle \"Polish-Irish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-fin \"fran\xC3\xA7""ais-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-nld-swe \"Nederlands-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-nld-eng \"Dutch-English Freedict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-kur \"German-Kurdish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-spa \"Deutsch-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-afr \"English-Afrikaans FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-swe \"English-Swedish FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-jpn-deu \"Japanese-German FreeDict Dictionary ver. 0.2.0\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-epo-eng \"Esperanto-English FreeDict dictionary ver. 1.0.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-nld \"j\xC4\x99zyk polski-Nederlands FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-lat-deu \"Lateinisch-Deutsch FreeDict-W\xC3\xB6rterbuch ver. 1.0.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-cym \"Eurfa Saesneg, English-Welsh Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-por-spa \"portugu\xC3\xAAs-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-spa \"English-Spanish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-tur \"Svenska-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-tur-eng \"Turkish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-tur-deu \"Turkish-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-fra \"j\xC4\x99zyk polski-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-por \"English-Portuguese FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-pol \"italiano-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-ces \"English-Czech dicts.info/FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-tur \"German-Turkish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-jpn \"fran\xC3\xA7""ais-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-cym-eng \"Eurfa Cymraeg, Welsh-English Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-bre-fra \"Breton-French FreeDict Dictionary (Geriadur Tomaz) ver. 0.8.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-jpn-fra \"Japanese-French FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-nld-deu \"Dutch-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-nld \"English-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-por \"German-Portuguese FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-hrv \"English-Croatian FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-mkd-bul \"Macedonian - Bulgarian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-eng \"Swedish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-spa \"j\xC4\x99zyk polski-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-jpn-eng \"Japanese-English FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-ell \"English - Modern Greek XDXF/FreeDict dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-por \"italiano-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-swe \"j\xC4\x99zyk polski-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-fin \"j\xC4\x99zyk polski-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-kur-tur \"Kurdish-Turkish Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-swe \"italiano-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-swh \"English-Swahili xFried/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-kha-eng \"Khasi-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fin-eng \"suomi-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-hin \"English-Hindi FreeDict Dictionary ver. 1.6\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-spa-eng \"Spanish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-afr-eng \"Afrikaans-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-fin \"italiano-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-fin \"English-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-ita \"fran\xC3\xA7""ais-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-rus \"Deutsch-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-bul \"Deutsch-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-pol \"Deutsch-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-kur-deu \"Kurdish-German Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-spa-por \"Spanish-Portuguese FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-pol \"Svenska-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-rus \"Svenska-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-nld-spa \"Nederlands-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swh-pol \"Swahili-Polish SSSP/FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-oci-cat \"Lenga d'\xC3\xB2""c - Catal\xC3\xA0 FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-rus \"italiano-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-ell \"fran\xC3\xA7""ais-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-srp \"English-Serbian FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-tur \"fran\xC3\xA7""ais-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-eng \"French-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-ita-ell \"italiano-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-kur-eng \"Kurdish-English Ferheng/FreeDict Dictionary ver. 1.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-deu \"Svenska-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-fra \"Svenska-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-lat \"Svenska-latine FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-ell \"Svenska-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-rus \"English-Russian FreeDict Dictionary ver. 0.3.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-por \"j\xC4\x99zyk polski-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-gla-deu \"Scottish Gaelic-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-ita \"English-Italian FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-pol-ita \"j\xC4\x99zyk polski-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-swe \"fran\xC3\xA7""ais-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-isl-eng \"\xC3\xADslenska - English FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-spa \"Svenska-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-nno-nob \"Norwegian Nynorsk-Norwegian Bokm\xC3\xA5l FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swe-ita \"Svenska-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-deu \"fran\xC3\xA7""ais-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fin-ita \"suomi-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-nld-fra \"Nederlands-French FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-eng-ara \"English-Arabic FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-slk-eng \"Slovak-English FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fra-por \"fran\xC3\xA7""ais-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-spa-ast \"Spanish - Asturian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fin-jpn \"suomi-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-deu-ita \"German-Italian FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-swh-eng \"Swahili-English xFried/FreeDict Dictionary ver. 0.4.4\"\r\n" +Debug: 05-18 22:11:42 receive db: "fd-fin-nor \"suomi-Norsk FreeDict+WikDict dictionary ver. 2018" +Debug: 05-18 22:11:42 received: ".09.13\"\r\n" +Debug: 05-18 22:11:42 receive db: ".09.13\"\r\n" +Debug: 05-18 22:11:42 received: "fd-fra-nld \"French-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:11:54 Reloading all the tabs... +Debug: 05-18 22:11:54 starting create the fts with thread: 11 +Debug: 05-18 22:11:54 waiting for all the fts creation to finish. +Debug: 05-18 22:11:54 finished/cancel all the fts creation +Debug: 05-18 22:11:54 getResource: "gdlookup://localhost/?word=: 猿猴捉月&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:11:54 scheme: "gdlookup" +Debug: 05-18 22:11:54 host: "localhost" +Debug: 05-18 22:11:54 clear current dictionaries: ": 猿猴捉月" +Debug: 05-18 22:11:54 some body finished +Debug: 05-18 22:11:54 one not finished. +Debug: 05-18 22:11:54 ====reading 1417 of (1417) bytes . Finished: 0 +Debug: 05-18 22:11:54 ====reading 0 of (1417) bytes . Finished: 0 +Debug: 05-18 22:11:54 ====reading 0 of (1417) bytes . Finished: 0 +Warning: 05-18 22:11:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:11:56 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:11:56 scheme: "gdlookup" +Debug: 05-18 22:11:56 host: "localhost" +Debug: 05-18 22:11:56 clear current dictionaries: "納得が行く" +Debug: 05-18 22:11:56 some body finished +Debug: 05-18 22:11:56 one not finished. +Debug: 05-18 22:11:56 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 22:11:56 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 22:11:56 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 22:11:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:12:20 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:12:20 scheme: "gdlookup" +Debug: 05-18 22:12:20 host: "localhost" +Debug: 05-18 22:12:20 clear current dictionaries: "違和感" +Debug: 05-18 22:12:20 some body finished +Debug: 05-18 22:12:20 one not finished. +Debug: 05-18 22:12:20 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 22:12:20 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 22:12:20 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 22:12:20 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:12:23 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:12:23 scheme: "gdlookup" +Debug: 05-18 22:12:23 host: "localhost" +Debug: 05-18 22:12:23 clear current dictionaries: "ゆっくり" +Debug: 05-18 22:12:23 some body finished +Debug: 05-18 22:12:23 one not finished. +Debug: 05-18 22:12:23 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 22:12:23 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 22:12:23 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 22:12:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:12:23 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:12:23 scheme: "gdlookup" +Debug: 05-18 22:12:23 host: "localhost" +Debug: 05-18 22:12:23 clear current dictionaries: "違和感" +Debug: 05-18 22:12:23 some body finished +Debug: 05-18 22:12:23 one not finished. +Debug: 05-18 22:12:23 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 22:12:23 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 22:12:23 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 22:12:23 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:13:02 translating from clipboard or selection +Debug: 05-18 22:13:02 clipboard data: "lofiga3778@huleos.com" +Debug: 05-18 22:13:02 Current state: true true false true +Debug: 05-18 22:13:02 translating from clipboard or selection +Debug: 05-18 22:13:02 clipboard data: "lofiga3778@huleos.com" +Debug: 05-18 22:13:02 Current state: true false false true +Debug: 05-18 22:13:02 getResource: "gdlookup://localhost/?word=lofiga3778@huleos.com&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:13:02 scheme: "gdlookup" +Debug: 05-18 22:13:02 host: "localhost" +Debug: 05-18 22:13:02 clear current dictionaries: "lofiga3778@huleos.com" +Debug: 05-18 22:13:02 some body finished +Debug: 05-18 22:13:02 one not finished. +Debug: 05-18 22:13:02 ====reading 1424 of (1424) bytes . Finished: 0 +Debug: 05-18 22:13:02 ====reading 0 of (1424) bytes . Finished: 0 +Debug: 05-18 22:13:02 ====reading 0 of (1424) bytes . Finished: 0 +Warning: 05-18 22:13:02 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:14:56 translating from clipboard or selection +Debug: 05-18 22:14:56 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
            \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
            \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
            \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
              \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
            • \" + alt + \"
            • \";\n }\n output_html += \"
            \";\n }\n\n output_html += \"
            \"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
            \" + removed_char + \"
            \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
            \"; \n output_html += \"
            \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 22:14:56 Current state: true false true true +Debug: 05-18 22:14:56 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:14:56 scheme: "gdlookup" +Debug: 05-18 22:14:56 host: "localhost" +Debug: 05-18 22:14:56 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
            \"; std::string sentence_copy = sentence; output_html += \"
            \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
            \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
              \"; for (const auto& alt : alt_itr->second) { output_html += \"
            • \" + alt + \"
            • \"; } output_html += \"
            \"; } output_html += \"
            \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
            \" + removed_char + \"
            \"; sentence_copy = new_sentence_copy; } } output_html += \"
            \"; output_html += \"
            \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:14:56 some body finished +Debug: 05-18 22:14:56 one not finished. +Debug: 05-18 22:14:56 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 22:14:56 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 22:14:56 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 22:14:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:14:56 translating from clipboard or selection +Debug: 05-18 22:14:56 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
            \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
            \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
            \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
              \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
            • \" + alt + \"
            • \";\n }\n output_html += \"
            \";\n }\n\n output_html += \"
            \"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
            \" + removed_char + \"
            \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
            \"; \n output_html += \"
            \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 22:14:56 Current state: true false true true +Debug: 05-18 22:14:56 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:14:56 scheme: "gdlookup" +Debug: 05-18 22:14:56 host: "localhost" +Debug: 05-18 22:14:56 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
            \"; std::string sentence_copy = sentence; output_html += \"
            \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
            \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
              \"; for (const auto& alt : alt_itr->second) { output_html += \"
            • \" + alt + \"
            • \"; } output_html += \"
            \"; } output_html += \"
            \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
            \" + removed_char + \"
            \"; sentence_copy = new_sentence_copy; } } output_html += \"
            \"; output_html += \"
            \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:14:56 some body finished +Debug: 05-18 22:14:56 one not finished. +Debug: 05-18 22:14:56 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 22:14:56 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 22:14:56 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 22:14:56 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:14:57 translating from clipboard or selection +Debug: 05-18 22:14:57 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
            \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
            \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
            \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
              \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
            • \" + alt + \"
            • \";\n }\n output_html += \"
            \";\n }\n\n output_html += \"
            \"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
            \" + removed_char + \"
            \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
            \"; \n output_html += \"
            \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 22:14:57 Current state: true false true true +Debug: 05-18 22:14:57 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:14:57 scheme: "gdlookup" +Debug: 05-18 22:14:57 host: "localhost" +Debug: 05-18 22:14:57 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
            \"; std::string sentence_copy = sentence; output_html += \"
            \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
            \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
              \"; for (const auto& alt : alt_itr->second) { output_html += \"
            • \" + alt + \"
            • \"; } output_html += \"
            \"; } output_html += \"
            \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
            \" + removed_char + \"
            \"; sentence_copy = new_sentence_copy; } } output_html += \"
            \"; output_html += \"
            \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:14:57 some body finished +Debug: 05-18 22:14:57 one not finished. +Debug: 05-18 22:14:57 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 22:14:57 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 22:14:57 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 22:14:57 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:15:05 translating from clipboard or selection +Debug: 05-18 22:15:05 clipboard data: "assert that" +Debug: 05-18 22:15:05 Current state: true false true true +Debug: 05-18 22:15:05 getResource: "gdlookup://localhost/?word=assert that&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:15:05 scheme: "gdlookup" +Debug: 05-18 22:15:05 host: "localhost" +Debug: 05-18 22:15:05 clear current dictionaries: "assert that" +Debug: 05-18 22:15:05 some body finished +Debug: 05-18 22:15:05 one not finished. +Debug: 05-18 22:15:05 ====reading 1414 of (1414) bytes . Finished: 0 +Debug: 05-18 22:15:05 ====reading 0 of (1414) bytes . Finished: 0 +Debug: 05-18 22:15:05 ====reading 0 of (1414) bytes . Finished: 0 +Warning: 05-18 22:15:05 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:17:03 translating from clipboard or selection +Debug: 05-18 22:17:03 clipboard data: "@@ -144,7 +144,8 @@\n \n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n- bool goldendict_mode = false;\n+ bool goldendict_mode = false;\n+ std::string word, sentence;\n std::string dict_file;\n \n log_internal(\"Program started\");\n@@ -163,9 +164,11 @@\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n+ if (!std::filesystem::exists(dict_file)) {\n+ log_internal(\"Error: Dictionary file not found at \" + dict_file);\n+ std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n+ return 1;\n+ }\n i++; // Skip the next argument as it's the dictionary file path\n- } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n- goldendict_mode = true;\n- log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n@@ -172,10 +173,16 @@\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n+ } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n+ goldendict_mode = true;\n+ log_internal(\"GoldenDict mode enabled\");\n }\n }\n \n- std::string search_string = get_input(argc, argv, goldendict_mode);\n+ try {\n+ dict_file = find_dic_file().string(); // Default dictionary file path\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n \n log_internal(\"Dictionary file located at: \" + dict_file);\n \n@@ -183,8 +190,8 @@\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n- std::cerr << \"Error: \" << e.what() << std::endl;\n- return 1;\n+ std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n+ exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n@@ -196,10 +203,19 @@\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n- const auto trie = xcdat::load(dict_file);\n- log_internal(\"Trie loaded from dictionary file\");\n+ xcdat::trie_15_type trie;\n+ try {\n+ trie = xcdat::load(dict_file);\n+ log_internal(\"Trie loaded from dictionary file\");\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n+ std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n+ return 1;\n+ }\n \n std::vector substrings;\n+ std::vector results;\n+ std::map> derived_map;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n@@ -207,14 +223,19 @@\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n+ log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n+ log_internal(\"Substring added: \" + substring);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n@@ -238,14 +259,21 @@\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n+ log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n+ log_internal(\"New search string: \" + search_string);\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n+ raw_output += search_string + '\\n';\n+ }\n+ results.clear();\n+\n+ // Remove leading whitespace\n+ search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n // Print debug information if in debug mode\n@@ -262,8 +290,8 @@\n \n log_internal(\"Program finished\");\n- return 0;\n }\n \n+ return 0;\n }\n" +Debug: 05-18 22:17:03 Current state: true false true true +Debug: 05-18 22:17:03 getResource: "gdlookup://localhost/?word=@@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; - bool goldendict_mode %3D false; + bool goldendict_mode %3D false; + std::string word, sentence; std::string dict_file; log_internal(%22Program started%22); @@ -163,9 +164,11 @@ %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); + if (!std::filesystem::exists(dict_file)) %7B + log_internal(%22Error: Dictionary file not found at %22 + dict_file); + std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; + return 1; + %7D i++; // Skip the next argument as it%27s the dictionary file path - %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B - goldendict_mode %3D true; - log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); @@ -172,10 +173,16 @@ sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; + %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B + goldendict_mode %3D true; + log_internal(%22GoldenDict mode enabled%22); %7D %7D - std::string search_string %3D get_input(argc, argv, goldendict_mode); + try %7B + dict_file %3D find_dic_file().string(); // Default dictionary file path + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D log_internal(%22Dictionary file located at: %22 + dict_file); @@ -183,8 +190,8 @@ log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); - std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; - return 1; + std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; + exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B @@ -196,10 +203,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); - log_internal(%22Trie loaded from dictionary file%22); + xcdat::trie_15_type trie; + try %7B + trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); + log_internal(%22Trie loaded from dictionary file%22); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); + std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; + return 1; + %7D std::vector%3Cstd::string%3E substrings; + std::vector%3CEntry%3E results; + std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B @@ -207,14 +223,19 @@ while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); + log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); + log_internal(%22Substring added: %22 + substring); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; @@ -238,14 +259,21 @@ if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; + log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; + log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; + raw_output +%3D search_string + %27%5Cn%27; + %7D + results.clear(); + + // Remove leading whitespace + search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode @@ -262,8 +290,8 @@ log_internal(%22Program finished%22); - return 0; %7D + return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:17:03 scheme: "gdlookup" +Debug: 05-18 22:17:03 host: "localhost" +Debug: 05-18 22:17:03 clear current dictionaries: "@@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) { bool debug_mode = false; - bool goldendict_mode = false; + bool goldendict_mode = false; + std::string word, sentence; std::string dict_file; log_internal(\"Program started\"); @@ -163,9 +164,11 @@ } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); + if (!std::filesystem::exists(dict_file)) { + log_internal(\"Error: Dictionary file not found at \" + dict_file); + std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; + return 1; + } i++; // Skip the next argument as it's the dictionary file path - } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { - goldendict_mode = true; - log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); @@ -172,10 +173,16 @@ sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; + } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { + goldendict_mode = true; + log_internal(\"GoldenDict mode enabled\"); } } - std::string search_string = get_input(argc, argv, goldendict_mode); + try { + dict_file = find_dic_file().string(); // Default dictionary file path + } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } log_internal(\"Dictionary file located at: \" + dict_file); @@ -183,8 +190,8 @@ log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); - std::cerr << \"Error: \" << e.what() << std::endl; - return 1; + std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; + exit(1); } if (goldendict_mode && !sentence.empty()) { @@ -196,10 +203,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie = xcdat::load(dict_file); - log_internal(\"Trie loaded from dictionary file\"); + xcdat::trie_15_type trie; + try { + trie = xcdat::load(dict_file); + log_internal(\"Trie loaded from dictionary file\"); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); + std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; + return 1; + } std::vector substrings; + std::vector results; + std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { @@ -207,14 +223,19 @@ while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); + log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); + log_internal(\"Substring added: \" + substring); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; @@ -238,14 +259,21 @@ if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; + log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; + log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; + raw_output += search_string + '\\n'; + } + results.clear(); + + // Remove leading whitespace + search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode @@ -262,8 +290,8 @@ log_internal(\"Program finished\"); - return 0; } + return 0; }" +Debug: 05-18 22:17:03 some body finished +Debug: 05-18 22:17:03 one not finished. +Debug: 05-18 22:17:03 ====reading 6003 of (6003) bytes . Finished: 0 +Debug: 05-18 22:17:03 ====reading 0 of (6003) bytes . Finished: 0 +Debug: 05-18 22:17:03 ====reading 0 of (6003) bytes . Finished: 0 +Warning: 05-18 22:17:03 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:17:06 translating from clipboard or selection +Debug: 05-18 22:17:06 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
            \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
            \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
            \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
              \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
            • \" + alt + \"
            • \";\n }\n output_html += \"
            \";\n }\n\n output_html += \"
            \"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
            \" + removed_char + \"
            \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
            \"; \n output_html += \"
            \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 22:17:06 Current state: true false true true +Debug: 05-18 22:17:06 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:17:06 scheme: "gdlookup" +Debug: 05-18 22:17:06 host: "localhost" +Debug: 05-18 22:17:06 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
            \"; std::string sentence_copy = sentence; output_html += \"
            \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
            \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
              \"; for (const auto& alt : alt_itr->second) { output_html += \"
            • \" + alt + \"
            • \"; } output_html += \"
            \"; } output_html += \"
            \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
            \" + removed_char + \"
            \"; sentence_copy = new_sentence_copy; } } output_html += \"
            \"; output_html += \"
            \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:17:06 some body finished +Debug: 05-18 22:17:06 one not finished. +Debug: 05-18 22:17:06 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 22:17:06 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 22:17:06 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 22:17:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:17:07 translating from clipboard or selection +Debug: 05-18 22:17:07 clipboard data: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
            \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
            \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
            \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
              \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
            • \" + alt + \"
            • \";\n }\n output_html += \"
            \";\n }\n\n output_html += \"
            \"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
            \" + removed_char + \"
            \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
            \"; \n output_html += \"
            \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 22:17:07 Current state: true false true true +Debug: 05-18 22:17:07 getResource: "gdlookup://localhost/?word=%23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:17:07 scheme: "gdlookup" +Debug: 05-18 22:17:07 host: "localhost" +Debug: 05-18 22:17:07 clear current dictionaries: "#include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
            \"; std::string sentence_copy = sentence; output_html += \"
            \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
            \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
              \"; for (const auto& alt : alt_itr->second) { output_html += \"
            • \" + alt + \"
            • \"; } output_html += \"
            \"; } output_html += \"
            \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
            \" + removed_char + \"
            \"; sentence_copy = new_sentence_copy; } } output_html += \"
            \"; output_html += \"
            \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:17:07 some body finished +Debug: 05-18 22:17:07 one not finished. +Debug: 05-18 22:17:07 ====reading 13494 of (13494) bytes . Finished: 0 +Debug: 05-18 22:17:07 ====reading 0 of (13494) bytes . Finished: 0 +Debug: 05-18 22:17:07 ====reading 0 of (13494) bytes . Finished: 0 +Warning: 05-18 22:17:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:17:14 translating from clipboard or selection +Debug: 05-18 22:17:14 clipboard data: "diff --git a/hakurei.cpp b/hakurei.cpp\nindex 1234567..89abcde 100644\n--- a/hakurei.cpp\n+++ b/hakurei.cpp\n@@ -1,6 +1,7 @@\n #include \n #include \n #include \n+#include \n #include \n #include \n #include \n@@ -9,6 +10,7 @@\n #include \n #include \n #include \n+#include \n #include \n \n struct Entry {\n@@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n+ log_internal(\"Received search string from stdin: \" + search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n@@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n search_string = argv[i + 1];\n break;\n }\n+ log_internal(\"Received search string from command line in goldendict mode: \" + search_string);\n }\n } else {\n if (argc < 2) {\n@@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n+ log_internal(\"Parsing command line arguments\");\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n@@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n+ log_internal(\"Search string not provided\");\n exit(1);\n }\n return search_string;\n@@ -131,12 +138,18 @@ inline void wrap_html_output(\n output_html += \"
            \";\n \n std::string sentence_copy = sentence;\n+ log_internal(\"HTML output is being called\");\n \n output_html += \"
            \"; \n \n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n+ log_internal(\"Processing substring: \" + substring);\n if (sentence_copy.rfind(substring, 0) == 0) {\n+ log_internal(\"Found substring match: \" + substring);\n output_html += \"
            \" + substring + \"\";\n \n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
              \";\n@@ -179,6 +192,8 @@ inline void wrap_html_output(\n found = true;\n break;\n }\n+ log_internal(\"No match found for substring: \" + substring);\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n+ log_internal(\"Removed one UTF-8 character: \" + removed_char);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\");\n@@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string& search_strin\n }\n \n void log_internal(const std::string& message) {\n+ log_internal(\"Logging message: \" + message);\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n@@ -283,6 +299,17 @@ void log_internal(const std::string& message) {\n }\n \n std::string get_current_time() {\n+ std::time_t now = std::time(nullptr);\n+ char buf[80];\n+ std::strftime(buf, sizeof(buf), \"%Y-%m-%d %H:%M:%S\", std::localtime(&now));\n+ return std::string(buf);\n+}\n+\n+int main(const int argc, char* argv[]) {\n+ bool debug_mode = false;\n+ bool goldendict_mode = false;\n+ std::string word, sentence;\n+ std::string dict_file = find_dic_file().string(); // Default dictionary file path\n \n log_internal(\"Program started at \" + get_current_time());\n \n@@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) {\n \n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string + \" at \" + get_current_time());\n+ log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string + \" at \" + get_current_time());\n@@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) {\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n+ log_internal(\"Current search string: \" + search_string);\n auto itr = trie.make_prefix_iterator(search_string);\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()) + \" at \" + get_current_time());\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n@@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) {\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring + \" at \" + get_current_time());\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n \n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char + \" at \" + get_current_time());\n \n@@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at \" + get_current_time());\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string + \" at \" + get_current_time());\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n@@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) {\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n \n log_internal(\"Program finished at \" + get_current_time());\n return 0;\n }\n" +Debug: 05-18 22:17:14 Current state: true false true true +Debug: 05-18 22:17:14 getResource: "gdlookup://localhost/?word=diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E +%23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E @@ -9,6 +10,7 @@ %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E +%23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B @@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); + log_internal(%22Received search string from stdin: %22 + search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B @@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold search_string %3D argv[i + 1]; break; %7D + log_internal(%22Received search string from command line in goldendict mode: %22 + search_string); %7D %7D else %7B if (argc %3C 2) %7B @@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B + log_internal(%22Parsing command line arguments%22); if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B @@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; + log_internal(%22Search string not provided%22); exit(1); %7D return search_string; @@ -131,12 +138,18 @@ inline void wrap_html_output( output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; + log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B + log_internal(%22Processing substring: %22 + substring); if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B + log_internal(%22Found substring match: %22 + substring); output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; @@ -179,6 +192,8 @@ inline void wrap_html_output( found %3D true; break; %7D + log_internal(%22No match found for substring: %22 + substring); %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); + log_internal(%22Removed one UTF-8 character: %22 + removed_char); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22); @@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string%26 search_strin %7D void log_internal(const std::string%26 message) %7B + log_internal(%22Logging message: %22 + message); std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B @@ -283,6 +299,17 @@ void log_internal(const std::string%26 message) %7B %7D std::string get_current_time() %7B + std::time_t now %3D std::time(nullptr); + char buf[80]; + std::strftime(buf, sizeof(buf), %22%25Y-%25m-%25d %25H:%25M:%25S%22, std::localtime(%26now)); + return std::string(buf); +%7D + +int main(const int argc, char* argv[]) %7B + bool debug_mode %3D false; + bool goldendict_mode %3D false; + std::string word, sentence; + std::string dict_file %3D find_dic_file().string(); // Default dictionary file path log_internal(%22Program started at %22 + get_current_time()); @@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) %7B std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string + %22 at %22 + get_current_time()); + log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string + %22 at %22 + get_current_time()); @@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) %7B std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B + log_internal(%22Current search string: %22 + search_string); auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view()) + %22 at %22 + get_current_time()); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); @@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) %7B alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring + %22 at %22 + get_current_time()); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char + %22 at %22 + get_current_time()); @@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at %22 + get_current_time()); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string + %22 at %22 + get_current_time()); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); @@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) %7B // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished at %22 + get_current_time()); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:17:14 scheme: "gdlookup" +Debug: 05-18 22:17:14 host: "localhost" +Debug: 05-18 22:17:14 clear current dictionaries: "diff --git a/hakurei.cpp b/hakurei.cpp index 1234567..89abcde 100644 --- a/hakurei.cpp +++ b/hakurei.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include struct Entry { @@ -63,6 +65,8 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); + log_internal(\"Received search string from stdin: \" + search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { @@ -71,6 +75,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold search_string = argv[i + 1]; break; } + log_internal(\"Received search string from command line in goldendict mode: \" + search_string); } } else { if (argc < 2) { @@ -79,6 +84,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold exit(1); } for (int i = 1; i < argc; ++i) { + log_internal(\"Parsing command line arguments\"); if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { @@ -92,6 +98,7 @@ inline std::string get_input(const int argc, char* const argv[], const bool gold } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; + log_internal(\"Search string not provided\"); exit(1); } return search_string; @@ -131,12 +138,18 @@ inline void wrap_html_output( output_html += \"
              \"; std::string sentence_copy = sentence; + log_internal(\"HTML output is being called\"); output_html += \"
              \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { + log_internal(\"Processing substring: \" + substring); if (sentence_copy.rfind(substring, 0) == 0) { + log_internal(\"Found substring match: \" + substring); output_html += \"
              \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                \"; @@ -179,6 +192,8 @@ inline void wrap_html_output( found = true; break; } + log_internal(\"No match found for substring: \" + substring); } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); + log_internal(\"Removed one UTF-8 character: \" + removed_char); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\"); @@ -271,6 +286,7 @@ void log_execution(const int argc, char* argv[], const std::string& search_strin } void log_internal(const std::string& message) { + log_internal(\"Logging message: \" + message); std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { @@ -283,6 +299,17 @@ void log_internal(const std::string& message) { } std::string get_current_time() { + std::time_t now = std::time(nullptr); + char buf[80]; + std::strftime(buf, sizeof(buf), \"%Y-%m-%d %H:%M:%S\", std::localtime(&now)); + return std::string(buf); +} + +int main(const int argc, char* argv[]) { + bool debug_mode = false; + bool goldendict_mode = false; + std::string word, sentence; + std::string dict_file = find_dic_file().string(); // Default dictionary file path log_internal(\"Program started at \" + get_current_time()); @@ -331,6 +358,7 @@ int main(const int argc, char* argv[]) { std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string + \" at \" + get_current_time()); + log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string + \" at \" + get_current_time()); @@ -372,12 +400,14 @@ int main(const int argc, char* argv[]) { std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { + log_internal(\"Current search string: \" + search_string); auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view()) + \" at \" + get_current_time()); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); @@ -385,6 +415,7 @@ int main(const int argc, char* argv[]) { alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring + \" at \" + get_current_time()); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char + \" at \" + get_current_time()); @@ -402,6 +433,7 @@ int main(const int argc, char* argv[]) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop. at \" + get_current_time()); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string + \" at \" + get_current_time()); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); @@ -418,6 +450,7 @@ int main(const int argc, char* argv[]) { // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished at \" + get_current_time()); return 0; }" +Debug: 05-18 22:17:14 some body finished +Debug: 05-18 22:17:14 one not finished. +Debug: 05-18 22:17:14 ====reading 8565 of (8565) bytes . Finished: 0 +Debug: 05-18 22:17:14 ====reading 0 of (8565) bytes . Finished: 0 +Debug: 05-18 22:17:14 ====reading 0 of (8565) bytes . Finished: 0 +Warning: 05-18 22:17:14 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:19:04 translating from clipboard or selection +Debug: 05-18 22:19:04 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -174,6 +174,12 @@\n try {\n dict_file = find_dic_file().string(); // Default dictionary file path\n } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n+\n+ log_internal(\"Dictionary file located at: \" + dict_file);\n \n std::string search_string;\n try {\n@@ -182,8 +188,8 @@\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n- std::cerr << \"Error: \" << e.what() << std::endl;\n- return 1;\n+ std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n+ exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n@@ -195,10 +201,19 @@\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n- const auto trie = xcdat::load(dict_file);\n- log_internal(\"Trie loaded from dictionary file\");\n+ xcdat::trie_15_type trie;\n+ try {\n+ trie = xcdat::load(dict_file);\n+ log_internal(\"Trie loaded from dictionary file\");\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n+ std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n+ return 1;\n+ }\n \n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n@@ -225,12 +240,16 @@\n \n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n \n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n \n@@ -241,11 +260,15 @@\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n \n@@ -256,6 +279,6 @@\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n \n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:19:04 Current state: true true false true +Debug: 05-18 22:19:04 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -174,6 +174,12 @@ try %7B dict_file %3D find_dic_file().string(); // Default dictionary file path %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D + + log_internal(%22Dictionary file located at: %22 + dict_file); std::string search_string; try %7B @@ -182,8 +188,8 @@ log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); - std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; - return 1; + std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; + exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B @@ -195,10 +201,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); - log_internal(%22Trie loaded from dictionary file%22); + xcdat::trie_15_type trie; + try %7B + trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); + log_internal(%22Trie loaded from dictionary file%22); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); + std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; + return 1; + %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B @@ -225,12 +240,16 @@ const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); @@ -241,11 +260,15 @@ raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D @@ -256,6 +279,6 @@ // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:19:04 scheme: "gdlookup" +Debug: 05-18 22:19:04 host: "localhost" +Debug: 05-18 22:19:04 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -174,6 +174,12 @@ try { dict_file = find_dic_file().string(); // Default dictionary file path } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } + + log_internal(\"Dictionary file located at: \" + dict_file); std::string search_string; try { @@ -182,8 +188,8 @@ log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); - std::cerr << \"Error: \" << e.what() << std::endl; - return 1; + std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; + exit(1); } if (goldendict_mode && !sentence.empty()) { @@ -195,10 +201,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie = xcdat::load(dict_file); - log_internal(\"Trie loaded from dictionary file\"); + xcdat::trie_15_type trie; + try { + trie = xcdat::load(dict_file); + log_internal(\"Trie loaded from dictionary file\"); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); + std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; + return 1; + } std::vector substrings; std::vector results; std::map> alternatives_map; while (!search_string.empty()) { @@ -225,12 +240,16 @@ const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); @@ -241,11 +260,15 @@ raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } @@ -256,6 +279,6 @@ // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:19:04 some body finished +Debug: 05-18 22:19:04 one not finished. +Debug: 05-18 22:19:04 ====reading 4412 of (4412) bytes . Finished: 0 +Debug: 05-18 22:19:04 ====reading 0 of (4412) bytes . Finished: 0 +Debug: 05-18 22:19:04 ====reading 0 of (4412) bytes . Finished: 0 +Warning: 05-18 22:19:04 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:19:21 translating from clipboard or selection +Debug: 05-18 22:19:21 clipboard data: "@@ -144,7 +144,8 @@\n \n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n- bool goldendict_mode = false;\n+ bool goldendict_mode = false;\n+ std::string word, sentence;\n std::string dict_file;\n \n log_internal(\"Program started\");\n@@ -163,9 +164,11 @@\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n+ if (!std::filesystem::exists(dict_file)) {\n+ log_internal(\"Error: Dictionary file not found at \" + dict_file);\n+ std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n+ return 1;\n+ }\n i++; // Skip the next argument as it's the dictionary file path\n- } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n- goldendict_mode = true;\n- log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n@@ -172,10 +173,16 @@\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n+ } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n+ goldendict_mode = true;\n+ log_internal(\"GoldenDict mode enabled\");\n }\n }\n \n- std::string search_string = get_input(argc, argv, goldendict_mode);\n+ try {\n+ dict_file = find_dic_file().string(); // Default dictionary file path\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n \n log_internal(\"Dictionary file located at: \" + dict_file);\n \n@@ -183,8 +190,8 @@\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n- std::cerr << \"Error: \" << e.what() << std::endl;\n- return 1;\n+ std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n+ exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n@@ -196,10 +203,19 @@\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n- const auto trie = xcdat::load(dict_file);\n- log_internal(\"Trie loaded from dictionary file\");\n+ xcdat::trie_15_type trie;\n+ try {\n+ trie = xcdat::load(dict_file);\n+ log_internal(\"Trie loaded from dictionary file\");\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n+ std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n+ return 1;\n+ }\n \n std::vector substrings;\n+ std::vector results;\n+ std::map> derived_map;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n@@ -207,14 +223,19 @@\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n+ log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n+ log_internal(\"Substring added: \" + substring);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n@@ -238,14 +259,21 @@\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n+ log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n+ log_internal(\"New search string: \" + search_string);\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n+ raw_output += search_string + '\\n';\n+ }\n+ results.clear();\n+\n+ // Remove leading whitespace\n+ search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n // Print debug information if in debug mode\n@@ -262,8 +290,8 @@\n \n log_internal(\"Program finished\");\n- return 0;\n }\n \n+ return 0;\n }\n" +Debug: 05-18 22:19:21 Current state: true false false true +Debug: 05-18 22:19:21 getResource: "gdlookup://localhost/?word=@@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; - bool goldendict_mode %3D false; + bool goldendict_mode %3D false; + std::string word, sentence; std::string dict_file; log_internal(%22Program started%22); @@ -163,9 +164,11 @@ %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); + if (!std::filesystem::exists(dict_file)) %7B + log_internal(%22Error: Dictionary file not found at %22 + dict_file); + std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; + return 1; + %7D i++; // Skip the next argument as it%27s the dictionary file path - %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B - goldendict_mode %3D true; - log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); @@ -172,10 +173,16 @@ sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; + %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B + goldendict_mode %3D true; + log_internal(%22GoldenDict mode enabled%22); %7D %7D - std::string search_string %3D get_input(argc, argv, goldendict_mode); + try %7B + dict_file %3D find_dic_file().string(); // Default dictionary file path + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D log_internal(%22Dictionary file located at: %22 + dict_file); @@ -183,8 +190,8 @@ log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); - std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; - return 1; + std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; + exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B @@ -196,10 +203,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); - log_internal(%22Trie loaded from dictionary file%22); + xcdat::trie_15_type trie; + try %7B + trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); + log_internal(%22Trie loaded from dictionary file%22); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); + std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; + return 1; + %7D std::vector%3Cstd::string%3E substrings; + std::vector%3CEntry%3E results; + std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B @@ -207,14 +223,19 @@ while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); + log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); + log_internal(%22Substring added: %22 + substring); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; @@ -238,14 +259,21 @@ if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; + log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; + log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; + raw_output +%3D search_string + %27%5Cn%27; + %7D + results.clear(); + + // Remove leading whitespace + search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode @@ -262,8 +290,8 @@ log_internal(%22Program finished%22); - return 0; %7D + return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:19:21 scheme: "gdlookup" +Debug: 05-18 22:19:21 host: "localhost" +Debug: 05-18 22:19:21 clear current dictionaries: "@@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) { bool debug_mode = false; - bool goldendict_mode = false; + bool goldendict_mode = false; + std::string word, sentence; std::string dict_file; log_internal(\"Program started\"); @@ -163,9 +164,11 @@ } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); + if (!std::filesystem::exists(dict_file)) { + log_internal(\"Error: Dictionary file not found at \" + dict_file); + std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; + return 1; + } i++; // Skip the next argument as it's the dictionary file path - } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { - goldendict_mode = true; - log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); @@ -172,10 +173,16 @@ sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; + } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { + goldendict_mode = true; + log_internal(\"GoldenDict mode enabled\"); } } - std::string search_string = get_input(argc, argv, goldendict_mode); + try { + dict_file = find_dic_file().string(); // Default dictionary file path + } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } log_internal(\"Dictionary file located at: \" + dict_file); @@ -183,8 +190,8 @@ log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); - std::cerr << \"Error: \" << e.what() << std::endl; - return 1; + std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; + exit(1); } if (goldendict_mode && !sentence.empty()) { @@ -196,10 +203,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie = xcdat::load(dict_file); - log_internal(\"Trie loaded from dictionary file\"); + xcdat::trie_15_type trie; + try { + trie = xcdat::load(dict_file); + log_internal(\"Trie loaded from dictionary file\"); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); + std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; + return 1; + } std::vector substrings; + std::vector results; + std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { @@ -207,14 +223,19 @@ while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); + log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); + log_internal(\"Substring added: \" + substring); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; @@ -238,14 +259,21 @@ if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; + log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; + log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; + raw_output += search_string + '\\n'; + } + results.clear(); + + // Remove leading whitespace + search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode @@ -262,8 +290,8 @@ log_internal(\"Program finished\"); - return 0; } + return 0; }" +Debug: 05-18 22:19:21 some body finished +Debug: 05-18 22:19:21 one not finished. +Debug: 05-18 22:19:21 ====reading 6003 of (6003) bytes . Finished: 0 +Debug: 05-18 22:19:21 ====reading 0 of (6003) bytes . Finished: 0 +Debug: 05-18 22:19:21 ====reading 0 of (6003) bytes . Finished: 0 +Warning: 05-18 22:19:21 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:19:22 translating from clipboard or selection +Debug: 05-18 22:19:22 clipboard data: "@@ -144,7 +144,8 @@\n \n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n- bool goldendict_mode = false;\n+ bool goldendict_mode = false;\n+ std::string word, sentence;\n std::string dict_file;\n \n log_internal(\"Program started\");\n@@ -163,9 +164,11 @@\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n+ if (!std::filesystem::exists(dict_file)) {\n+ log_internal(\"Error: Dictionary file not found at \" + dict_file);\n+ std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n+ return 1;\n+ }\n i++; // Skip the next argument as it's the dictionary file path\n- } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n- goldendict_mode = true;\n- log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n@@ -172,10 +173,16 @@\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n+ } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n+ goldendict_mode = true;\n+ log_internal(\"GoldenDict mode enabled\");\n }\n }\n \n- std::string search_string = get_input(argc, argv, goldendict_mode);\n+ try {\n+ dict_file = find_dic_file().string(); // Default dictionary file path\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n \n log_internal(\"Dictionary file located at: \" + dict_file);\n \n@@ -183,8 +190,8 @@\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n- std::cerr << \"Error: \" << e.what() << std::endl;\n- return 1;\n+ std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n+ exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n@@ -196,10 +203,19 @@\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n- const auto trie = xcdat::load(dict_file);\n- log_internal(\"Trie loaded from dictionary file\");\n+ xcdat::trie_15_type trie;\n+ try {\n+ trie = xcdat::load(dict_file);\n+ log_internal(\"Trie loaded from dictionary file\");\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n+ std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n+ return 1;\n+ }\n \n std::vector substrings;\n+ std::vector results;\n+ std::map> derived_map;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n@@ -207,14 +223,19 @@\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n+ log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n+ log_internal(\"Substring added: \" + substring);\n alternatives_map[search_string].insert(substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n@@ -238,14 +259,21 @@\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n+ log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n+ log_internal(\"New search string: \" + search_string);\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n+ raw_output += search_string + '\\n';\n+ }\n+ results.clear();\n+\n+ // Remove leading whitespace\n+ search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n // Print debug information if in debug mode\n@@ -262,8 +290,8 @@\n \n log_internal(\"Program finished\");\n- return 0;\n }\n \n+ return 0;\n }\n" +Debug: 05-18 22:19:22 Current state: true false true true +Debug: 05-18 22:19:22 getResource: "gdlookup://localhost/?word=@@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; - bool goldendict_mode %3D false; + bool goldendict_mode %3D false; + std::string word, sentence; std::string dict_file; log_internal(%22Program started%22); @@ -163,9 +164,11 @@ %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); + if (!std::filesystem::exists(dict_file)) %7B + log_internal(%22Error: Dictionary file not found at %22 + dict_file); + std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; + return 1; + %7D i++; // Skip the next argument as it%27s the dictionary file path - %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B - goldendict_mode %3D true; - log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); @@ -172,10 +173,16 @@ sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; + %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B + goldendict_mode %3D true; + log_internal(%22GoldenDict mode enabled%22); %7D %7D - std::string search_string %3D get_input(argc, argv, goldendict_mode); + try %7B + dict_file %3D find_dic_file().string(); // Default dictionary file path + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D log_internal(%22Dictionary file located at: %22 + dict_file); @@ -183,8 +190,8 @@ log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); - std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; - return 1; + std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; + exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B @@ -196,10 +203,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); - log_internal(%22Trie loaded from dictionary file%22); + xcdat::trie_15_type trie; + try %7B + trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); + log_internal(%22Trie loaded from dictionary file%22); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); + std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; + return 1; + %7D std::vector%3Cstd::string%3E substrings; + std::vector%3CEntry%3E results; + std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B @@ -207,14 +223,19 @@ while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); + log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); + log_internal(%22Substring added: %22 + substring); alternatives_map[search_string].insert(substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; @@ -238,14 +259,21 @@ if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; + log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; + log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; + raw_output +%3D search_string + %27%5Cn%27; + %7D + results.clear(); + + // Remove leading whitespace + search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode @@ -262,8 +290,8 @@ log_internal(%22Program finished%22); - return 0; %7D + return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:19:22 scheme: "gdlookup" +Debug: 05-18 22:19:22 host: "localhost" +Debug: 05-18 22:19:22 clear current dictionaries: "@@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) { bool debug_mode = false; - bool goldendict_mode = false; + bool goldendict_mode = false; + std::string word, sentence; std::string dict_file; log_internal(\"Program started\"); @@ -163,9 +164,11 @@ } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); + if (!std::filesystem::exists(dict_file)) { + log_internal(\"Error: Dictionary file not found at \" + dict_file); + std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; + return 1; + } i++; // Skip the next argument as it's the dictionary file path - } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { - goldendict_mode = true; - log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); @@ -172,10 +173,16 @@ sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; + } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { + goldendict_mode = true; + log_internal(\"GoldenDict mode enabled\"); } } - std::string search_string = get_input(argc, argv, goldendict_mode); + try { + dict_file = find_dic_file().string(); // Default dictionary file path + } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } log_internal(\"Dictionary file located at: \" + dict_file); @@ -183,8 +190,8 @@ log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); - std::cerr << \"Error: \" << e.what() << std::endl; - return 1; + std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; + exit(1); } if (goldendict_mode && !sentence.empty()) { @@ -196,10 +203,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie = xcdat::load(dict_file); - log_internal(\"Trie loaded from dictionary file\"); + xcdat::trie_15_type trie; + try { + trie = xcdat::load(dict_file); + log_internal(\"Trie loaded from dictionary file\"); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); + std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; + return 1; + } std::vector substrings; + std::vector results; + std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { @@ -207,14 +223,19 @@ while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); + log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); + log_internal(\"Substring added: \" + substring); alternatives_map[search_string].insert(substring); if (!goldendict_mode) { std::cout << substring << std::endl; @@ -238,14 +259,21 @@ if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; + log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; + log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; + raw_output += search_string + '\\n'; + } + results.clear(); + + // Remove leading whitespace + search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode @@ -262,8 +290,8 @@ log_internal(\"Program finished\"); - return 0; } + return 0; }" +Debug: 05-18 22:19:22 some body finished +Debug: 05-18 22:19:22 one not finished. +Debug: 05-18 22:19:22 ====reading 6003 of (6003) bytes . Finished: 0 +Debug: 05-18 22:19:22 ====reading 0 of (6003) bytes . Finished: 0 +Debug: 05-18 22:19:22 ====reading 0 of (6003) bytes . Finished: 0 +Warning: 05-18 22:19:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:20:03 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:20:03 scheme: "gdlookup" +Debug: 05-18 22:20:03 host: "localhost" +Debug: 05-18 22:20:03 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 22:20:03 some body finished +Debug: 05-18 22:20:03 one not finished. +Debug: 05-18 22:20:03 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 22:20:03 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 22:20:03 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 22:20:03 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:20:10 translating from clipboard or selection +Debug: 05-18 22:20:10 clipboard data: "tmp/dict.bi" +Debug: 05-18 22:20:10 Current state: true false false true +Debug: 05-18 22:20:10 getResource: "gdlookup://localhost/?word=tmp/dict.bi&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:20:10 scheme: "gdlookup" +Debug: 05-18 22:20:10 host: "localhost" +Debug: 05-18 22:20:10 clear current dictionaries: "tmp/dict.bi" +Debug: 05-18 22:20:10 some body finished +Debug: 05-18 22:20:10 one not finished. +Debug: 05-18 22:20:10 ====reading 1414 of (1414) bytes . Finished: 0 +Debug: 05-18 22:20:10 ====reading 0 of (1414) bytes . Finished: 0 +Debug: 05-18 22:20:10 ====reading 0 of (1414) bytes . Finished: 0 +Warning: 05-18 22:20:10 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:20:13 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:20:13 scheme: "gdlookup" +Debug: 05-18 22:20:13 host: "localhost" +Debug: 05-18 22:20:13 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 22:20:13 some body finished +Debug: 05-18 22:20:13 one not finished. +Debug: 05-18 22:20:13 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 22:20:13 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:20:13 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 22:20:13 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:21:10 translating from clipboard or selection +Debug: 05-18 22:21:10 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -144,7 +144,8 @@\n \n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n- bool goldendict_mode = false;\n+ bool goldendict_mode = false;\n+ std::string word, sentence;\n std::string dict_file;\n\n+ log_internal(\"Program started\");\n \n+ // Check for the dictionary file\n+ try {\n+ dict_file = find_dic_file().string(); // Default dictionary file path\n+ log_internal(\"Dictionary file located at: \" + dict_file);\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n \n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n+ if (!std::filesystem::exists(dict_file)) {\n+ log_internal(\"Error: Dictionary file not found at \" + dict_file);\n+ std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n+ return 1;\n+ }\n i++; // Skip the next argument as it's the dictionary file path\n+ } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n+ goldendict_mode = true;\n+ log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n \n std::string search_string;\n try {\n search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n xcdat::trie_15_type trie;\n try {\n trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n return 1;\n }\n \n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n \n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n \n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n \n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:21:10 Current state: true true false true +Debug: 05-18 22:21:10 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; - bool goldendict_mode %3D false; + bool goldendict_mode %3D false; + std::string word, sentence; std::string dict_file; + log_internal(%22Program started%22); + // Check for the dictionary file + try %7B + dict_file %3D find_dic_file().string(); // Default dictionary file path + log_internal(%22Dictionary file located at: %22 + dict_file); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); + if (!std::filesystem::exists(dict_file)) %7B + log_internal(%22Error: Dictionary file not found at %22 + dict_file); + std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; + return 1; + %7D i++; // Skip the next argument as it%27s the dictionary file path + %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B + goldendict_mode %3D true; + log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string; try %7B search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try %7B trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; return 1; %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:21:10 scheme: "gdlookup" +Debug: 05-18 22:21:10 host: "localhost" +Debug: 05-18 22:21:10 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) { bool debug_mode = false; - bool goldendict_mode = false; + bool goldendict_mode = false; + std::string word, sentence; std::string dict_file; + log_internal(\"Program started\"); + // Check for the dictionary file + try { + dict_file = find_dic_file().string(); // Default dictionary file path + log_internal(\"Dictionary file located at: \" + dict_file); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); + if (!std::filesystem::exists(dict_file)) { + log_internal(\"Error: Dictionary file not found at \" + dict_file); + std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; + return 1; + } i++; // Skip the next argument as it's the dictionary file path + } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { + goldendict_mode = true; + log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string; try { search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; exit(1); } if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try { trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); } catch (const std::exception& e) { log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; return 1; } std::vector substrings; std::vector results; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:21:10 some body finished +Debug: 05-18 22:21:10 one not finished. +Debug: 05-18 22:21:10 ====reading 6527 of (6527) bytes . Finished: 0 +Debug: 05-18 22:21:10 ====reading 0 of (6527) bytes . Finished: 0 +Debug: 05-18 22:21:10 ====reading 0 of (6527) bytes . Finished: 0 +Warning: 05-18 22:21:10 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:21:18 translating from clipboard or selection +Debug: 05-18 22:21:18 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -174,6 +174,12 @@\n try {\n dict_file = find_dic_file().string(); // Default dictionary file path\n } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n+\n+ log_internal(\"Dictionary file located at: \" + dict_file);\n \n std::string search_string;\n try {\n@@ -182,8 +188,8 @@\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n- std::cerr << \"Error: \" << e.what() << std::endl;\n- return 1;\n+ std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n+ exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n@@ -195,10 +201,19 @@\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n- const auto trie = xcdat::load(dict_file);\n- log_internal(\"Trie loaded from dictionary file\");\n+ xcdat::trie_15_type trie;\n+ try {\n+ trie = xcdat::load(dict_file);\n+ log_internal(\"Trie loaded from dictionary file\");\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n+ std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n+ return 1;\n+ }\n \n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n@@ -225,12 +240,16 @@\n \n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n \n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n \n@@ -241,11 +260,15 @@\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n \n@@ -256,6 +279,6 @@\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n \n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:21:18 Current state: true false false true +Debug: 05-18 22:21:18 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -174,6 +174,12 @@ try %7B dict_file %3D find_dic_file().string(); // Default dictionary file path %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D + + log_internal(%22Dictionary file located at: %22 + dict_file); std::string search_string; try %7B @@ -182,8 +188,8 @@ log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); - std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; - return 1; + std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; + exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B @@ -195,10 +201,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); - log_internal(%22Trie loaded from dictionary file%22); + xcdat::trie_15_type trie; + try %7B + trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); + log_internal(%22Trie loaded from dictionary file%22); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); + std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; + return 1; + %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B @@ -225,12 +240,16 @@ const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); @@ -241,11 +260,15 @@ raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D @@ -256,6 +279,6 @@ // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:21:18 scheme: "gdlookup" +Debug: 05-18 22:21:18 host: "localhost" +Debug: 05-18 22:21:18 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -174,6 +174,12 @@ try { dict_file = find_dic_file().string(); // Default dictionary file path } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } + + log_internal(\"Dictionary file located at: \" + dict_file); std::string search_string; try { @@ -182,8 +188,8 @@ log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); - std::cerr << \"Error: \" << e.what() << std::endl; - return 1; + std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; + exit(1); } if (goldendict_mode && !sentence.empty()) { @@ -195,10 +201,19 @@ log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); - const auto trie = xcdat::load(dict_file); - log_internal(\"Trie loaded from dictionary file\"); + xcdat::trie_15_type trie; + try { + trie = xcdat::load(dict_file); + log_internal(\"Trie loaded from dictionary file\"); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); + std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; + return 1; + } std::vector substrings; std::vector results; std::map> alternatives_map; while (!search_string.empty()) { @@ -225,12 +240,16 @@ const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); @@ -241,11 +260,15 @@ raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } @@ -256,6 +279,6 @@ // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:21:18 some body finished +Debug: 05-18 22:21:18 one not finished. +Debug: 05-18 22:21:18 ====reading 4412 of (4412) bytes . Finished: 0 +Debug: 05-18 22:21:18 ====reading 0 of (4412) bytes . Finished: 0 +Debug: 05-18 22:21:18 ====reading 0 of (4412) bytes . Finished: 0 +Warning: 05-18 22:21:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:21:38 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:21:38 scheme: "gdlookup" +Debug: 05-18 22:21:38 host: "localhost" +Debug: 05-18 22:21:38 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 22:21:38 some body finished +Debug: 05-18 22:21:38 one not finished. +Debug: 05-18 22:21:38 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 22:21:38 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:21:38 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 22:21:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:21:42 socket error message: QAbstractSocket::RemoteHostClosedError +Debug: 05-18 22:21:43 translating from clipboard or selection +Debug: 05-18 22:21:43 clipboard data: ": Program started\nSat May 18 22:21:38 2024\n: Dictionary file set to: /tmp/dict.bin\nSat May 18 22:21:38 2024\n: GoldenDict mode enabled\nSat May 18 22:21:38 2024\n: Sentence set to: 地獄の苦しみ" +Debug: 05-18 22:21:43 Current state: true false false true +Debug: 05-18 22:21:43 getResource: "gdlookup://localhost/?word=: Program started Sat May 18 22:21:38 2024 : Dictionary file set to: /tmp/dict.bin Sat May 18 22:21:38 2024 : GoldenDict mode enabled Sat May 18 22:21:38 2024 : Sentence set to: 地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:21:43 scheme: "gdlookup" +Debug: 05-18 22:21:43 host: "localhost" +Debug: 05-18 22:21:43 clear current dictionaries: ": Program started Sat May 18 22:21:38 2024 : Dictionary file set to: /tmp/dict.bin Sat May 18 22:21:38 2024 : GoldenDict mode enabled Sat May 18 22:21:38 2024 : Sentence set to: 地獄の苦しみ" +Debug: 05-18 22:21:43 some body finished +Debug: 05-18 22:21:43 one not finished. +Debug: 05-18 22:21:43 ====reading 1599 of (1599) bytes . Finished: 0 +Debug: 05-18 22:21:43 ====reading 0 of (1599) bytes . Finished: 0 +Debug: 05-18 22:21:43 ====reading 0 of (1599) bytes . Finished: 0 +Warning: 05-18 22:21:43 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:21:48 translating from clipboard or selection +Debug: 05-18 22:21:48 clipboard data: ": Program started\nSat May 18 22:21:38 2024\n: Dictionary file set to: /tmp/dict.bin\nSat May 18 22:21:38 2024\n: GoldenDict mode enabled\nSat May 18 22:21:38 2024\n: Sentence set to: 地獄の苦しみ" +Debug: 05-18 22:21:48 Current state: true false true true +Debug: 05-18 22:21:48 getResource: "gdlookup://localhost/?word=: Program started Sat May 18 22:21:38 2024 : Dictionary file set to: /tmp/dict.bin Sat May 18 22:21:38 2024 : GoldenDict mode enabled Sat May 18 22:21:38 2024 : Sentence set to: 地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:21:48 scheme: "gdlookup" +Debug: 05-18 22:21:48 host: "localhost" +Debug: 05-18 22:21:48 clear current dictionaries: ": Program started Sat May 18 22:21:38 2024 : Dictionary file set to: /tmp/dict.bin Sat May 18 22:21:38 2024 : GoldenDict mode enabled Sat May 18 22:21:38 2024 : Sentence set to: 地獄の苦しみ" +Debug: 05-18 22:21:48 some body finished +Debug: 05-18 22:21:48 one not finished. +Debug: 05-18 22:21:48 ====reading 1599 of (1599) bytes . Finished: 0 +Debug: 05-18 22:21:48 ====reading 0 of (1599) bytes . Finished: 0 +Debug: 05-18 22:21:48 ====reading 0 of (1599) bytes . Finished: 0 +Warning: 05-18 22:21:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:22:40 translating from clipboard or selection +Debug: 05-18 22:22:40 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -144,7 +144,8 @@\n \n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n+ std::string dict_file;\n \n log_internal(\"Program started\");\n \n+ // Check for the dictionary file\n+ try {\n+ dict_file = find_dic_file().string(); // Default dictionary file path\n+ log_internal(\"Dictionary file located at: \" + dict_file);\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n \n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n+ if (!std::filesystem::exists(dict_file)) {\n+ log_internal(\"Error: Dictionary file not found at \" + dict_file);\n+ std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n+ return 1;\n+ }\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n \n std::string search_string;\n try {\n search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n xcdat::trie_15_type trie;\n try {\n trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n return 1;\n }\n \n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n \n+ log_internal(\"Starting search loop with search string: \" + search_string);\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n \n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n \n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n+ log_internal(\"Search loop ended\");\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n+ log_internal(\"HTML output wrapped\");\n exit(0);\n }\n \n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:22:40 Current state: true true true true +Debug: 05-18 22:22:40 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; + std::string dict_file; log_internal(%22Program started%22); + // Check for the dictionary file + try %7B + dict_file %3D find_dic_file().string(); // Default dictionary file path + log_internal(%22Dictionary file located at: %22 + dict_file); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); + if (!std::filesystem::exists(dict_file)) %7B + log_internal(%22Error: Dictionary file not found at %22 + dict_file); + std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; + return 1; + %7D i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string; try %7B search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try %7B trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; return 1; %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; + log_internal(%22Starting search loop with search string: %22 + search_string); while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D + log_internal(%22Search loop ended%22); // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); + log_internal(%22HTML output wrapped%22); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:22:40 scheme: "gdlookup" +Debug: 05-18 22:22:40 host: "localhost" +Debug: 05-18 22:22:40 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; + std::string dict_file; log_internal(\"Program started\"); + // Check for the dictionary file + try { + dict_file = find_dic_file().string(); // Default dictionary file path + log_internal(\"Dictionary file located at: \" + dict_file); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); + if (!std::filesystem::exists(dict_file)) { + log_internal(\"Error: Dictionary file not found at \" + dict_file); + std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; + return 1; + } i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string; try { search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; exit(1); } if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try { trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); } catch (const std::exception& e) { log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; return 1; } std::vector substrings; std::vector results; std::map> alternatives_map; + log_internal(\"Starting search loop with search string: \" + search_string); while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } + log_internal(\"Search loop ended\"); // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); + log_internal(\"HTML output wrapped\"); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:22:40 some body finished +Debug: 05-18 22:22:40 one not finished. +Debug: 05-18 22:22:40 ====reading 6668 of (6668) bytes . Finished: 0 +Debug: 05-18 22:22:40 ====reading 0 of (6668) bytes . Finished: 0 +Debug: 05-18 22:22:40 ====reading 0 of (6668) bytes . Finished: 0 +Warning: 05-18 22:22:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:22:44 translating from clipboard or selection +Debug: 05-18 22:22:44 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -144,7 +144,8 @@\n \n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n- bool goldendict_mode = false;\n+ bool goldendict_mode = false;\n+ std::string word, sentence;\n std::string dict_file;\n\n+ log_internal(\"Program started\");\n \n+ // Check for the dictionary file\n+ try {\n+ dict_file = find_dic_file().string(); // Default dictionary file path\n+ log_internal(\"Dictionary file located at: \" + dict_file);\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n \n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n+ if (!std::filesystem::exists(dict_file)) {\n+ log_internal(\"Error: Dictionary file not found at \" + dict_file);\n+ std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n+ return 1;\n+ }\n i++; // Skip the next argument as it's the dictionary file path\n+ } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n+ goldendict_mode = true;\n+ log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n \n std::string search_string;\n try {\n search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n xcdat::trie_15_type trie;\n try {\n trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n return 1;\n }\n \n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n \n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n \n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n \n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n \n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:22:44 Current state: true false true true +Debug: 05-18 22:22:44 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; - bool goldendict_mode %3D false; + bool goldendict_mode %3D false; + std::string word, sentence; std::string dict_file; + log_internal(%22Program started%22); + // Check for the dictionary file + try %7B + dict_file %3D find_dic_file().string(); // Default dictionary file path + log_internal(%22Dictionary file located at: %22 + dict_file); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); + if (!std::filesystem::exists(dict_file)) %7B + log_internal(%22Error: Dictionary file not found at %22 + dict_file); + std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; + return 1; + %7D i++; // Skip the next argument as it%27s the dictionary file path + %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B + goldendict_mode %3D true; + log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string; try %7B search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try %7B trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; return 1; %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:22:44 scheme: "gdlookup" +Debug: 05-18 22:22:44 host: "localhost" +Debug: 05-18 22:22:44 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) { bool debug_mode = false; - bool goldendict_mode = false; + bool goldendict_mode = false; + std::string word, sentence; std::string dict_file; + log_internal(\"Program started\"); + // Check for the dictionary file + try { + dict_file = find_dic_file().string(); // Default dictionary file path + log_internal(\"Dictionary file located at: \" + dict_file); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); + if (!std::filesystem::exists(dict_file)) { + log_internal(\"Error: Dictionary file not found at \" + dict_file); + std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; + return 1; + } i++; // Skip the next argument as it's the dictionary file path + } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { + goldendict_mode = true; + log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string; try { search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; exit(1); } if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try { trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); } catch (const std::exception& e) { log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; return 1; } std::vector substrings; std::vector results; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:22:44 some body finished +Debug: 05-18 22:22:44 one not finished. +Debug: 05-18 22:22:44 ====reading 6527 of (6527) bytes . Finished: 0 +Debug: 05-18 22:22:44 ====reading 0 of (6527) bytes . Finished: 0 +Debug: 05-18 22:22:44 ====reading 0 of (6527) bytes . Finished: 0 +Warning: 05-18 22:22:44 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:01 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:01 scheme: "gdlookup" +Debug: 05-18 22:23:01 host: "localhost" +Debug: 05-18 22:23:01 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 22:23:01 some body finished +Debug: 05-18 22:23:01 one not finished. +Debug: 05-18 22:23:01 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 22:23:01 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:23:01 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 22:23:01 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:09 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:09 scheme: "gdlookup" +Debug: 05-18 22:23:09 host: "localhost" +Debug: 05-18 22:23:09 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 22:23:09 some body finished +Debug: 05-18 22:23:09 one not finished. +Debug: 05-18 22:23:09 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 22:23:09 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:23:09 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 22:23:09 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:53 translating from clipboard or selection +Debug: 05-18 22:23:53 clipboard data: "const auto trie = xcdat::load(dict_file);" +Debug: 05-18 22:23:53 Current state: true true false true +Debug: 05-18 22:23:53 getResource: "gdlookup://localhost/?word=const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:53 scheme: "gdlookup" +Debug: 05-18 22:23:53 host: "localhost" +Debug: 05-18 22:23:53 clear current dictionaries: "const auto trie = xcdat::load(dict_file);" +Debug: 05-18 22:23:53 some body finished +Debug: 05-18 22:23:53 one not finished. +Debug: 05-18 22:23:53 ====reading 1471 of (1471) bytes . Finished: 0 +Debug: 05-18 22:23:53 ====reading 0 of (1471) bytes . Finished: 0 +Debug: 05-18 22:23:53 ====reading 0 of (1471) bytes . Finished: 0 +Warning: 05-18 22:23:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:54 translating from clipboard or selection +Debug: 05-18 22:23:54 clipboard data: "const auto trie = xcdat::load(dict_file);" +Debug: 05-18 22:23:54 Current state: true false false true +Debug: 05-18 22:23:54 getResource: "gdlookup://localhost/?word=const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:54 scheme: "gdlookup" +Debug: 05-18 22:23:54 host: "localhost" +Debug: 05-18 22:23:54 clear current dictionaries: "const auto trie = xcdat::load(dict_file);" +Debug: 05-18 22:23:54 some body finished +Debug: 05-18 22:23:54 one not finished. +Debug: 05-18 22:23:54 ====reading 1471 of (1471) bytes . Finished: 0 +Debug: 05-18 22:23:54 ====reading 0 of (1471) bytes . Finished: 0 +Debug: 05-18 22:23:54 ====reading 0 of (1471) bytes . Finished: 0 +Warning: 05-18 22:23:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:55 translating from clipboard or selection +Debug: 05-18 22:23:55 clipboard data: " log_internal(\"Trie loaded from dictionary file\");\n" +Debug: 05-18 22:23:55 Current state: true false true true +Debug: 05-18 22:23:55 getResource: "gdlookup://localhost/?word=log_internal(%22Trie loaded from dictionary file%22);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:55 scheme: "gdlookup" +Debug: 05-18 22:23:55 host: "localhost" +Debug: 05-18 22:23:55 clear current dictionaries: "log_internal(\"Trie loaded from dictionary file\");" +Debug: 05-18 22:23:55 some body finished +Debug: 05-18 22:23:55 one not finished. +Debug: 05-18 22:23:55 ====reading 1462 of (1462) bytes . Finished: 0 +Debug: 05-18 22:23:55 ====reading 0 of (1462) bytes . Finished: 0 +Debug: 05-18 22:23:55 ====reading 0 of (1462) bytes . Finished: 0 +Warning: 05-18 22:23:55 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:55 translating from clipboard or selection +Debug: 05-18 22:23:55 clipboard data: " const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n" +Debug: 05-18 22:23:55 Current state: true false true true +Debug: 05-18 22:23:55 getResource: "gdlookup://localhost/?word=const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:55 scheme: "gdlookup" +Debug: 05-18 22:23:55 host: "localhost" +Debug: 05-18 22:23:55 clear current dictionaries: "const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\");" +Debug: 05-18 22:23:55 some body finished +Debug: 05-18 22:23:55 one not finished. +Debug: 05-18 22:23:55 ====reading 1531 of (1531) bytes . Finished: 0 +Debug: 05-18 22:23:55 ====reading 0 of (1531) bytes . Finished: 0 +Debug: 05-18 22:23:55 ====reading 0 of (1531) bytes . Finished: 0 +Warning: 05-18 22:23:55 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:58 translating from clipboard or selection +Debug: 05-18 22:23:58 clipboard data: " const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n" +Debug: 05-18 22:23:58 Current state: true false true true +Debug: 05-18 22:23:58 getResource: "gdlookup://localhost/?word=const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:58 scheme: "gdlookup" +Debug: 05-18 22:23:58 host: "localhost" +Debug: 05-18 22:23:58 clear current dictionaries: "const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\");" +Debug: 05-18 22:23:58 some body finished +Debug: 05-18 22:23:58 one not finished. +Debug: 05-18 22:23:58 ====reading 1531 of (1531) bytes . Finished: 0 +Debug: 05-18 22:23:58 ====reading 0 of (1531) bytes . Finished: 0 +Debug: 05-18 22:23:58 ====reading 0 of (1531) bytes . Finished: 0 +Warning: 05-18 22:23:58 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:23:59 translating from clipboard or selection +Debug: 05-18 22:23:59 clipboard data: " const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n" +Debug: 05-18 22:23:59 Current state: true false true true +Debug: 05-18 22:23:59 getResource: "gdlookup://localhost/?word=const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:23:59 scheme: "gdlookup" +Debug: 05-18 22:23:59 host: "localhost" +Debug: 05-18 22:23:59 clear current dictionaries: "const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\");" +Debug: 05-18 22:23:59 some body finished +Debug: 05-18 22:23:59 one not finished. +Debug: 05-18 22:23:59 ====reading 1531 of (1531) bytes . Finished: 0 +Debug: 05-18 22:23:59 ====reading 0 of (1531) bytes . Finished: 0 +Debug: 05-18 22:23:59 ====reading 0 of (1531) bytes . Finished: 0 +Warning: 05-18 22:23:59 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:24:00 translating from clipboard or selection +Debug: 05-18 22:24:00 clipboard data: " const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n" +Debug: 05-18 22:24:00 Current state: true false true true +Debug: 05-18 22:24:00 getResource: "gdlookup://localhost/?word=const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:24:00 scheme: "gdlookup" +Debug: 05-18 22:24:00 host: "localhost" +Debug: 05-18 22:24:00 clear current dictionaries: "const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\");" +Debug: 05-18 22:24:00 some body finished +Debug: 05-18 22:24:00 one not finished. +Debug: 05-18 22:24:00 ====reading 1531 of (1531) bytes . Finished: 0 +Debug: 05-18 22:24:00 ====reading 0 of (1531) bytes . Finished: 0 +Debug: 05-18 22:24:00 ====reading 0 of (1531) bytes . Finished: 0 +Warning: 05-18 22:24:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:24:17 translating from clipboard or selection +Debug: 05-18 22:24:17 clipboard data: " std::string dict_file = find_dic_file().string(); // Default dictionary file path\n" +Debug: 05-18 22:24:17 Current state: true false true true +Debug: 05-18 22:24:17 getResource: "gdlookup://localhost/?word=std::string dict_file %3D find_dic_file().string(); // Default dictionary file path&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:24:17 scheme: "gdlookup" +Debug: 05-18 22:24:17 host: "localhost" +Debug: 05-18 22:24:17 clear current dictionaries: "std::string dict_file = find_dic_file().string(); // Default dictionary file path" +Debug: 05-18 22:24:17 some body finished +Debug: 05-18 22:24:17 one not finished. +Debug: 05-18 22:24:17 ====reading 1484 of (1484) bytes . Finished: 0 +Debug: 05-18 22:24:17 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-18 22:24:17 ====reading 0 of (1484) bytes . Finished: 0 +Warning: 05-18 22:24:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:24:17 translating from clipboard or selection +Debug: 05-18 22:24:17 clipboard data: " std::string dict_file = find_dic_file().string(); // Default dictionary file path\n" +Debug: 05-18 22:24:17 Current state: true false true true +Debug: 05-18 22:24:17 getResource: "gdlookup://localhost/?word=std::string dict_file %3D find_dic_file().string(); // Default dictionary file path&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:24:17 scheme: "gdlookup" +Debug: 05-18 22:24:17 host: "localhost" +Debug: 05-18 22:24:17 clear current dictionaries: "std::string dict_file = find_dic_file().string(); // Default dictionary file path" +Debug: 05-18 22:24:17 some body finished +Debug: 05-18 22:24:17 one not finished. +Debug: 05-18 22:24:17 ====reading 1484 of (1484) bytes . Finished: 0 +Debug: 05-18 22:24:17 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-18 22:24:17 ====reading 0 of (1484) bytes . Finished: 0 +Warning: 05-18 22:24:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:24:17 translating from clipboard or selection +Debug: 05-18 22:24:17 clipboard data: " std::string dict_file = find_dic_file().string(); // Default dictionary file path\n" +Debug: 05-18 22:24:17 Current state: true false true true +Debug: 05-18 22:24:17 getResource: "gdlookup://localhost/?word=std::string dict_file %3D find_dic_file().string(); // Default dictionary file path&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:24:17 scheme: "gdlookup" +Debug: 05-18 22:24:17 host: "localhost" +Debug: 05-18 22:24:17 clear current dictionaries: "std::string dict_file = find_dic_file().string(); // Default dictionary file path" +Debug: 05-18 22:24:17 some body finished +Debug: 05-18 22:24:17 one not finished. +Debug: 05-18 22:24:17 ====reading 1484 of (1484) bytes . Finished: 0 +Debug: 05-18 22:24:17 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-18 22:24:17 ====reading 0 of (1484) bytes . Finished: 0 +Warning: 05-18 22:24:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:24:24 translating from clipboard or selection +Debug: 05-18 22:24:24 clipboard data: " const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
                \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
                  \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
                • \" + alt + \"
                • \";\n }\n output_html += \"
                \";\n }\n\n output_html += \"
                \"; \n output_html += \"\";\n\n sentence_copy = sentence_copy.substr(substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n break;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 22:24:24 Current state: true false true true +Debug: 05-18 22:24:24 getResource: "gdlookup://localhost/?word=const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:24:24 scheme: "gdlookup" +Debug: 05-18 22:24:24 host: "localhost" +Debug: 05-18 22:24:24 clear current dictionaries: "const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:24:24 some body finished +Debug: 05-18 22:24:24 one not finished. +Debug: 05-18 22:24:24 ====reading 13133 of (13133) bytes . Finished: 0 +Debug: 05-18 22:24:24 ====reading 0 of (13133) bytes . Finished: 0 +Debug: 05-18 22:24:24 ====reading 0 of (13133) bytes . Finished: 0 +Warning: 05-18 22:24:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:24:40 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:24:40 scheme: "gdlookup" +Debug: 05-18 22:24:40 host: "localhost" +Debug: 05-18 22:24:40 clear current dictionaries: "ゆっくり" +Debug: 05-18 22:24:40 some body finished +Debug: 05-18 22:24:40 one not finished. +Debug: 05-18 22:24:40 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 22:24:40 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 22:24:40 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 22:24:40 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:25:02 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:25:02 scheme: "gdlookup" +Debug: 05-18 22:25:02 host: "localhost" +Debug: 05-18 22:25:02 clear current dictionaries: "ゆっくり" +Debug: 05-18 22:25:02 some body finished +Debug: 05-18 22:25:02 one not finished. +Debug: 05-18 22:25:02 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 22:25:02 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 22:25:02 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 22:25:02 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:26:45 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:26:45 scheme: "gdlookup" +Debug: 05-18 22:26:45 host: "localhost" +Debug: 05-18 22:26:45 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 22:26:45 some body finished +Debug: 05-18 22:26:45 one not finished. +Debug: 05-18 22:26:45 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 22:26:45 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 22:26:45 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 22:26:45 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:27:04 translating from clipboard or selection +Debug: 05-18 22:27:04 clipboard data: "\n: Sentence set to: " +Debug: 05-18 22:27:04 Current state: true false false true +Debug: 05-18 22:27:04 getResource: "gdlookup://localhost/?word=: Sentence set to:&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:27:04 scheme: "gdlookup" +Debug: 05-18 22:27:04 host: "localhost" +Debug: 05-18 22:27:04 clear current dictionaries: ": Sentence set to:" +Debug: 05-18 22:27:04 some body finished +Debug: 05-18 22:27:04 one not finished. +Debug: 05-18 22:27:04 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 22:27:04 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:27:04 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 22:27:04 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:27:05 translating from clipboard or selection +Debug: 05-18 22:27:05 clipboard data: "転生したら剣でした" +Debug: 05-18 22:27:05 Current state: true false true true +Debug: 05-18 22:27:05 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:27:05 scheme: "gdlookup" +Debug: 05-18 22:27:05 host: "localhost" +Debug: 05-18 22:27:05 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 22:27:05 some body finished +Debug: 05-18 22:27:05 one not finished. +Debug: 05-18 22:27:05 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 22:27:05 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 22:27:05 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 22:27:05 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:27:06 translating from clipboard or selection +Debug: 05-18 22:27:06 clipboard data: "転生したら剣でした" +Debug: 05-18 22:27:06 Current state: true false true true +Debug: 05-18 22:27:06 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:27:06 scheme: "gdlookup" +Debug: 05-18 22:27:06 host: "localhost" +Debug: 05-18 22:27:06 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 22:27:06 some body finished +Debug: 05-18 22:27:06 one not finished. +Debug: 05-18 22:27:06 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 22:27:06 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 22:27:06 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 22:27:06 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Warning: 05-18 22:28:15 can not found the corresponding language from locale: "crowdin" +Warning: 05-18 22:28:15 can not found the corresponding language from locale: "qt_extra_es" +Warning: 05-18 22:28:15 can not found the corresponding language from locale: "qt_extra_it" +Warning: 05-18 22:28:15 can not found the corresponding language from locale: "qt_extra_lt" +Warning: 05-18 22:28:15 can not found the corresponding language from locale: "qtwebengine_zh_CN" +Debug: 05-18 22:28:25 starting create the fts with thread: 11 +Debug: 05-18 22:28:25 waiting for all the fts creation to finish. +Debug: 05-18 22:28:25 finished/cancel all the fts creation +Debug: 05-18 22:28:43 handle path: "/mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:28:43 handle path: "/mnt/Data/Chinese caligraphy dictionaries" +Debug: 05-18 22:28:43 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts" +Debug: 05-18 22:28:44 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 22:28:44 Epwing: found "EIDAI6" +Warning: 05-18 22:28:44 "Epwing dictionary initializing failed: , error: EB library report error EB \"eb_set_subbook\" function error: EB_ERR_FAIL_OPEN_TEXT (failed to open a text file)\n" +Debug: 05-18 22:28:44 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 22:28:44 Epwing: found "HYOGEN" +Debug: 05-18 22:28:44 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:28:44 Epwing: found "RUIGIGO" +Debug: 05-18 22:28:45 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:28:45 Epwing: found "RUIGIGO" +Debug: 05-18 22:28:45 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 22:28:45 Epwing: found "ENCY" +Debug: 05-18 22:28:45 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 22:28:45 Epwing: found "Snmkg99" +Debug: 05-18 22:28:45 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 22:28:45 Epwing: found "BODY" +Debug: 05-18 22:28:45 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 22:28:45 Epwing: found "MEIKYOJJ" +Debug: 05-18 22:28:45 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation" +Debug: 05-18 22:28:45 handle path: "/mnt/Reading/Wikipedia Japa" +Debug: 05-18 22:28:45 handle path: "/mnt/Data/Documents/dict - concise encyclopedia of mathematics" +Debug: 05-18 22:28:45 handle path: "/home/hashirama/Downloads/Port" +Debug: 05-18 22:28:45 handle path: "/mnt/Data/Documents/english_dictionary" +Debug: 05-18 22:28:45 handle path: "/mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0]" +Debug: 05-18 22:28:45 handle path: "/mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:28:46 Load done + +Debug: 05-18 22:28:46 Loading 200 abbrv + +Debug: 05-18 22:28:46 Loading 198 abbrv + +Debug: 05-18 22:28:46 Loading 183 abbrv + +Debug: 05-18 22:28:46 Loading 210 abbrv + +Debug: 05-18 22:28:46 received: "220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <312130797.3959.1716085726@dict.dict.org>\r\n" +Debug: 05-18 22:28:46 received: "110 166 databases present\r\n" +Debug: 05-18 22:28:46 receive db: "gcide \"The Collaborative International Dictionary of English v.0.48\"" +Debug: 05-18 22:28:46 receive db: "wn \"WordNet (r) 3.0 (2006)\"" +Debug: 05-18 22:28:46 receive db: "moby-thesaurus \"Moby Thesaurus II by Grady Ward, 1.0\"" +Debug: 05-18 22:28:46 receive db: "elements \"The Elements (07Nov00)\"" +Debug: 05-18 22:28:46 receive db: "vera \"V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\"" +Debug: 05-18 22:28:46 receive db: "jargon \"The Jargon File (version 4.4.7, 29 Dec 2003)\"" +Debug: 05-18 22:28:46 receive db: "foldoc \"The Free On-line Dictionary of Computing (30 December 2018)\"" +Debug: 05-18 22:28:46 receive db: "easton \"Easton's 1897 Bible Dictionary\"" +Debug: 05-18 22:28:46 receive db: "hitchcock \"Hitchcock's Bible Names Dictionary (late 1800's)\"" +Debug: 05-18 22:28:46 receive db: "bouvier \"Bouvier's Law Dictionary, Revised 6th Ed (1856)\"" +Debug: 05-18 22:28:46 receive db: "devil \"The Devil's Dictionary (1881-1906)\"" +Debug: 05-18 22:28:46 receive db: "world02 \"CIA World Factbook 2002\"" +Debug: 05-18 22:28:46 receive db: "gaz2k-counties \"U.S. Gazetteer Counties (2000)\"" +Debug: 05-18 22:28:46 receive db: "gaz2k-places \"U.S. Gazetteer Places (2000)\"" +Debug: 05-18 22:28:46 receive db: "gaz2k-zips \"U.S. Gazetteer Zip Code Tabulation Areas (2000)\"" +Debug: 05-18 22:28:46 receive db: "fd-hrv-eng \"Croatian-English FreeDict Dictionary ver. 0.1.2\"" +Debug: 05-18 22:28:46 receive db: "fd-fin-por \"suomi-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:28:46 receive db: "fd-fin-bul \"suomi-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:28:46 receive db: "fd-fra-bul \"fran\xC3\xA7""ais-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:28:46 receive db: "fd-deu-swe \"Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:28:46 receive db: "fd-fin-swe \"suomi-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:28:46 receive db: "fd-jpn-rus \"Japanese-Russian FreeDict Dictionary ver. 0.1\"" +Debug: 05-18 22:28:46 receive db: "fd-wol-fra \"Wolof - French FreeDict dictionary ver. 0.1\"" +Debug: 05-18 22:28:46 receive db: "fd-fra-pol \"fran\xC3\xA7""ais-j\xC4\x99zyk" +Debug: 05-18 22:28:46 received: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-deu \"English-German FreeDict Dictionary ver. 0.3.7\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-nld \"German-Dutch FreeDict Dictionary ver. 0.1.4\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-por-eng \"Portuguese-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-spa-deu \"Spanish-German FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ces-eng \"Czech-English FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-fin \"Svenska-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-pol \"English - Polish Piotrowski+Saloni/FreeDict dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-nor \"j\xC4\x99zyk polski-Norsk FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-rom \"English-Romanian FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-fra \"English-French FreeDict Dictionary ver. 0.1.6\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fin-ell \"suomi-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-lit \"English-Lithuanian FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ckb-kmr \"Sorani-Kurmanji Ferheng/FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-eng \"Italian-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-eng \"j\xC4\x99zyk polski-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-gle-eng \"Irish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-tur \"English-Turkish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-gle-pol \"Irish-Polish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-deu \"j\xC4\x99zyk polski-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-spa \"fran\xC3\xA7""ais-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-lit-eng \"Lithuanian-English FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-jpn \"English-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ara-eng \"Arabic-English FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-nld-ita \"Nederlands-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-lat \"English-Latin FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-hun \"English-Hungarian FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-jpn \"italiano-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-dan-eng \"Danish-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-hun-eng \"Hungarian-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-gle \"Polish-Irish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-fin \"fran\xC3\xA7""ais-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-nld-swe \"Nederlands-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-nld-eng \"Dutch-English Freedict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-kur \"German-Kurdish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-spa \"Deutsch-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-afr \"English-Afrikaans FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-swe \"English-Swedish FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-jpn-deu \"Japanese-German FreeDict Dictionary ver. 0.2.0\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-epo-eng \"Esperanto-English FreeDict dictionary ver. 1.0.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-nld \"j\xC4\x99zyk polski-Nederlands FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-lat-deu \"Lateinisch-Deutsch FreeDict-W\xC3\xB6rterbuch ver. 1.0.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-cym \"Eurfa Saesneg, English-Welsh Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-por-spa \"portugu\xC3\xAAs-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-spa \"English-Spanish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-tur \"Svenska-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-tur-eng \"Turkish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-tur-deu \"Turkish-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-fra \"j\xC4\x99zyk polski-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-por \"English-Portuguese FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-pol \"italiano-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-ces \"English-Czech dicts.info/FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-tur \"German-Turkish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-jpn \"fran\xC3\xA7""ais-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-cym-eng \"Eurfa Cymraeg, Welsh-English Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-bre-fra \"Breton-French FreeDict Dictionary (Geriadur Tomaz) ver. 0.8.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-jpn-fra \"Japanese-French FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-nld-deu \"Dutch-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-nld \"English-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-por \"German-Portuguese FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-hrv \"English-Croatian FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-mkd-bul \"Macedonian - Bulgarian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-eng \"Swedish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-spa \"j\xC4\x99zyk polski-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-jpn-eng \"Japanese-English FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-ell \"English - Modern Greek XDXF/FreeDict dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-por \"italiano-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-swe \"j\xC4\x99zyk polski-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-fin \"j\xC4\x99zyk polski-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-kur-tur \"Kurdish-Turkish Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-swe \"italiano-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-swh \"English-Swahili xFried/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-kha-eng \"Khasi-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fin-eng \"suomi-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-hin \"English-Hindi FreeDict Dictionary ver. 1.6\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-spa-eng \"Spanish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-afr-eng \"Afrikaans-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-fin \"italiano-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-fin \"English-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-ita \"fran\xC3\xA7""ais-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-rus \"Deutsch-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-bul \"Deutsch-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-pol \"Deutsch-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-kur-deu \"Kurdish-German Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-spa-por \"Spanish-Portuguese FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-pol \"Svenska-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-rus \"Svenska-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-nld-spa \"Nederlands-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swh-pol \"Swahili-Polish SSSP/FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-oci-cat \"Lenga d'\xC3\xB2""c - Catal\xC3\xA0 FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-rus \"italiano-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-ell \"fran\xC3\xA7""ais-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-srp \"English-Serbian FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-tur \"fran\xC3\xA7""ais-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-eng \"French-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-ita-ell \"italiano-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-kur-eng \"Kurdish-English Ferheng/FreeDict Dictionary ver. 1.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-deu \"Svenska-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-fra \"Svenska-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-lat \"Svenska-latine FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-ell \"Svenska-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-rus \"English-Russian FreeDict Dictionary ver. 0.3.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-por \"j\xC4\x99zyk polski-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-gla-deu \"Scottish Gaelic-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-ita \"English-Italian FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-pol-ita \"j\xC4\x99zyk polski-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-swe \"fran\xC3\xA7""ais-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-isl-eng \"\xC3\xADslenska - English FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-spa \"Svenska-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-nno-nob \"Norwegian Nynorsk-Norwegian Bokm\xC3\xA5l FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swe-ita \"Svenska-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-deu \"fran\xC3\xA7""ais-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fin-ita \"suomi-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-nld-fra \"Nederlands-French FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-eng-ara \"English-Arabic FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-slk-eng \"Slovak-English FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fra-por \"fran\xC3\xA7""ais-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-spa-ast \"Spanish - Asturian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fin-jpn \"suomi-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-deu-ita \"German-Italian FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-swh-eng \"Swahili-English xFried/FreeDict Dictionary ver. 0.4.4\"\r\n" +Debug: 05-18 22:28:46 receive db: "fd-fin-nor \"suomi-Norsk FreeDict+WikDict dictionary ver. 2018" +Debug: 05-18 22:28:46 Reloading all the tabs... +Debug: 05-18 22:28:46 starting create the fts with thread: 11 +Debug: 05-18 22:28:46 waiting for all the fts creation to finish. +Debug: 05-18 22:28:46 finished/cancel all the fts creation +Debug: 05-18 22:28:46 received: ".09.13\"\r\n" +Debug: 05-18 22:28:46 receive db: ".09.13\"\r\n" +Debug: 05-18 22:28:46 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:28:46 scheme: "gdlookup" +Debug: 05-18 22:28:46 host: "localhost" +Debug: 05-18 22:28:46 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 22:28:46 some body finished +Debug: 05-18 22:28:46 one not finished. +Debug: 05-18 22:28:46 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 22:28:46 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 22:28:46 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 22:28:46 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:28:46 received: "fd-fra-nld \"French-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:28:55 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:28:55 scheme: "gdlookup" +Debug: 05-18 22:28:55 host: "localhost" +Debug: 05-18 22:28:55 clear current dictionaries: "違和感" +Debug: 05-18 22:28:55 some body finished +Debug: 05-18 22:28:55 one not finished. +Debug: 05-18 22:28:55 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 22:28:55 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 22:28:55 ====reading 0 of (1412) bytes . Finished: 0 +Warning: 05-18 22:28:55 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:29:01 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:29:01 scheme: "gdlookup" +Debug: 05-18 22:29:01 host: "localhost" +Debug: 05-18 22:29:01 clear current dictionaries: "ゆっくり" +Debug: 05-18 22:29:01 some body finished +Debug: 05-18 22:29:01 one not finished. +Debug: 05-18 22:29:01 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 22:29:01 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 22:29:01 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 22:29:01 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:31:04 translating from clipboard or selection +Debug: 05-18 22:31:04 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -2,6 +2,7 @@\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n\n struct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n };\n\n inline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n }\n\n inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n }\n\n inline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n }\n\n inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n }\n\n void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n }\n\n void log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n }\n\n inline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
                \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
                  \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
                • \" + alt + \"
                • \";\n }\n output_html += \"
                \";\n }\n\n output_html += \"
                \"; \n output_html += \"\";\n sentence_copy.erase(0, substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n output_html += sentence_copy[0];\n sentence_copy.erase(0, 1);\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n\n std::cout << output_html << std::endl;\n }\n\n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file;\n\n log_internal(\"Program started\");\n\n try {\n dict_file = find_dic_file().string(); \n log_internal(\"Dictionary file located at: \" + dict_file);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: \" << e.what() << std::endl;\n return 1;\n }\n\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n if (!std::filesystem::exists(dict_file)) {\n log_internal(\"Error: Dictionary file not found at \" + dict_file);\n std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n return 1;\n }\n i++;\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string;\n try {\n search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n exit(1);\n }\n\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n xcdat::trie_15_type trie;\n try {\n trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n return 1;\n }\n\n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n\n log_internal(\"Starting search loop with search string: \" + search_string);\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n log_internal(\"Search loop ended\");\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n log_internal(\"HTML output wrapped\");\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:31:04 Current state: true true false true +Debug: 05-18 22:31:04 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -2,6 +2,7 @@ %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy.erase(0, substring.size()); found %3D true; break; %7D %7D if (!found) %7B output_html +%3D sentence_copy[0]; sentence_copy.erase(0, 1); %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file; log_internal(%22Program started%22); try %7B dict_file %3D find_dic_file().string(); log_internal(%22Dictionary file located at: %22 + dict_file); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); if (!std::filesystem::exists(dict_file)) %7B log_internal(%22Error: Dictionary file not found at %22 + dict_file); std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; return 1; %7D i++; %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string; try %7B search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try %7B trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; return 1; %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; log_internal(%22Starting search loop with search string: %22 + search_string); while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D log_internal(%22Search loop ended%22); if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); log_internal(%22HTML output wrapped%22); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:31:04 scheme: "gdlookup" +Debug: 05-18 22:31:04 host: "localhost" +Debug: 05-18 22:31:04 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -2,6 +2,7 @@ #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy.erase(0, substring.size()); found = true; break; } } if (!found) { output_html += sentence_copy[0]; sentence_copy.erase(0, 1); } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file; log_internal(\"Program started\"); try { dict_file = find_dic_file().string(); log_internal(\"Dictionary file located at: \" + dict_file); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: \" << e.what() << std::endl; return 1; } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); if (!std::filesystem::exists(dict_file)) { log_internal(\"Error: Dictionary file not found at \" + dict_file); std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; return 1; } i++; } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string; try { search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; exit(1); } if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try { trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); } catch (const std::exception& e) { log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; return 1; } std::vector substrings; std::vector results; std::map> alternatives_map; log_internal(\"Starting search loop with search string: \" + search_string); while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } log_internal(\"Search loop ended\"); if (debug_mode) { print_debug_info(substrings, raw_output); } if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); log_internal(\"HTML output wrapped\"); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:31:04 some body finished +Debug: 05-18 22:31:04 one not finished. +Debug: 05-18 22:31:04 ====reading 13682 of (13682) bytes . Finished: 0 +Debug: 05-18 22:31:04 ====reading 0 of (13682) bytes . Finished: 0 +Debug: 05-18 22:31:04 ====reading 0 of (13682) bytes . Finished: 0 +Warning: 05-18 22:31:04 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:31:11 translating from clipboard or selection +Debug: 05-18 22:31:11 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -144,7 +144,8 @@\n \n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n+ std::string dict_file;\n \n log_internal(\"Program started\");\n \n+ // Check for the dictionary file\n+ try {\n+ dict_file = find_dic_file().string(); // Default dictionary file path\n+ log_internal(\"Dictionary file located at: \" + dict_file);\n+ } catch (const std::exception& e) {\n+ log_internal(std::string(\"Error: \") + e.what());\n+ std::cerr << \"Error: \" << e.what() << std::endl;\n+ return 1;\n+ }\n \n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n+ if (!std::filesystem::exists(dict_file)) {\n+ log_internal(\"Error: Dictionary file not found at \" + dict_file);\n+ std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n+ return 1;\n+ }\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n \n std::string search_string;\n try {\n search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n exit(1);\n }\n \n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n \n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n \n xcdat::trie_15_type trie;\n try {\n trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n return 1;\n }\n \n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n \n+ log_internal(\"Starting search loop with search string: \" + search_string);\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n \n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n \n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n \n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n \n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n \n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n \n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n \n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n \n results.clear();\n \n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n \n+ log_internal(\"Search loop ended\");\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n \n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n+ log_internal(\"HTML output wrapped\");\n exit(0);\n }\n \n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:31:11 Current state: true false false true +Debug: 05-18 22:31:11 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; + std::string dict_file; log_internal(%22Program started%22); + // Check for the dictionary file + try %7B + dict_file %3D find_dic_file().string(); // Default dictionary file path + log_internal(%22Dictionary file located at: %22 + dict_file); + %7D catch (const std::exception%26 e) %7B + log_internal(std::string(%22Error: %22) + e.what()); + std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; + return 1; + %7D // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); + if (!std::filesystem::exists(dict_file)) %7B + log_internal(%22Error: Dictionary file not found at %22 + dict_file); + std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; + return 1; + %7D i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string; try %7B search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try %7B trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; return 1; %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; + log_internal(%22Starting search loop with search string: %22 + search_string); while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D + log_internal(%22Search loop ended%22); // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); + log_internal(%22HTML output wrapped%22); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:31:11 scheme: "gdlookup" +Debug: 05-18 22:31:11 host: "localhost" +Debug: 05-18 22:31:11 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -144,7 +144,8 @@ int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; + std::string dict_file; log_internal(\"Program started\"); + // Check for the dictionary file + try { + dict_file = find_dic_file().string(); // Default dictionary file path + log_internal(\"Dictionary file located at: \" + dict_file); + } catch (const std::exception& e) { + log_internal(std::string(\"Error: \") + e.what()); + std::cerr << \"Error: \" << e.what() << std::endl; + return 1; + } // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); + if (!std::filesystem::exists(dict_file)) { + log_internal(\"Error: Dictionary file not found at \" + dict_file); + std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; + return 1; + } i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string; try { search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; exit(1); } if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try { trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); } catch (const std::exception& e) { log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; return 1; } std::vector substrings; std::vector results; std::map> alternatives_map; + log_internal(\"Starting search loop with search string: \" + search_string); while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } + log_internal(\"Search loop ended\"); // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); + log_internal(\"HTML output wrapped\"); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:31:11 some body finished +Debug: 05-18 22:31:11 one not finished. +Debug: 05-18 22:31:11 ====reading 6668 of (6668) bytes . Finished: 0 +Debug: 05-18 22:31:11 ====reading 0 of (6668) bytes . Finished: 0 +Debug: 05-18 22:31:11 ====reading 0 of (6668) bytes . Finished: 0 +Warning: 05-18 22:31:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:32:12 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:32:12 scheme: "gdlookup" +Debug: 05-18 22:32:12 host: "localhost" +Debug: 05-18 22:32:12 clear current dictionaries: "ゆっくり" +Debug: 05-18 22:32:12 some body finished +Debug: 05-18 22:32:12 one not finished. +Debug: 05-18 22:32:12 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 22:32:12 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 22:32:12 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 22:32:12 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:32:18 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:32:18 scheme: "gdlookup" +Debug: 05-18 22:32:18 host: "localhost" +Debug: 05-18 22:32:18 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 22:32:18 some body finished +Debug: 05-18 22:32:18 one not finished. +Debug: 05-18 22:32:18 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 22:32:18 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 22:32:18 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 22:32:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:33:17 translating from clipboard or selection +Debug: 05-18 22:33:17 clipboard data: "●●●●" +Debug: 05-18 22:33:17 Current state: true true false true +Debug: 05-18 22:33:17 getResource: "gdlookup://localhost/?word=●●●●&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:33:17 scheme: "gdlookup" +Debug: 05-18 22:33:17 host: "localhost" +Debug: 05-18 22:33:17 clear current dictionaries: "●●●●" +Debug: 05-18 22:33:17 some body finished +Debug: 05-18 22:33:17 one not finished. +Debug: 05-18 22:33:17 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 22:33:17 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 22:33:17 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 22:33:17 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:33:18 translating from clipboard or selection +Debug: 05-18 22:33:18 clipboard data: "" +Debug: 05-18 22:38:09 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:38:09 scheme: "gdlookup" +Debug: 05-18 22:38:09 host: "localhost" +Debug: 05-18 22:38:09 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 22:38:09 some body finished +Debug: 05-18 22:38:09 one not finished. +Debug: 05-18 22:38:09 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 22:38:09 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:38:09 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:38:09 some body finished +Debug: 05-18 22:38:09 one finished. +Debug: 05-18 22:38:09 erasing.. +Debug: 05-18 22:38:09 erase done.. +Debug: 05-18 22:38:09 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 22:38:09 ====reading 1292 of (2713) bytes . Finished: 1 +Debug: 05-18 22:38:09 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Warning: 05-18 22:38:09 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:38:09 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 22:38:09 scheme: "gico" +Debug: 05-18 22:38:09 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 22:38:09 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 22:38:25 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:38:25 scheme: "gdlookup" +Debug: 05-18 22:38:25 host: "localhost" +Debug: 05-18 22:38:25 clear current dictionaries: "議" +Debug: 05-18 22:38:25 some body finished +Debug: 05-18 22:38:25 one not finished. +Debug: 05-18 22:38:25 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 22:38:25 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 22:38:25 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 22:38:27 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:38:27 scheme: "gdlookup" +Debug: 05-18 22:38:27 host: "localhost" +Debug: 05-18 22:38:27 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 22:38:27 some body finished +Debug: 05-18 22:38:27 one not finished. +Debug: 05-18 22:38:27 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 22:38:27 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 22:38:27 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 22:38:27 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:38:46 socket error message: QAbstractSocket::RemoteHostClosedError +Debug: 05-18 22:40:18 translating from clipboard or selection +Debug: 05-18 22:40:18 clipboard data: "--- hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 09:00:00.000000000 +0000\n@@ -2,6 +2,7 @@\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n\n struct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n };\n\n inline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n }\n\n inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n search_string = argv[i + 1];\n break;\n }\n }\n } else {\n if (argc < 2) {\n std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n exit(1);\n }\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n // Handle debug mode\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n i++;\n } else {\n search_string = argv[i];\n break;\n }\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n }\n\n inline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n }\n\n inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n }\n\n void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n }\n\n void log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n }\n\n inline void wrap_html_output(\n const std::vector& substrings,\n const std::map>& alternatives_map,\n std::string& sentence\n ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n output_html += \"
                \" + substring + \"\";\n\n auto alt_itr = alternatives_map.find(sentence_copy);\n if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n output_html += \"
                  \";\n for (const auto& alt : alt_itr->second) {\n output_html += \"
                • \" + alt + \"
                • \";\n }\n output_html += \"
                \";\n }\n\n output_html += \"
                \"; \n output_html += \"\";\n sentence_copy.erase(0, substring.size());\n found = true;\n break;\n }\n }\n if (!found) {\n output_html += sentence_copy[0];\n sentence_copy.erase(0, 1);\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n\n std::cout << output_html << std::endl;\n }\n\n int main(const int argc, char* argv[]) {\n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n std::string dict_file;\n\n log_internal(\"Program started\");\n\n try {\n dict_file = find_dic_file().string(); \n log_internal(\"Dictionary file located at: \" + dict_file);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: \" << e.what() << std::endl;\n return 1;\n }\n\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n if (!std::filesystem::exists(dict_file)) {\n log_internal(\"Error: Dictionary file not found at \" + dict_file);\n std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl;\n return 1;\n }\n i++;\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string;\n try {\n search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: \") + e.what());\n std::cerr << \"Error: Failed to retrieve search string.\" << std::endl;\n exit(1);\n }\n\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n xcdat::trie_15_type trie;\n try {\n trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n } catch (const std::exception& e) {\n log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what());\n std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl;\n return 1;\n }\n\n std::vector substrings;\n std::vector results;\n std::map> alternatives_map;\n\n log_internal(\"Starting search loop with search string: \" + search_string);\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n if (!results.empty()) {\n for (const auto& entry : results) {\n const std::string substring(entry.decoded_view);\n substrings.push_back(substring);\n derived_map[substring].push_back(search_string);\n alternatives_map[search_string].insert(substring);\n log_internal(\"Substring added: \" + substring);\n if (!goldendict_mode) {\n std::cout << substring << std::endl;\n }\n }\n }\n\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n log_internal(\"Search loop ended\");\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n log_internal(\"HTML output wrapped\");\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n }\n" +Debug: 05-18 22:40:18 Current state: true true false true +Debug: 05-18 22:40:18 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -2,6 +2,7 @@ %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy.erase(0, substring.size()); found %3D true; break; %7D %7D if (!found) %7B output_html +%3D sentence_copy[0]; sentence_copy.erase(0, 1); %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file; log_internal(%22Program started%22); try %7B dict_file %3D find_dic_file().string(); log_internal(%22Dictionary file located at: %22 + dict_file); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); if (!std::filesystem::exists(dict_file)) %7B log_internal(%22Error: Dictionary file not found at %22 + dict_file); std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; return 1; %7D i++; %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string; try %7B search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try %7B trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; return 1; %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; log_internal(%22Starting search loop with search string: %22 + search_string); while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D log_internal(%22Search loop ended%22); if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); log_internal(%22HTML output wrapped%22); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:40:18 scheme: "gdlookup" +Debug: 05-18 22:40:18 host: "localhost" +Debug: 05-18 22:40:18 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -2,6 +2,7 @@ #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy.erase(0, substring.size()); found = true; break; } } if (!found) { output_html += sentence_copy[0]; sentence_copy.erase(0, 1); } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file; log_internal(\"Program started\"); try { dict_file = find_dic_file().string(); log_internal(\"Dictionary file located at: \" + dict_file); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: \" << e.what() << std::endl; return 1; } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); if (!std::filesystem::exists(dict_file)) { log_internal(\"Error: Dictionary file not found at \" + dict_file); std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; return 1; } i++; } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string; try { search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; exit(1); } if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try { trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); } catch (const std::exception& e) { log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; return 1; } std::vector substrings; std::vector results; std::map> alternatives_map; log_internal(\"Starting search loop with search string: \" + search_string); while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } log_internal(\"Search loop ended\"); if (debug_mode) { print_debug_info(substrings, raw_output); } if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); log_internal(\"HTML output wrapped\"); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:40:18 some body finished +Debug: 05-18 22:40:18 one not finished. +Debug: 05-18 22:40:18 ====reading 13682 of (13682) bytes . Finished: 0 +Debug: 05-18 22:40:18 ====reading 0 of (13682) bytes . Finished: 0 +Debug: 05-18 22:40:18 ====reading 0 of (13682) bytes . Finished: 0 +Warning: 05-18 22:40:18 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:40:19 translating from clipboard or selection +Debug: 05-18 22:40:19 clipboard data: "" +Warning: 05-18 22:43:03 can not found the corresponding language from locale: "crowdin" +Warning: 05-18 22:43:03 can not found the corresponding language from locale: "qt_extra_es" +Warning: 05-18 22:43:03 can not found the corresponding language from locale: "qt_extra_it" +Warning: 05-18 22:43:03 can not found the corresponding language from locale: "qt_extra_lt" +Warning: 05-18 22:43:03 can not found the corresponding language from locale: "qtwebengine_zh_CN" +Debug: 05-18 22:43:05 starting create the fts with thread: 11 +Debug: 05-18 22:43:05 waiting for all the fts creation to finish. +Debug: 05-18 22:43:05 finished/cancel all the fts creation +Debug: 05-18 22:43:19 handle path: "/mnt/Reading/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:43:19 handle path: "/mnt/Data/Chinese caligraphy dictionaries" +Debug: 05-18 22:43:19 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/dicts" +Debug: 05-18 22:43:20 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-18 22:43:20 Epwing: found "EIDAI6" +Warning: 05-18 22:43:20 "Epwing dictionary initializing failed: , error: EB library report error EB \"eb_set_subbook\" function error: EB_ERR_FAIL_OPEN_TEXT (failed to open a text file)\n" +Debug: 05-18 22:43:20 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-18 22:43:20 Epwing: found "HYOGEN" +Debug: 05-18 22:43:20 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:43:20 Epwing: found "RUIGIGO" +Debug: 05-18 22:43:21 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-18 22:43:21 Epwing: found "RUIGIGO" +Debug: 05-18 22:43:21 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-18 22:43:21 Epwing: found "ENCY" +Debug: 05-18 22:43:21 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-18 22:43:21 Epwing: found "Snmkg99" +Debug: 05-18 22:43:21 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-18 22:43:21 Epwing: found "BODY" +Debug: 05-18 22:43:21 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-18 22:43:21 Epwing: found "MEIKYOJJ" +Debug: 05-18 22:43:21 handle path: "/mnt/Data/Japanese_Resources/languages-study(japanesAndRussian)/pronounciation" +Debug: 05-18 22:43:21 handle path: "/mnt/Reading/Wikipedia Japa" +Debug: 05-18 22:43:21 handle path: "/mnt/Data/Documents/dict - concise encyclopedia of mathematics" +Debug: 05-18 22:43:21 handle path: "/home/hashirama/Downloads/Port" +Debug: 05-18 22:43:21 handle path: "/mnt/Data/Documents/english_dictionary" +Debug: 05-18 22:43:21 handle path: "/mnt/Sources/Epistularum's Tidy EPWing Collection [Version 1.0]" +Debug: 05-18 22:43:21 handle path: "/mnt/Sources/Epistularum's Tidy MDX Collection [Version 1.0]" +Debug: 05-18 22:43:21 Load done + +Debug: 05-18 22:43:21 Loading 198 abbrv + +Debug: 05-18 22:43:21 Loading 210 abbrv + +Debug: 05-18 22:43:21 Loading 200 abbrv + +Debug: 05-18 22:43:21 Loading 183 abbrv + +Debug: 05-18 22:43:22 received: "220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <312137183.15890.1716086602@dict.dict.org>\r\n" +Debug: 05-18 22:43:22 received: "110 166 databases present\r\n" +Debug: 05-18 22:43:22 receive db: "gcide \"The Collaborative International Dictionary of English v.0.48\"" +Debug: 05-18 22:43:22 receive db: "wn \"WordNet (r) 3.0 (2006)\"" +Debug: 05-18 22:43:22 receive db: "moby-thesaurus \"Moby Thesaurus II by Grady Ward, 1.0\"" +Debug: 05-18 22:43:22 receive db: "elements \"The Elements (07Nov00)\"" +Debug: 05-18 22:43:22 receive db: "vera \"V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\"" +Debug: 05-18 22:43:22 receive db: "jargon \"The Jargon File (version 4.4.7, 29 Dec 2003)\"" +Debug: 05-18 22:43:22 receive db: "foldoc \"The Free On-line Dictionary of Computing (30 December 2018)\"" +Debug: 05-18 22:43:22 receive db: "easton \"Easton's 1897 Bible Dictionary\"" +Debug: 05-18 22:43:22 receive db: "hitchcock \"Hitchcock's Bible Names Dictionary (late 1800's)\"" +Debug: 05-18 22:43:22 receive db: "bouvier \"Bouvier's Law Dictionary, Revised 6th Ed (1856)\"" +Debug: 05-18 22:43:22 receive db: "devil \"The Devil's Dictionary (1881-1906)\"" +Debug: 05-18 22:43:22 receive db: "world02 \"CIA World Factbook 2002\"" +Debug: 05-18 22:43:22 receive db: "gaz2k-counties \"U.S. Gazetteer Counties (2000)\"" +Debug: 05-18 22:43:22 receive db: "gaz2k-places \"U.S. Gazetteer Places (2000)\"" +Debug: 05-18 22:43:22 receive db: "gaz2k-zips \"U.S. Gazetteer Zip Code Tabulation Areas (2000)\"" +Debug: 05-18 22:43:22 receive db: "fd-hrv-eng \"Croatian-English FreeDict Dictionary ver. 0.1.2\"" +Debug: 05-18 22:43:22 receive db: "fd-fin-por \"suomi-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:43:22 receive db: "fd-fin-bul \"suomi-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:43:22 receive db: "fd-fra-bul \"fran\xC3\xA7""ais-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:43:22 receive db: "fd-deu-swe \"Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:43:22 receive db: "fd-fin-swe \"suomi-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"" +Debug: 05-18 22:43:22 receive db: "fd-jpn-rus \"Japanese-Russian FreeDict Dictionary ver. 0.1\"" +Debug: 05-18 22:43:22 receive db: "fd-wol-fra \"Wolof - French FreeDict dictionary ver. 0.1\"" +Debug: 05-18 22:43:22 receive db: "fd-fra-pol \"fran\xC3\xA7""ais-j\xC4\x99zyk" +Debug: 05-18 22:43:22 received: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-deu \"English-German FreeDict Dictionary ver. 0.3.7\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-nld \"German-Dutch FreeDict Dictionary ver. 0.1.4\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-por-eng \"Portuguese-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-spa-deu \"Spanish-German FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ces-eng \"Czech-English FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-fin \"Svenska-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-pol \"English - Polish Piotrowski+Saloni/FreeDict dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-nor \"j\xC4\x99zyk polski-Norsk FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-rom \"English-Romanian FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-fra \"English-French FreeDict Dictionary ver. 0.1.6\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fin-ell \"suomi-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-lit \"English-Lithuanian FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ckb-kmr \"Sorani-Kurmanji Ferheng/FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-eng \"Italian-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-eng \"j\xC4\x99zyk polski-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-gle-eng \"Irish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-tur \"English-Turkish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-gle-pol \"Irish-Polish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-deu \"j\xC4\x99zyk polski-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-spa \"fran\xC3\xA7""ais-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-lit-eng \"Lithuanian-English FreeDict Dictionary ver. 0.7.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-jpn \"English-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ara-eng \"Arabic-English FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-nld-ita \"Nederlands-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-lat \"English-Latin FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-hun \"English-Hungarian FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-jpn \"italiano-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-dan-eng \"Danish-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-hun-eng \"Hungarian-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-gle \"Polish-Irish FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-fin \"fran\xC3\xA7""ais-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-nld-swe \"Nederlands-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-nld-eng \"Dutch-English Freedict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-kur \"German-Kurdish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-spa \"Deutsch-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-afr \"English-Afrikaans FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-swe \"English-Swedish FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-jpn-deu \"Japanese-German FreeDict Dictionary ver. 0.2.0\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-epo-eng \"Esperanto-English FreeDict dictionary ver. 1.0.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-nld \"j\xC4\x99zyk polski-Nederlands FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-lat-deu \"Lateinisch-Deutsch FreeDict-W\xC3\xB6rterbuch ver. 1.0.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-cym \"Eurfa Saesneg, English-Welsh Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-por-spa \"portugu\xC3\xAAs-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-spa \"English-Spanish FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-tur \"Svenska-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-tur-eng \"Turkish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-tur-deu \"Turkish-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-fra \"j\xC4\x99zyk polski-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-por \"English-Portuguese FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-pol \"italiano-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-ces \"English-Czech dicts.info/FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-tur \"German-Turkish Ferheng/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-jpn \"fran\xC3\xA7""ais-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-cym-eng \"Eurfa Cymraeg, Welsh-English Eurfa/Freedict dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-bre-fra \"Breton-French FreeDict Dictionary (Geriadur Tomaz) ver. 0.8.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-jpn-fra \"Japanese-French FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-nld-deu \"Dutch-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-nld \"English-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-por \"German-Portuguese FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-hrv \"English-Croatian FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-mkd-bul \"Macedonian - Bulgarian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-eng \"Swedish-English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-spa \"j\xC4\x99zyk polski-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-jpn-eng \"Japanese-English FreeDict Dictionary ver. 0.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-ell \"English - Modern Greek XDXF/FreeDict dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-por \"italiano-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-swe \"j\xC4\x99zyk polski-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-fin \"j\xC4\x99zyk polski-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-kur-tur \"Kurdish-Turkish Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-swe \"italiano-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-swh \"English-Swahili xFried/FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-kha-eng \"Khasi-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fin-eng \"suomi-English FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-hin \"English-Hindi FreeDict Dictionary ver. 1.6\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-spa-eng \"Spanish-English FreeDict Dictionary ver. 0.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-afr-eng \"Afrikaans-English FreeDict Dictionary ver. 0.2.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-fin \"italiano-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-fin \"English-suomi FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-ita \"fran\xC3\xA7""ais-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-rus \"Deutsch-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-bul \"Deutsch-\xD0\xB1\xD1\x8A\xD0\xBB\xD0\xB3\xD0\xB0\xD1\x80\xD1\x81\xD0\xBA\xD0\xB8 \xD0\xB5\xD0\xB7\xD0\xB8\xD0\xBA FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-pol \"Deutsch-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-srp-eng \"Serbian - English FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-kur-deu \"Kurdish-German Ferheng/FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-spa-por \"Spanish-Portuguese FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-pol \"Svenska-j\xC4\x99zyk polski FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-rus \"Svenska-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-nld-spa \"Nederlands-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swh-pol \"Swahili-Polish SSSP/FreeDict Dictionary ver. 0.2.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-oci-cat \"Lenga d'\xC3\xB2""c - Catal\xC3\xA0 FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-rus \"italiano-\xD0\xA0\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xB8\xD0\xB9 FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-ell \"fran\xC3\xA7""ais-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-srp \"English-Serbian FreeDict Dictionary ver. 0.1.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-tur \"fran\xC3\xA7""ais-T\xC3\xBCrk\xC3\xA7""e FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-eng \"French-English FreeDict Dictionary ver. 0.4.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-ita-ell \"italiano-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-kur-eng \"Kurdish-English Ferheng/FreeDict Dictionary ver. 1.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-deu \"Svenska-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-fra \"Svenska-fran\xC3\xA7""ais FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-lat \"Svenska-latine FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-ell \"Svenska-\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAC FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-rus \"English-Russian FreeDict Dictionary ver. 0.3.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-por \"j\xC4\x99zyk polski-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-gla-deu \"Scottish Gaelic-German FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-ita \"English-Italian FreeDict Dictionary ver. 0.1.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-pol-ita \"j\xC4\x99zyk polski-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-swe \"fran\xC3\xA7""ais-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-isl-eng \"\xC3\xADslenska - English FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-spa \"Svenska-espa\xC3\xB1ol FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-nno-nob \"Norwegian Nynorsk-Norwegian Bokm\xC3\xA5l FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swe-ita \"Svenska-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-deu \"fran\xC3\xA7""ais-Deutsch FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fin-ita \"suomi-italiano FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-nld-fra \"Nederlands-French FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-eng-ara \"English-Arabic FreeDict Dictionary ver. 0.6.3\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-slk-eng \"Slovak-English FreeDict Dictionary ver. 0.2.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fra-por \"fran\xC3\xA7""ais-portugu\xC3\xAAs FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-spa-ast \"Spanish - Asturian FreeDict Dictionary ver. 0.1.1\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fin-jpn \"suomi-\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E (\xE3\x81\xAB\xE3\x81\xBB\xE3\x82\x93\xE3\x81\x94) FreeDict+WikDict dictionary ver. 2018.09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-deu-ita \"German-Italian FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-swh-eng \"Swahili-English xFried/FreeDict Dictionary ver. 0.4.4\"\r\n" +Debug: 05-18 22:43:22 receive db: "fd-fin-nor \"suomi-Norsk FreeDict+WikDict dictionary ver. 2018" +Debug: 05-18 22:43:22 received: ".09.13\"\r\n" +Debug: 05-18 22:43:22 receive db: ".09.13\"\r\n" +Debug: 05-18 22:43:22 Reloading all the tabs... +Debug: 05-18 22:43:22 starting create the fts with thread: 11 +Debug: 05-18 22:43:22 waiting for all the fts creation to finish. +Debug: 05-18 22:43:22 finished/cancel all the fts creation +Debug: 05-18 22:43:22 getResource: "gdlookup://localhost/?word=--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -2,6 +2,7 @@ %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy.erase(0, substring.size()); found %3D true; break; %7D %7D if (!found) %7B output_html +%3D sentence_copy[0]; sentence_copy.erase(0, 1); %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; std::string dict_file; log_internal(%22Program started%22); try %7B dict_file %3D find_dic_file().string(); log_internal(%22Dictionary file located at: %22 + dict_file); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: %22 %3C%3C e.what() %3C%3C std::endl; return 1; %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); if (!std::filesystem::exists(dict_file)) %7B log_internal(%22Error: Dictionary file not found at %22 + dict_file); std::cerr %3C%3C %22Error: Dictionary file not found at %22 %3C%3C dict_file %3C%3C std::endl; return 1; %7D i++; %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string; try %7B search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to retrieve search string.%22 %3C%3C std::endl; exit(1); %7D if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try %7B trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); %7D catch (const std::exception%26 e) %7B log_internal(std::string(%22Error: Failed to load trie from dictionary file: %22) + e.what()); std::cerr %3C%3C %22Error: Failed to load trie from dictionary file.%22 %3C%3C std::endl; return 1; %7D std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; log_internal(%22Starting search loop with search string: %22 + search_string); while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D log_internal(%22Search loop ended%22); if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); log_internal(%22HTML output wrapped%22); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:43:22 scheme: "gdlookup" +Debug: 05-18 22:43:22 host: "localhost" +Debug: 05-18 22:43:22 clear current dictionaries: "--- hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 09:00:00.000000000 +0000 @@ -2,6 +2,7 @@ #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy.erase(0, substring.size()); found = true; break; } } if (!found) { output_html += sentence_copy[0]; sentence_copy.erase(0, 1); } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; std::string dict_file; log_internal(\"Program started\"); try { dict_file = find_dic_file().string(); log_internal(\"Dictionary file located at: \" + dict_file); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: \" << e.what() << std::endl; return 1; } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); if (!std::filesystem::exists(dict_file)) { log_internal(\"Error: Dictionary file not found at \" + dict_file); std::cerr << \"Error: Dictionary file not found at \" << dict_file << std::endl; return 1; } i++; } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string; try { search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); } catch (const std::exception& e) { log_internal(std::string(\"Error: \") + e.what()); std::cerr << \"Error: Failed to retrieve search string.\" << std::endl; exit(1); } if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); xcdat::trie_15_type trie; try { trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); } catch (const std::exception& e) { log_internal(std::string(\"Error: Failed to load trie from dictionary file: \") + e.what()); std::cerr << \"Error: Failed to load trie from dictionary file.\" << std::endl; return 1; } std::vector substrings; std::vector results; std::map> alternatives_map; log_internal(\"Starting search loop with search string: \" + search_string); while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } log_internal(\"Search loop ended\"); if (debug_mode) { print_debug_info(substrings, raw_output); } if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); log_internal(\"HTML output wrapped\"); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 22:43:22 some body finished +Debug: 05-18 22:43:22 one not finished. +Debug: 05-18 22:43:22 ====reading 13682 of (13682) bytes . Finished: 0 +Debug: 05-18 22:43:22 ====reading 0 of (13682) bytes . Finished: 0 +Debug: 05-18 22:43:22 ====reading 0 of (13682) bytes . Finished: 0 +Warning: 05-18 22:43:22 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:43:22 received: "fd-fra-nld \"French-Dutch FreeDict Dictionary ver. 0.2\"\r\n" +Debug: 05-18 22:43:30 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 22:43:30 scheme: "gdlookup" +Debug: 05-18 22:43:30 host: "localhost" +Debug: 05-18 22:43:30 clear current dictionaries: "納得が行く" +Debug: 05-18 22:43:30 some body finished +Debug: 05-18 22:43:30 one not finished. +Debug: 05-18 22:43:30 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 22:43:30 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 22:43:30 ====reading 0 of (1418) bytes . Finished: 0 +Warning: 05-18 22:43:30 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 22:44:20 translating from clipboard or selection +Debug: 05-18 22:44:20 clipboard data: "" +Debug: 05-18 22:53:22 socket error message: QAbstractSocket::RemoteHostClosedError +Debug: 05-18 23:07:24 translating from clipboard or selection +Debug: 05-18 23:07:24 clipboard data: "l" +Debug: 05-18 23:07:24 Current state: true true false true +Debug: 05-18 23:07:24 getResource: "gdlookup://localhost/?word=l&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:07:24 scheme: "gdlookup" +Debug: 05-18 23:07:24 host: "localhost" +Debug: 05-18 23:07:24 clear current dictionaries: "l" +Debug: 05-18 23:07:24 some body finished +Debug: 05-18 23:07:24 one not finished. +Debug: 05-18 23:07:24 ====reading 1404 of (1404) bytes . Finished: 0 +Debug: 05-18 23:07:24 ====reading 0 of (1404) bytes . Finished: 0 +Debug: 05-18 23:07:24 ====reading 0 of (1404) bytes . Finished: 0 +Warning: 05-18 23:07:24 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:13:41 translating from clipboard or selection +Debug: 05-18 23:13:41 clipboard data: "転生" +Debug: 05-18 23:13:41 Current state: true false false true +Debug: 05-18 23:13:41 getResource: "gdlookup://localhost/?word=転生&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:13:41 scheme: "gdlookup" +Debug: 05-18 23:13:41 host: "localhost" +Debug: 05-18 23:13:41 clear current dictionaries: "転生" +Debug: 05-18 23:13:41 some body finished +Debug: 05-18 23:13:41 one not finished. +Debug: 05-18 23:13:41 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 23:13:41 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 23:13:41 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 23:13:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:13:41 translating from clipboard or selection +Debug: 05-18 23:13:41 clipboard data: "転生" +Debug: 05-18 23:13:41 Current state: true false true true +Debug: 05-18 23:13:41 getResource: "gdlookup://localhost/?word=転生&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:13:41 scheme: "gdlookup" +Debug: 05-18 23:13:41 host: "localhost" +Debug: 05-18 23:13:41 clear current dictionaries: "転生" +Debug: 05-18 23:13:41 some body finished +Debug: 05-18 23:13:41 one not finished. +Debug: 05-18 23:13:41 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 23:13:41 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 23:13:41 ====reading 0 of (1409) bytes . Finished: 0 +Warning: 05-18 23:13:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:40:41 translating from clipboard or selection +Debug: 05-18 23:40:41 clipboard data: "input back to GoldenDict as HTML with sentence split into parts" +Debug: 05-18 23:40:41 Current state: true true false true +Debug: 05-18 23:40:41 getResource: "gdlookup://localhost/?word=input back to GoldenDict as HTML with sentence split into parts&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:40:41 scheme: "gdlookup" +Debug: 05-18 23:40:41 host: "localhost" +Debug: 05-18 23:40:41 clear current dictionaries: "input back to GoldenDict as HTML with sentence split into parts" +Debug: 05-18 23:40:41 some body finished +Debug: 05-18 23:40:41 one not finished. +Debug: 05-18 23:40:41 ====reading 1466 of (1466) bytes . Finished: 0 +Debug: 05-18 23:40:41 ====reading 0 of (1466) bytes . Finished: 0 +Debug: 05-18 23:40:41 ====reading 0 of (1466) bytes . Finished: 0 +Warning: 05-18 23:40:41 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:41:11 translating from clipboard or selection +Debug: 05-18 23:41:11 clipboard data: "cat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF" +Debug: 05-18 23:41:11 Current state: true false false true +Debug: 05-18 23:41:11 getResource: "gdlookup://localhost/?word=cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:41:11 scheme: "gdlookup" +Debug: 05-18 23:41:11 host: "localhost" +Debug: 05-18 23:41:11 clear current dictionaries: "cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF" +Debug: 05-18 23:41:11 some body finished +Debug: 05-18 23:41:11 one not finished. +Debug: 05-18 23:41:11 ====reading 1559 of (1559) bytes . Finished: 0 +Debug: 05-18 23:41:11 ====reading 0 of (1559) bytes . Finished: 0 +Debug: 05-18 23:41:11 ====reading 0 of (1559) bytes . Finished: 0 +Warning: 05-18 23:41:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:41:14 translating from clipboard or selection +Debug: 05-18 23:41:14 clipboard data: "cat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF" +Debug: 05-18 23:41:14 Current state: true false true true +Debug: 05-18 23:41:14 getResource: "gdlookup://localhost/?word=cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:41:14 scheme: "gdlookup" +Debug: 05-18 23:41:14 host: "localhost" +Debug: 05-18 23:41:14 clear current dictionaries: "cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF" +Debug: 05-18 23:41:14 some body finished +Debug: 05-18 23:41:14 one not finished. +Debug: 05-18 23:41:14 ====reading 1559 of (1559) bytes . Finished: 0 +Debug: 05-18 23:41:14 ====reading 0 of (1559) bytes . Finished: 0 +Debug: 05-18 23:41:14 ====reading 0 of (1559) bytes . Finished: 0 +Warning: 05-18 23:41:14 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:42:52 translating from clipboard or selection +Debug: 05-18 23:42:52 clipboard data: "// filename: hakurei.cpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
                \" + substring + \"\";\n\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
                  \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
                • \" + alt + \"
                • \";\n\t }\n\t output_html += \"
                \";\n\t}\n\n\toutput_html += \"
                \"; \n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tlog_internal(\"Substring added: \" + substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 23:42:52 Current state: true false true true +Debug: 05-18 23:42:52 getResource: "gdlookup://localhost/?word=// filename: hakurei.cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:42:52 scheme: "gdlookup" +Debug: 05-18 23:42:52 host: "localhost" +Debug: 05-18 23:42:52 clear current dictionaries: "// filename: hakurei.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 23:42:52 some body finished +Debug: 05-18 23:42:52 one not finished. +Debug: 05-18 23:42:52 ====reading 13519 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:52 ====reading 0 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:52 ====reading 0 of (13519) bytes . Finished: 0 +Warning: 05-18 23:42:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:42:52 translating from clipboard or selection +Debug: 05-18 23:42:52 clipboard data: "// filename: hakurei.cpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
                \" + substring + \"\";\n\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
                  \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
                • \" + alt + \"
                • \";\n\t }\n\t output_html += \"
                \";\n\t}\n\n\toutput_html += \"
                \"; \n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tlog_internal(\"Substring added: \" + substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 23:42:52 Current state: true false true true +Debug: 05-18 23:42:52 getResource: "gdlookup://localhost/?word=// filename: hakurei.cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:42:52 scheme: "gdlookup" +Debug: 05-18 23:42:52 host: "localhost" +Debug: 05-18 23:42:52 clear current dictionaries: "// filename: hakurei.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 23:42:52 some body finished +Debug: 05-18 23:42:52 one not finished. +Debug: 05-18 23:42:52 ====reading 13519 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:52 ====reading 0 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:52 ====reading 0 of (13519) bytes . Finished: 0 +Warning: 05-18 23:42:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:42:52 translating from clipboard or selection +Debug: 05-18 23:42:53 clipboard data: "// filename: hakurei.cpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
                \" + substring + \"\";\n\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
                  \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
                • \" + alt + \"
                • \";\n\t }\n\t output_html += \"
                \";\n\t}\n\n\toutput_html += \"
                \"; \n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tlog_internal(\"Substring added: \" + substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 23:42:53 Current state: true false true true +Debug: 05-18 23:42:53 getResource: "gdlookup://localhost/?word=// filename: hakurei.cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:42:53 scheme: "gdlookup" +Debug: 05-18 23:42:53 host: "localhost" +Debug: 05-18 23:42:53 clear current dictionaries: "// filename: hakurei.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 23:42:53 some body finished +Debug: 05-18 23:42:53 one not finished. +Debug: 05-18 23:42:53 ====reading 13519 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:53 ====reading 0 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:53 ====reading 0 of (13519) bytes . Finished: 0 +Warning: 05-18 23:42:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:42:53 translating from clipboard or selection +Debug: 05-18 23:42:53 clipboard data: "// filename: hakurei.cpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
                \" + substring + \"\";\n\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
                  \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
                • \" + alt + \"
                • \";\n\t }\n\t output_html += \"
                \";\n\t}\n\n\toutput_html += \"
                \"; \n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tlog_internal(\"Substring added: \" + substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 23:42:53 Current state: true false true true +Debug: 05-18 23:42:53 getResource: "gdlookup://localhost/?word=// filename: hakurei.cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:42:53 scheme: "gdlookup" +Debug: 05-18 23:42:53 host: "localhost" +Debug: 05-18 23:42:53 clear current dictionaries: "// filename: hakurei.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 23:42:53 some body finished +Debug: 05-18 23:42:53 one not finished. +Debug: 05-18 23:42:53 ====reading 13519 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:53 ====reading 0 of (13519) bytes . Finished: 0 +Debug: 05-18 23:42:53 ====reading 0 of (13519) bytes . Finished: 0 +Warning: 05-18 23:42:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:43:11 translating from clipboard or selection +Debug: 05-18 23:43:11 clipboard data: "" +Debug: 05-18 23:44:03 translating from clipboard or selection +Debug: 05-18 23:44:03 clipboard data: "" +Debug: 05-18 23:44:08 translating from clipboard or selection +Debug: 05-18 23:44:08 clipboard data: "" +Debug: 05-18 23:45:07 translating from clipboard or selection +Debug: 05-18 23:45:07 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/mecab-cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=\"\"\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_user_dict() {\n\tfind \\\n\t\t\"$USER_DICT\" \\\n\t\t/usr/share/gd-tools/user_dic.dic \\\n\t\t~/.local/share/gd-tools/user_dic.dic \\\n\t\t-type f -print -quit 2>/dev/null\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t/usr/lib/mecab/dic/mecab-ipadic-neologd \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit 2>/dev/null\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tlocal -r user_dict=$(find_user_dict)\n\tlocal -a args=(\n\t\tmecab\n\t\t--node-format='%m'\n\t\t--unk-format='%m'\n\t\t--eos-format='
                '\n\t\t--dicdir=\"$(find_dicdir)\"\n\t\t--userdic=\"${USER_DICT}\"\n\t)\n\tif [[ -n $user_dict ]]; then\n\t\targs+=(\"$user_dict\")\n\tfi\n\t\"${args[@]}\"\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
                '\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
                '\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 23:45:07 Current state: true false true true +Debug: 05-18 23:45:07 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/mecab-cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D%22%22 FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_user_dict() %7B find %5C %22$USER_DICT%22 %5C /usr/share/gd-tools/user_dic.dic %5C ~/.local/share/gd-tools/user_dic.dic %5C -type f -print -quit 2%3E/dev/null %7D find_dicdir() %7B dirname -- %22$( find %5C /usr/lib/mecab/dic/mecab-ipadic-neologd %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit 2%3E/dev/null )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi local -r user_dict%3D$(find_user_dict) local -a args%3D( mecab --node-format%3D%27%3Ca href%3D%22bword:%25f[6]%22%3E%25m%3C/a%3E%27 --unk-format%3D%27%3Ca href%3D%22bword:%25m%22%3E%25m%3C/a%3E%27 --eos-format%3D%27%3Cbr%3E%27 --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 ) if [[ -n $user_dict ]]; then args+%3D(%22$user_dict%22) fi %22$%7Bargs[@]%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E * %7B margin: 0; padding: 0; %7D .gd-mecab %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mecab a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mecab a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mecab a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if [[ -n $USER_DICT ]] %26%26 ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mecab%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:45:07 scheme: "gdlookup" +Debug: 05-18 23:45:07 host: "localhost" +Debug: 05-18 23:45:07 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/mecab-cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=\"\" FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_user_dict() { find \\ \"$USER_DICT\" \\ /usr/share/gd-tools/user_dic.dic \\ ~/.local/share/gd-tools/user_dic.dic \\ -type f -print -quit 2>/dev/null } find_dicdir() { dirname -- \"$( find \\ /usr/lib/mecab/dic/mecab-ipadic-neologd \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit 2>/dev/null )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi local -r user_dict=$(find_user_dict) local -a args=( mecab --node-format='%m' --unk-format='%m' --eos-format='
                ' --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" ) if [[ -n $user_dict ]]; then args+=(\"$user_dict\") fi \"${args[@]}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
                ' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
                ' print_css } main \"$@\"" +Debug: 05-18 23:45:07 some body finished +Debug: 05-18 23:45:07 one not finished. +Debug: 05-18 23:45:07 ====reading 5843 of (5843) bytes . Finished: 0 +Debug: 05-18 23:45:07 ====reading 0 of (5843) bytes . Finished: 0 +Debug: 05-18 23:45:07 ====reading 0 of (5843) bytes . Finished: 0 +Warning: 05-18 23:45:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:45:07 translating from clipboard or selection +Debug: 05-18 23:45:07 clipboard data: "#!/bin/bash\n#\n# gd-tools - a set of programs to enhance goldendict for immersion learning.\n# Copyright (C) 2023 Ajatt-Tools\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n\nset -euo pipefail\n\n# Requires installing mecab\n# Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html.\n\nTEMP_FILE=/tmp/mecab-cache\n\n# Default path to user_dic.dic, assuming that the user ran `xmake install`.\nUSER_DICT=\"\"\n\nFONT_SIZE=2rem\nGDWORD=\"\"\nGDSEARCH=\"\"\n\nsanitize_input() {\n\tsed -E \\\n\t\t-e 's, +,,g' \\\n\t\t-e 's,[a-z]+, ,Ig' \\\n\t\t-e 's,\\n, ,g'\n}\n\nusage() {\n\tlocal -r bn=$(basename -- \"$0\")\n\tcat <<-EOF\n\t\tusage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH%\n\n\t\techo input back to GoldenDict as HTML with sentence split into parts\n\n\t\tOPTIONS\n\tEOF\n\tcolumn -t -s'|' <<-EOF\n\t\t --user-dict PATH|path to the user dictionary.\n\t\t --font-size SIZE|font size. The default value is 30px\n\tEOF\n}\n\nfind_user_dict() {\n\tfind \\\n\t\t\"$USER_DICT\" \\\n\t\t/usr/share/gd-tools/user_dic.dic \\\n\t\t~/.local/share/gd-tools/user_dic.dic \\\n\t\t-type f -print -quit 2>/dev/null\n}\n\nfind_dicdir() {\n\tdirname -- \"$(\n\t\tfind \\\n\t\t\t/usr/lib/mecab/dic/mecab-ipadic-neologd \\\n\t\t\t/usr/lib/mecab/dic \\\n\t\t\t~/.local/share/Anki2/addons21 \\\n\t\t\t-type f -name dicrc -print -quit 2>/dev/null\n\t)\"\n}\n\nmecab_split() {\n\tif ! command -v mecab &>/dev/null; then\n\t\techo \"Error: MeCab is not installed. Please install MeCab and try again.\"\n\t\texit 1\n\tfi\n\n\tlocal -r user_dict=$(find_user_dict)\n\tlocal -a args=(\n\t\tmecab\n\t\t--node-format='%m'\n\t\t--unk-format='%m'\n\t\t--eos-format='
                '\n\t\t--dicdir=\"$(find_dicdir)\"\n\t\t--userdic=\"${USER_DICT}\"\n\t)\n\tif [[ -n $user_dict ]]; then\n\t\targs+=(\"$user_dict\")\n\tfi\n\t\"${args[@]}\"\n}\n\nprint_css() {\n\tcat <<-EOF\n\t\t\n\tEOF\n}\n\nhighlight_word() {\n\tlocal target_word=$* search=\"\"\n\tsearch=$(cat -- -)\n\tsearch=${search//\">$target_word<\"/\">${target_word}<\"}\n\techo \"$search\"\n}\n\ndie() {\n\techo \"$*\" >&2\n\tnotify-send \"$(basename -- \"$0\")\" \"$*\" &\n\texit 1\n}\n\nmain() {\n\tif (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then\n\t\tusage\n\t\texit\n\tfi\n\twhile (($# > 0)); do\n\t\tcase $1 in\n\t\t--font-size)\n\t\t\tshift\n\t\t\tFONT_SIZE=$1\n\t\t\t;;\n\t\t--user-dict)\n\t\t\tshift\n\t\t\tUSER_DICT=$1\n\t\t\t;;\n\t\t--word)\n\t\t\tshift\n\t\t\tGDWORD=$1\n\t\t\t;;\n\t\t--sentence)\n\t\t\tshift\n\t\t\tGDSEARCH=$1\n\t\t\t;;\n\t\t*)\n\t\t\tdie \"Invalid argument passed.\"\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\n\tif [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then\n\t\tdie \"Provided user dictionary doesn't exist or isn't a file.\"\n\tfi\n\n\tif [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then\n\t\tdie \"Not enough parameters.\"\n\tfi\n\n\tlocal -r input=$(echo \"$GDSEARCH\" | sanitize_input)\n\tlocal -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\")\n\n\techo '
                '\n\tif [[ -n $output ]]; then\n\t\techo \"$output\" |\n\t\t\ttail -1 |\n\t\t\thighlight_word \"$GDWORD\"\n\telse\n\t\techo \"$input\" |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\tmecab_split |\n\t\t\ttee -a \"$TEMP_FILE\" |\n\t\t\thighlight_word \"$GDWORD\"\n\t\tprintf -- '\\n\\n' >>\"$TEMP_FILE\"\n\tfi\n\techo '
                '\n\n\tprint_css\n}\n\nmain \"$@\"\n" +Debug: 05-18 23:45:07 Current state: true false true true +Debug: 05-18 23:45:07 getResource: "gdlookup://localhost/?word=%23!/bin/bash %23 %23 gd-tools - a set of programs to enhance goldendict for immersion learning. %23 Copyright (C) 2023 Ajatt-Tools %23 %23 This program is free software: you can redistribute it and/or modify %23 it under the terms of the GNU General Public License as published by %23 the Free Software Foundation, either version 3 of the License, or %23 (at your option) any later version. %23 %23 This program is distributed in the hope that it will be useful, %23 but WITHOUT ANY WARRANTY; without even the implied warranty of %23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %23 GNU General Public License for more details. %23 %23 You should have received a copy of the GNU General Public License %23 along with this program. If not, see %3Chttps://www.gnu.org/licenses/%3E. set -euo pipefail %23 Requires installing mecab %23 Open GoldenDict, press %22Edit%22 %3E %22Dictionaries%22 %3E %22Programs%22 and add this script as type html. TEMP_FILE%3D/tmp/mecab-cache %23 Default path to user_dic.dic, assuming that the user ran %60xmake install%60. USER_DICT%3D%22%22 FONT_SIZE%3D2rem GDWORD%3D%22%22 GDSEARCH%3D%22%22 sanitize_input() %7B sed -E %5C -e %27s, +,,g%27 %5C -e %27s,[a-z]+, ,Ig%27 %5C -e %27s,%5Cn, ,g%27 %7D usage() %7B local -r bn%3D$(basename -- %22$0%22) cat %3C%3C-EOF usage: $bn [OPTIONS] --word %25GDWORD%25 --sentence %25GDSEARCH%25 echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s%27%7C%27 %3C%3C-EOF --user-dict PATH%7Cpath to the user dictionary. --font-size SIZE%7Cfont size. The default value is 30px EOF %7D find_user_dict() %7B find %5C %22$USER_DICT%22 %5C /usr/share/gd-tools/user_dic.dic %5C ~/.local/share/gd-tools/user_dic.dic %5C -type f -print -quit 2%3E/dev/null %7D find_dicdir() %7B dirname -- %22$( find %5C /usr/lib/mecab/dic/mecab-ipadic-neologd %5C /usr/lib/mecab/dic %5C ~/.local/share/Anki2/addons21 %5C -type f -name dicrc -print -quit 2%3E/dev/null )%22 %7D mecab_split() %7B if ! command -v mecab %26%3E/dev/null; then echo %22Error: MeCab is not installed. Please install MeCab and try again.%22 exit 1 fi local -r user_dict%3D$(find_user_dict) local -a args%3D( mecab --node-format%3D%27%3Ca href%3D%22bword:%25f[6]%22%3E%25m%3C/a%3E%27 --unk-format%3D%27%3Ca href%3D%22bword:%25m%22%3E%25m%3C/a%3E%27 --eos-format%3D%27%3Cbr%3E%27 --dicdir%3D%22$(find_dicdir)%22 --userdic%3D%22$%7BUSER_DICT%7D%22 ) if [[ -n $user_dict ]]; then args+%3D(%22$user_dict%22) fi %22$%7Bargs[@]%7D%22 %7D print_css() %7B cat %3C%3C-EOF %3Cstyle%3E * %7B margin: 0; padding: 0; %7D .gd-mecab %7B font-size: $%7BFONT_SIZE:-2rem%7D; color: %231268c3; font-weight: normal; %7D .gd-mecab a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; %7D .gd-mecab a:not(:last-of-type)::after %7B content: %22%22; display: inline-block; background-color: %23333; margin: 4px; width: 3px; height: 3px; border-radius: 100vmax; vertical-align: middle; cursor: text; user-select: text; %7D .gd-mecab a b %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D %3C/style%3E EOF %7D highlight_word() %7B local target_word%3D$* search%3D%22%22 search%3D$(cat -- -) search%3D$%7Bsearch//%22%3E$target_word%3C%22/%22%3E%3Cb%3E$%7Btarget_word%7D%3C/b%3E%3C%22%7D echo %22$search%22 %7D die() %7B echo %22$*%22 %3E%262 notify-send %22$(basename -- %22$0%22)%22 %22$*%22 %26 exit 1 %7D main() %7B if (($%23 %3D%3D 0)) %7C%7C [[ $* %3D%3D --help ]] %7C%7C [[ $* %3D%3D -h ]]; then usage exit fi while (($%23 %3E 0)); do case $1 in --font-size) shift FONT_SIZE%3D$1 ;; --user-dict) shift USER_DICT%3D$1 ;; --word) shift GDWORD%3D$1 ;; --sentence) shift GDSEARCH%3D$1 ;; *) die %22Invalid argument passed.%22 ;; esac shift done if [[ -n $USER_DICT ]] %26%26 ! [[ -f $USER_DICT ]]; then die %22Provided user dictionary doesn%27t exist or isn%27t a file.%22 fi if [[ -z $GDSEARCH ]] %7C%7C [[ -z $GDWORD ]]; then die %22Not enough parameters.%22 fi local -r input%3D$(echo %22$GDSEARCH%22 %7C sanitize_input) local -r output%3D$(grep -Fxs -A1 %22$input%22 -- %22$TEMP_FILE%22) echo %27%3Cdiv class%3D%22gd-mecab%22%3E%27 if [[ -n $output ]]; then echo %22$output%22 %7C tail -1 %7C highlight_word %22$GDWORD%22 else echo %22$input%22 %7C tee -a %22$TEMP_FILE%22 %7C mecab_split %7C tee -a %22$TEMP_FILE%22 %7C highlight_word %22$GDWORD%22 printf -- %27%5Cn%5Cn%27 %3E%3E%22$TEMP_FILE%22 fi echo %27%3C/div%3E%27 print_css %7D main %22$@%22&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:45:07 scheme: "gdlookup" +Debug: 05-18 23:45:07 host: "localhost" +Debug: 05-18 23:45:07 clear current dictionaries: "#!/bin/bash # # gd-tools - a set of programs to enhance goldendict for immersion learning. # Copyright (C) 2023 Ajatt-Tools # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -euo pipefail # Requires installing mecab # Open GoldenDict, press \"Edit\" > \"Dictionaries\" > \"Programs\" and add this script as type html. TEMP_FILE=/tmp/mecab-cache # Default path to user_dic.dic, assuming that the user ran `xmake install`. USER_DICT=\"\" FONT_SIZE=2rem GDWORD=\"\" GDSEARCH=\"\" sanitize_input() { sed -E \\ -e 's, +,,g' \\ -e 's,[a-z]+, ,Ig' \\ -e 's,\\n, ,g' } usage() { local -r bn=$(basename -- \"$0\") cat <<-EOF usage: $bn [OPTIONS] --word %GDWORD% --sentence %GDSEARCH% echo input back to GoldenDict as HTML with sentence split into parts OPTIONS EOF column -t -s'|' <<-EOF --user-dict PATH|path to the user dictionary. --font-size SIZE|font size. The default value is 30px EOF } find_user_dict() { find \\ \"$USER_DICT\" \\ /usr/share/gd-tools/user_dic.dic \\ ~/.local/share/gd-tools/user_dic.dic \\ -type f -print -quit 2>/dev/null } find_dicdir() { dirname -- \"$( find \\ /usr/lib/mecab/dic/mecab-ipadic-neologd \\ /usr/lib/mecab/dic \\ ~/.local/share/Anki2/addons21 \\ -type f -name dicrc -print -quit 2>/dev/null )\" } mecab_split() { if ! command -v mecab &>/dev/null; then echo \"Error: MeCab is not installed. Please install MeCab and try again.\" exit 1 fi local -r user_dict=$(find_user_dict) local -a args=( mecab --node-format='%m' --unk-format='%m' --eos-format='
                ' --dicdir=\"$(find_dicdir)\" --userdic=\"${USER_DICT}\" ) if [[ -n $user_dict ]]; then args+=(\"$user_dict\") fi \"${args[@]}\" } print_css() { cat <<-EOF EOF } highlight_word() { local target_word=$* search=\"\" search=$(cat -- -) search=${search//\">$target_word<\"/\">${target_word}<\"} echo \"$search\" } die() { echo \"$*\" >&2 notify-send \"$(basename -- \"$0\")\" \"$*\" & exit 1 } main() { if (($# == 0)) || [[ $* == --help ]] || [[ $* == -h ]]; then usage exit fi while (($# > 0)); do case $1 in --font-size) shift FONT_SIZE=$1 ;; --user-dict) shift USER_DICT=$1 ;; --word) shift GDWORD=$1 ;; --sentence) shift GDSEARCH=$1 ;; *) die \"Invalid argument passed.\" ;; esac shift done if [[ -n $USER_DICT ]] && ! [[ -f $USER_DICT ]]; then die \"Provided user dictionary doesn't exist or isn't a file.\" fi if [[ -z $GDSEARCH ]] || [[ -z $GDWORD ]]; then die \"Not enough parameters.\" fi local -r input=$(echo \"$GDSEARCH\" | sanitize_input) local -r output=$(grep -Fxs -A1 \"$input\" -- \"$TEMP_FILE\") echo '
                ' if [[ -n $output ]]; then echo \"$output\" | tail -1 | highlight_word \"$GDWORD\" else echo \"$input\" | tee -a \"$TEMP_FILE\" | mecab_split | tee -a \"$TEMP_FILE\" | highlight_word \"$GDWORD\" printf -- '\\n\\n' >>\"$TEMP_FILE\" fi echo '
                ' print_css } main \"$@\"" +Debug: 05-18 23:45:07 some body finished +Debug: 05-18 23:45:07 one not finished. +Debug: 05-18 23:45:07 ====reading 5843 of (5843) bytes . Finished: 0 +Debug: 05-18 23:45:07 ====reading 0 of (5843) bytes . Finished: 0 +Debug: 05-18 23:45:07 ====reading 0 of (5843) bytes . Finished: 0 +Warning: 05-18 23:45:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:45:54 translating from clipboard or selection +Debug: 05-18 23:45:54 clipboard data: "do " +Debug: 05-18 23:45:54 Current state: true false true true +Debug: 05-18 23:45:54 getResource: "gdlookup://localhost/?word=do&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:45:54 scheme: "gdlookup" +Debug: 05-18 23:45:54 host: "localhost" +Debug: 05-18 23:45:54 clear current dictionaries: "do" +Debug: 05-18 23:45:54 some body finished +Debug: 05-18 23:45:54 one not finished. +Debug: 05-18 23:45:54 ====reading 1405 of (1405) bytes . Finished: 0 +Debug: 05-18 23:45:54 ====reading 0 of (1405) bytes . Finished: 0 +Debug: 05-18 23:45:54 ====reading 0 of (1405) bytes . Finished: 0 +Warning: 05-18 23:45:54 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:46:48 translating from clipboard or selection +Debug: 05-18 23:46:48 clipboard data: "// filename: hakurei.cpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
                \" + substring + \"\";\n\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
                  \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
                • \" + alt + \"
                • \";\n\t }\n\t output_html += \"
                \";\n\t}\n\n\toutput_html += \"
                \"; \n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tlog_internal(\"Substring added: \" + substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 23:46:48 Current state: true false true true +Debug: 05-18 23:46:48 getResource: "gdlookup://localhost/?word=// filename: hakurei.cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:46:48 scheme: "gdlookup" +Debug: 05-18 23:46:48 host: "localhost" +Debug: 05-18 23:46:48 clear current dictionaries: "// filename: hakurei.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 23:46:48 some body finished +Debug: 05-18 23:46:48 one not finished. +Debug: 05-18 23:46:48 ====reading 13519 of (13519) bytes . Finished: 0 +Debug: 05-18 23:46:48 ====reading 0 of (13519) bytes . Finished: 0 +Debug: 05-18 23:46:48 ====reading 0 of (13519) bytes . Finished: 0 +Warning: 05-18 23:46:48 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:46:49 translating from clipboard or selection +Debug: 05-18 23:46:49 clipboard data: "// filename: hakurei.cpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
                \" + substring + \"\";\n\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
                  \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
                • \" + alt + \"
                • \";\n\t }\n\t output_html += \"
                \";\n\t}\n\n\toutput_html += \"
                \"; \n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tlog_internal(\"Substring added: \" + substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 23:46:49 Current state: true false true true +Debug: 05-18 23:46:49 getResource: "gdlookup://localhost/?word=// filename: hakurei.cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:46:49 scheme: "gdlookup" +Debug: 05-18 23:46:49 host: "localhost" +Debug: 05-18 23:46:49 clear current dictionaries: "// filename: hakurei.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 23:46:49 some body finished +Debug: 05-18 23:46:49 one not finished. +Debug: 05-18 23:46:49 ====reading 13519 of (13519) bytes . Finished: 0 +Debug: 05-18 23:46:49 ====reading 0 of (13519) bytes . Finished: 0 +Debug: 05-18 23:46:49 ====reading 0 of (13519) bytes . Finished: 0 +Warning: 05-18 23:46:49 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:46:49 translating from clipboard or selection +Debug: 05-18 23:46:49 clipboard data: "// filename: hakurei.cpp\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstruct Entry {\n const std::string_view decoded_view;\n const uint64_t id;\n inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {}\n};\n\ninline std::pair remove_one_utf8_char(const std::string& str) {\n if (str.empty()) {\n return {\"\", str};\n }\n const size_t len = str.size();\n size_t i = 0;\n while (i < len) {\n const unsigned char c = str[i];\n if (c < 0x80) { \n return {str.substr(i, 1), str.substr(i + 1)};\n } else if ((c >> 5) == 0x6) { \n return {str.substr(i, 2), str.substr(i + 2)};\n } else if ((c >> 4) == 0xe) { \n return {str.substr(i, 3), str.substr(i + 3)};\n } else if ((c >> 3) == 0x1e) { \n return {str.substr(i, 4), str.substr(i + 4)};\n }\n i++;\n }\n return {\"\", \"\"};\n}\n\ninline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n std::string search_string;\n if (!isatty(fileno(stdin))) { \n std::getline(std::cin, search_string);\n } else { \n if (goldendict_mode) {\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n\t search_string = argv[i + 1];\n\t break;\n\t}\n }\n } else {\n if (argc < 2) {\n\tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n\texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n\tif (std::strcmp(argv[i], \"--debug\") == 0) {\n\t // Handle debug mode\n\t} else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n\t i++;\n\t} else {\n\t search_string = argv[i];\n\t break;\n\t}\n }\n }\n }\n if (search_string.empty()) {\n std::cerr << \"Search string not provided.\" << std::endl;\n exit(1);\n }\n return search_string;\n}\n\ninline std::filesystem::path find_dic_file() {\n static const std::vector locations = {\n std::filesystem::path(\"/usr/share/hakurei/\"),\n std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\",\n std::filesystem::current_path()\n };\n for (const auto& location : locations) {\n const auto dict_path = location / \"dict.bin\";\n if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) {\n return dict_path;\n }\n }\n throw std::runtime_error(\"Couldn't find the word list.\");\n}\n\ninline void print_debug_info(const std::vector& substrings, const std::string& raw_output) {\n std::cout << \"Stored raw output:\" << std::endl;\n for (const auto& str : substrings) {\n std::cout << str << std::endl;\n }\n std::cout << \"Raw output:\" << std::endl;\n std::cout << raw_output << std::endl;\n}\n\n\nvoid log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n\n std::time_t now = std::time(nullptr);\n log_file << \"Hakurei executed at \" << std::ctime(&now);\n log_file << \"Command-line arguments:\\n\";\n for (int i = 0; i < argc; ++i) {\n log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\";\n }\n log_file << \"Parsed parameters:\\n\";\n log_file << \"search_string: \" << search_string << \"\\n\";\n log_file << \"dict_file: \" << dict_file << \"\\n\";\n log_file << \"debug_mode: \" << debug_mode << \"\\n\";\n log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\";\n\n log_file.close();\n}\n\n\nvoid log_internal(const std::string& message) {\n std::ofstream log_file;\n log_file.open(\"/tmp/hakurei.log\", std::ios_base::app);\n if (!log_file) {\n std::cerr << \"Failed to open log file.\" << std::endl;\n return;\n }\n std::time_t now = std::time(nullptr);\n log_file << std::ctime(&now) << \": \" << message << std::endl;\n log_file.close();\n}\n\n\ninline void wrap_html_output(\n\t\t\t const std::vector& substrings,\n\t\t\t const std::map>& alternatives_map,\n\t\t\t std::string& sentence\n\t\t\t ) {\n // Log the HTML output call\n log_internal(\"HTML output is being called\");\n\n std::string output_html;\n output_html += \"
                \";\n\n std::string sentence_copy = sentence;\n\n output_html += \"
                \"; \n\n while (!sentence_copy.empty()) {\n bool found = false;\n for (const auto& substring : substrings) {\n if (sentence_copy.rfind(substring, 0) == 0) {\n\toutput_html += \"
                \" + substring + \"\";\n\n\tauto alt_itr = alternatives_map.find(sentence_copy);\n\tif (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) {\n\t output_html += \"
                  \";\n\t for (const auto& alt : alt_itr->second) {\n\t output_html += \"
                • \" + alt + \"
                • \";\n\t }\n\t output_html += \"
                \";\n\t}\n\n\toutput_html += \"
                \"; \n\toutput_html += \"\";\n\n\tsentence_copy = sentence_copy.substr(substring.size());\n\tfound = true;\n\tbreak;\n }\n }\n if (!found) {\n const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy);\n if (removed_char.empty()) {\n\tstd::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl;\n\tbreak;\n }\n output_html += \"
                \" + removed_char + \"
                \";\n sentence_copy = new_sentence_copy;\n }\n }\n\n output_html += \"
                \"; \n output_html += \"
                \";\n std::cout << output_html << std::endl;\n}\n\n\n\nint main(const int argc, char* argv[]) {\n\n std::string dict_file = find_dic_file().string(); // Default dictionary file path\n const auto trie = xcdat::load(dict_file);\n log_internal(\"Trie loaded from dictionary file\");\n\n \n bool debug_mode = false;\n bool goldendict_mode = false;\n std::string word, sentence;\n\n log_internal(\"Program started\");\n\n // Parse command line arguments\n for (int i = 1; i < argc; ++i) {\n if (std::strcmp(argv[i], \"--debug\") == 0) {\n debug_mode = true;\n log_internal(\"Debug mode enabled\");\n } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n dict_file = argv[i + 1];\n log_internal(\"Dictionary file set to: \" + dict_file);\n i++; // Skip the next argument as it's the dictionary file path\n } else if (std::strcmp(argv[i], \"--goldendict\") == 0) {\n goldendict_mode = true;\n log_internal(\"GoldenDict mode enabled\");\n } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) {\n word = argv[i + 1];\n log_internal(\"Word set to: \" + word);\n i++;\n } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n sentence = argv[i + 1];\n log_internal(\"Sentence set to: \" + sentence);\n i++;\n }\n }\n\n std::string search_string = get_input(argc, argv, goldendict_mode);\n log_internal(\"Search string: \" + search_string);\n if (goldendict_mode && !sentence.empty()) {\n search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);\n }\n\n // Log the execution details\n log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode);\n\n std::string raw_output;\n\n std::vector substrings;\n std::vector results;\n std::map> derived_map;\n std::map> alternatives_map;\n\n while (!search_string.empty()) {\n auto itr = trie.make_prefix_iterator(search_string);\n\n while (itr.next()) {\n results.emplace_back(itr.decoded_view(), itr.id());\n log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n }\n\n // Add all substrings to the results\n if (!results.empty()) {\n for (const auto& entry : results) {\n\tconst std::string substring(entry.decoded_view);\n\tsubstrings.push_back(substring);\n\tderived_map[substring].push_back(search_string);\n\talternatives_map[search_string].insert(substring);\n\tlog_internal(\"Substring added: \" + substring);\n\tif (!goldendict_mode) {\n\t std::cout << substring << std::endl;\n\t}\n }\n }\n\n // Remove one UTF-8 character from the search string and get the removed character\n const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n log_internal(\"Removed character: \" + removed_char);\n\n if (!removed_char.empty() && !goldendict_mode) {\n std::cout << removed_char << std::endl;\n }\n\n if (new_search_string == search_string) {\n std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n break;\n }\n\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n raw_output += search_string + '\\n';\n }\n\n results.clear();\n\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n\n // Print debug information if in debug mode\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n exit(0);\n }\n\n log_internal(\"Program finished\");\n return 0;\n}\n" +Debug: 05-18 23:46:49 Current state: true false true true +Debug: 05-18 23:46:49 getResource: "gdlookup://localhost/?word=// filename: hakurei.cpp %23include %3Ciostream%3E %23include %3Cvector%3E %23include %3Calgorithm%3E %23include %3Climits%3E %23include %3Ccstring%3E %23include %3Ccctype%3E %23include %3Cxcdat.hpp%3E %23include %3Cutility%3E %23include %3Cunistd.h%3E %23include %3Cfilesystem%3E %23include %3Cmap%3E %23include %3Cset%3E %23include %3Cfstream%3E %23include %3Cctime%3E struct Entry %7B const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) %7B%7D %7D; inline std::pair%3Cstd::string, std::string%3E remove_one_utf8_char(const std::string%26 str) %7B if (str.empty()) %7B return %7B%22%22, str%7D; %7D const size_t len %3D str.size(); size_t i %3D 0; while (i %3C len) %7B const unsigned char c %3D str[i]; if (c %3C 0x80) %7B return %7Bstr.substr(i, 1), str.substr(i + 1)%7D; %7D else if ((c %3E%3E 5) %3D%3D 0x6) %7B return %7Bstr.substr(i, 2), str.substr(i + 2)%7D; %7D else if ((c %3E%3E 4) %3D%3D 0xe) %7B return %7Bstr.substr(i, 3), str.substr(i + 3)%7D; %7D else if ((c %3E%3E 3) %3D%3D 0x1e) %7B return %7Bstr.substr(i, 4), str.substr(i + 4)%7D; %7D i++; %7D return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B std::string search_string; if (!isatty(fileno(stdin))) %7B std::getline(std::cin, search_string); %7D else %7B if (goldendict_mode) %7B for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B search_string %3D argv[i + 1]; break; %7D %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B // Handle debug mode %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B i++; %7D else %7B search_string %3D argv[i]; break; %7D %7D %7D %7D if (search_string.empty()) %7B std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; exit(1); %7D return search_string; %7D inline std::filesystem::path find_dic_file() %7B static const std::vector%3Cstd::filesystem::path%3E locations %3D %7B std::filesystem::path(%22/usr/share/hakurei/%22), std::filesystem::path(std::getenv(%22HOME%22)) / %22.local/share/hakurei/%22, std::filesystem::current_path() %7D; for (const auto%26 location : locations) %7B const auto dict_path %3D location / %22dict.bin%22; if (std::filesystem::exists(dict_path) %26%26 std::filesystem::is_regular_file(dict_path)) %7B return dict_path; %7D %7D throw std::runtime_error(%22Couldn%27t find the word list.%22); %7D inline void print_debug_info(const std::vector%3Cstd::string%3E%26 substrings, const std::string%26 raw_output) %7B std::cout %3C%3C %22Stored raw output:%22 %3C%3C std::endl; for (const auto%26 str : substrings) %7B std::cout %3C%3C str %3C%3C std::endl; %7D std::cout %3C%3C %22Raw output:%22 %3C%3C std::endl; std::cout %3C%3C raw_output %3C%3C std::endl; %7D void log_execution(const int argc, char* argv[], const std::string%26 search_string, const std::string%26 dict_file, bool debug_mode, bool goldendict_mode) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C %22Hakurei executed at %22 %3C%3C std::ctime(%26now); log_file %3C%3C %22Command-line arguments:%5Cn%22; for (int i %3D 0; i %3C argc; ++i) %7B log_file %3C%3C %22argv[%22 %3C%3C i %3C%3C %22]: %22 %3C%3C argv[i] %3C%3C %22%5Cn%22; %7D log_file %3C%3C %22Parsed parameters:%5Cn%22; log_file %3C%3C %22search_string: %22 %3C%3C search_string %3C%3C %22%5Cn%22; log_file %3C%3C %22dict_file: %22 %3C%3C dict_file %3C%3C %22%5Cn%22; log_file %3C%3C %22debug_mode: %22 %3C%3C debug_mode %3C%3C %22%5Cn%22; log_file %3C%3C %22goldendict_mode: %22 %3C%3C goldendict_mode %3C%3C %22%5Cn%22; log_file.close(); %7D void log_internal(const std::string%26 message) %7B std::ofstream log_file; log_file.open(%22/tmp/hakurei.log%22, std::ios_base::app); if (!log_file) %7B std::cerr %3C%3C %22Failed to open log file.%22 %3C%3C std::endl; return; %7D std::time_t now %3D std::time(nullptr); log_file %3C%3C std::ctime(%26now) %3C%3C %22: %22 %3C%3C message %3C%3C std::endl; log_file.close(); %7D inline void wrap_html_output( const std::vector%3Cstd::string%3E%26 substrings, const std::map%3Cstd::string, std::set%3Cstd::string%3E%3E%26 alternatives_map, std::string%26 sentence ) %7B // Log the HTML output call log_internal(%22%3Cspan style%3D%5C%22color:red;%5C%22%3EHTML output is being called%3C/span%3E%22); std::string output_html; output_html +%3D %22%3Cdiv class%3D%5C%22hakurei%5C%22%3E%22; std::string sentence_copy %3D sentence; output_html +%3D %22%3Cdiv class%3D%5C%22container%5C%22%3E%22; while (!sentence_copy.empty()) %7B bool found %3D false; for (const auto%26 substring : substrings) %7B if (sentence_copy.rfind(substring, 0) %3D%3D 0) %7B output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%3Ca class%3D%5C%22hakurei-headword%5C%22 href%3D%5C%22bword:%22 + substring + %22%5C%22%3E%22 + substring + %22%3C/a%3E%22; auto alt_itr %3D alternatives_map.find(sentence_copy); if (alt_itr !%3D alternatives_map.end() %26%26 !alt_itr-%3Esecond.empty()) %7B output_html +%3D %22%3Cdiv class%3D%5C%22alternatives%5C%22%3E%3Cul%3E%22; for (const auto%26 alt : alt_itr-%3Esecond) %7B output_html +%3D %22%3Cli%3E%3Ca href%3D%5C%22bword:%22 + alt + %22%5C%22%3E%22 + alt + %22%3C/a%3E%3C/li%3E%22; %7D output_html +%3D %22%3C/ul%3E%3C/div%3E%22; %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3Cstyle%3E%22; output_html +%3D %22.hakurei %7B font-size: 2rem; margin-bottom: 0.05em; margin-top: -0.2em; color: %231268c3; font-weight: normal; %7D%22; output_html +%3D %22.hakurei a %7B display: inline-block; font-weight: normal; color: royalblue; text-decoration: none; border-bottom: dashed max(1px, calc(1em / 16)) currentColor; %7D%22; output_html +%3D %22.hakurei a.hakurei-headword %7B background-color: %23ddeeff; border-radius: 0.2rem; font-weight: 500; %7D%22; output_html +%3D %22.hakurei %3E ul %7B --size: 1rem; font-size: var(--size); padding-inline-start: var(--size); margin-block: 2px; %7D%22; output_html +%3D %22.hakurei .alternatives %7B --size: 1rem; display: grid; font-size: var(--size); gap: calc( var(--size) / 4); max-width: 100%25; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; justify-content: space-around; text-align: left; padding: 5px 0px; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %7B list-style-type: none; margin: 0; padding: calc( var(--size) / 4); background-color: hsl(0 0%25 50%25 / 0.05); box-shadow: 0 0 4px hsl(0 0%25 0%25 / 0.1); border-radius: 0.2rem; %7D%22; output_html +%3D %22.hakurei .alternatives %3E ul %3E li %7B margin-right: 1rem; %7D%22; output_html +%3D %22.container %7B display: flex; flex-wrap: wrap; gap: 10px; %7D%22; output_html +%3D %22.segment %7B display: inline-block; %7D%22; output_html +%3D %22%3C/style%3E%22; sentence_copy %3D sentence_copy.substr(substring.size()); found %3D true; break; %7D %7D if (!found) %7B const auto [removed_char, new_sentence_copy] %3D remove_one_utf8_char(sentence_copy); if (removed_char.empty()) %7B std::cerr %3C%3C %22Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.%22 %3C%3C std::endl; break; %7D output_html +%3D %22%3Cdiv class%3D%5C%22segment%5C%22%3E%22 + removed_char + %22%3C/div%3E%22; sentence_copy %3D new_sentence_copy; %7D %7D output_html +%3D %22%3C/div%3E%22; output_html +%3D %22%3C/div%3E%22; std::cout %3C%3C output_html %3C%3C std::endl; %7D int main(const int argc, char* argv[]) %7B std::string dict_file %3D find_dic_file().string(); // Default dictionary file path const auto trie %3D xcdat::load%3Cxcdat::trie_15_type%3E(dict_file); log_internal(%22Trie loaded from dictionary file%22); bool debug_mode %3D false; bool goldendict_mode %3D false; std::string word, sentence; log_internal(%22Program started%22); // Parse command line arguments for (int i %3D 1; i %3C argc; ++i) %7B if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B debug_mode %3D true; log_internal(%22Debug mode enabled%22); %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B dict_file %3D argv[i + 1]; log_internal(%22Dictionary file set to: %22 + dict_file); i++; // Skip the next argument as it%27s the dictionary file path %7D else if (std::strcmp(argv[i], %22--goldendict%22) %3D%3D 0) %7B goldendict_mode %3D true; log_internal(%22GoldenDict mode enabled%22); %7D else if (std::strcmp(argv[i], %22--word%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B word %3D argv[i + 1]; log_internal(%22Word set to: %22 + word); i++; %7D else if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B sentence %3D argv[i + 1]; log_internal(%22Sentence set to: %22 + sentence); i++; %7D %7D std::string search_string %3D get_input(argc, argv, goldendict_mode); log_internal(%22Search string: %22 + search_string); if (goldendict_mode %26%26 !sentence.empty()) %7B search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string); %7D // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector%3Cstd::string%3E substrings; std::vector%3CEntry%3E results; std::map%3Cstd::string, std::vector%3Cstd::string%3E%3E derived_map; std::map%3Cstd::string, std::set%3Cstd::string%3E%3E alternatives_map; while (!search_string.empty()) %7B auto itr %3D trie.make_prefix_iterator(search_string); while (itr.next()) %7B results.emplace_back(itr.decoded_view(), itr.id()); log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %7D // Add all substrings to the results if (!results.empty()) %7B for (const auto%26 entry : results) %7B const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(%22Substring added: %22 + substring); if (!goldendict_mode) %7B std::cout %3C%3C substring %3C%3C std::endl; %7D %7D %7D // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); log_internal(%22Removed character: %22 + removed_char); if (!removed_char.empty() %26%26 !goldendict_mode) %7B std::cout %3C%3C removed_char %3C%3C std::endl; %7D if (new_search_string %3D%3D search_string) %7B std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); break; %7D search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; raw_output +%3D search_string + %27%5Cn%27; %7D results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D // Print debug information if in debug mode if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence); exit(0); %7D log_internal(%22Program finished%22); return 0; %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:46:49 scheme: "gdlookup" +Debug: 05-18 23:46:49 host: "localhost" +Debug: 05-18 23:46:49 clear current dictionaries: "// filename: hakurei.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct Entry { const std::string_view decoded_view; const uint64_t id; inline Entry(const std::string_view decoded_view, const uint64_t id) : decoded_view(decoded_view), id(id) {} }; inline std::pair remove_one_utf8_char(const std::string& str) { if (str.empty()) { return {\"\", str}; } const size_t len = str.size(); size_t i = 0; while (i < len) { const unsigned char c = str[i]; if (c < 0x80) { return {str.substr(i, 1), str.substr(i + 1)}; } else if ((c >> 5) == 0x6) { return {str.substr(i, 2), str.substr(i + 2)}; } else if ((c >> 4) == 0xe) { return {str.substr(i, 3), str.substr(i + 3)}; } else if ((c >> 3) == 0x1e) { return {str.substr(i, 4), str.substr(i + 4)}; } i++; } return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { std::string search_string; if (!isatty(fileno(stdin))) { std::getline(std::cin, search_string); } else { if (goldendict_mode) { for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { search_string = argv[i + 1]; break; } } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { // Handle debug mode } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { i++; } else { search_string = argv[i]; break; } } } } if (search_string.empty()) { std::cerr << \"Search string not provided.\" << std::endl; exit(1); } return search_string; } inline std::filesystem::path find_dic_file() { static const std::vector locations = { std::filesystem::path(\"/usr/share/hakurei/\"), std::filesystem::path(std::getenv(\"HOME\")) / \".local/share/hakurei/\", std::filesystem::current_path() }; for (const auto& location : locations) { const auto dict_path = location / \"dict.bin\"; if (std::filesystem::exists(dict_path) && std::filesystem::is_regular_file(dict_path)) { return dict_path; } } throw std::runtime_error(\"Couldn't find the word list.\"); } inline void print_debug_info(const std::vector& substrings, const std::string& raw_output) { std::cout << \"Stored raw output:\" << std::endl; for (const auto& str : substrings) { std::cout << str << std::endl; } std::cout << \"Raw output:\" << std::endl; std::cout << raw_output << std::endl; } void log_execution(const int argc, char* argv[], const std::string& search_string, const std::string& dict_file, bool debug_mode, bool goldendict_mode) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << \"Hakurei executed at \" << std::ctime(&now); log_file << \"Command-line arguments:\\n\"; for (int i = 0; i < argc; ++i) { log_file << \"argv[\" << i << \"]: \" << argv[i] << \"\\n\"; } log_file << \"Parsed parameters:\\n\"; log_file << \"search_string: \" << search_string << \"\\n\"; log_file << \"dict_file: \" << dict_file << \"\\n\"; log_file << \"debug_mode: \" << debug_mode << \"\\n\"; log_file << \"goldendict_mode: \" << goldendict_mode << \"\\n\"; log_file.close(); } void log_internal(const std::string& message) { std::ofstream log_file; log_file.open(\"/tmp/hakurei.log\", std::ios_base::app); if (!log_file) { std::cerr << \"Failed to open log file.\" << std::endl; return; } std::time_t now = std::time(nullptr); log_file << std::ctime(&now) << \": \" << message << std::endl; log_file.close(); } inline void wrap_html_output( const std::vector& substrings, const std::map>& alternatives_map, std::string& sentence ) { // Log the HTML output call log_internal(\"HTML output is being called\"); std::string output_html; output_html += \"
                \"; std::string sentence_copy = sentence; output_html += \"
                \"; while (!sentence_copy.empty()) { bool found = false; for (const auto& substring : substrings) { if (sentence_copy.rfind(substring, 0) == 0) { output_html += \"
                \" + substring + \"\"; auto alt_itr = alternatives_map.find(sentence_copy); if (alt_itr != alternatives_map.end() && !alt_itr->second.empty()) { output_html += \"
                  \"; for (const auto& alt : alt_itr->second) { output_html += \"
                • \" + alt + \"
                • \"; } output_html += \"
                \"; } output_html += \"
                \"; output_html += \"\"; sentence_copy = sentence_copy.substr(substring.size()); found = true; break; } } if (!found) { const auto [removed_char, new_sentence_copy] = remove_one_utf8_char(sentence_copy); if (removed_char.empty()) { std::cerr << \"Error: Unable to remove a character from the sentence. Exiting to prevent infinite loop.\" << std::endl; break; } output_html += \"
                \" + removed_char + \"
                \"; sentence_copy = new_sentence_copy; } } output_html += \"
                \"; output_html += \"
                \"; std::cout << output_html << std::endl; } int main(const int argc, char* argv[]) { std::string dict_file = find_dic_file().string(); // Default dictionary file path const auto trie = xcdat::load(dict_file); log_internal(\"Trie loaded from dictionary file\"); bool debug_mode = false; bool goldendict_mode = false; std::string word, sentence; log_internal(\"Program started\"); // Parse command line arguments for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], \"--debug\") == 0) { debug_mode = true; log_internal(\"Debug mode enabled\"); } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { dict_file = argv[i + 1]; log_internal(\"Dictionary file set to: \" + dict_file); i++; // Skip the next argument as it's the dictionary file path } else if (std::strcmp(argv[i], \"--goldendict\") == 0) { goldendict_mode = true; log_internal(\"GoldenDict mode enabled\"); } else if (std::strcmp(argv[i], \"--word\") == 0 && i + 1 < argc) { word = argv[i + 1]; log_internal(\"Word set to: \" + word); i++; } else if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { sentence = argv[i + 1]; log_internal(\"Sentence set to: \" + sentence); i++; } } std::string search_string = get_input(argc, argv, goldendict_mode); log_internal(\"Search string: \" + search_string); if (goldendict_mode && !sentence.empty()) { search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string); } // Log the execution details log_execution(argc, argv, search_string, dict_file, debug_mode, goldendict_mode); std::string raw_output; std::vector substrings; std::vector results; std::map> derived_map; std::map> alternatives_map; while (!search_string.empty()) { auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { results.emplace_back(itr.decoded_view(), itr.id()); log_internal(\"Found result: \" + std::string(itr.decoded_view())); } // Add all substrings to the results if (!results.empty()) { for (const auto& entry : results) { const std::string substring(entry.decoded_view); substrings.push_back(substring); derived_map[substring].push_back(search_string); alternatives_map[search_string].insert(substring); log_internal(\"Substring added: \" + substring); if (!goldendict_mode) { std::cout << substring << std::endl; } } } // Remove one UTF-8 character from the search string and get the removed character const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); log_internal(\"Removed character: \" + removed_char); if (!removed_char.empty() && !goldendict_mode) { std::cout << removed_char << std::endl; } if (new_search_string == search_string) { std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); break; } search_string = new_search_string; log_internal(\"New search string: \" + search_string); // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; raw_output += search_string + '\\n'; } results.clear(); // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } // Print debug information if in debug mode if (debug_mode) { print_debug_info(substrings, raw_output); } // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence); exit(0); } log_internal(\"Program finished\"); return 0; }" +Debug: 05-18 23:46:49 some body finished +Debug: 05-18 23:46:49 one not finished. +Debug: 05-18 23:46:49 ====reading 13519 of (13519) bytes . Finished: 0 +Debug: 05-18 23:46:49 ====reading 0 of (13519) bytes . Finished: 0 +Debug: 05-18 23:46:49 ====reading 0 of (13519) bytes . Finished: 0 +Warning: 05-18 23:46:49 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:48:29 translating from clipboard or selection +Debug: 05-18 23:48:29 clipboard data: "88c88\n< }\n---\n> return {\"\", \"\"};\n94,96c94,95\n< if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n< search_string = argv[i + 1];\n< break;\n---\n> if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n> search_string = argv[i + 1];\n100,101c99\n< if (argc < 2) {\n< std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n---\n> if (argc < 2) {\n103,108c101,104\n< exit(1);\n< }\n< for (int i = 1; i < argc; ++i) {\n< if (std::strcmp(argv[i], \"--debug\") == 0) {\n< // Handle debug mode\n< } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n---\n> exit(1);\n> }\n> for (int i = 1; i < argc; ++i) {\n> if (std::strcmp(argv[i], \"--debug\") == 0) {\n110c106\n< } else {\n---\n> } else {\n113,114c109,110\n< break;\n< }\n---\n> break;\n> }\n116,117c112\n< std::cerr << \"Search string not provided.\" << std::endl;\n< exit(1);\n---\n> std::cerr << \"Search string not provided.\" << std::endl;\n119c114\n< return search_string;\n---\n> return search_string;\n247c242\n< std::vector substrings;\n---\n> std::vector substrings;\n251c246\n< while (!search_string.empty()) {\n---\n> while (!search_string.empty()) {\n253,254c248,249\n< while (itr.next()) {\n< results.emplace_back(itr.decoded_view(), itr.id());\n---\n> while (itr.next()) {\n> results.emplace_back(itr.decoded_view(), itr.id());\n256,257c251\n< log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n< }\n---\n> log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n260,261c254,255\n< for (const auto& entry : results) {\n< const std::string substring(entry.decoded_view);\n---\n> for (const auto& entry : results) {\n> const std::string substring(entry.decoded_view);\n263,269c257,263\n< derived_map[substring].push_back(search_string);\n< alternatives_map[search_string].insert(substring);\n< log_internal(\"Substring added: \" + substring);\n< if (!goldendict_mode) {\n< std::cout << substring << std::endl;\n< }\n< }\n---\n> derived_map[substring].push_back(search_string);\n> alternatives_map[search_string].insert(substring);\n> log_internal(\"Substring added: \" + substring);\n> if (!goldendict_mode) {\n> std::cout << substring << std::endl;\n> }\n> }\n273,274c267,268\n< const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n< log_internal(\"Removed character: \" + removed_char);\n---\n> const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n> log_internal(\"Removed character: \" + removed_char);\n276,277c270,271\n< std::cout << removed_char << std::endl;\n< }\n---\n> std::cout << removed_char << std::endl;\n> }\n279,282c273,276\n< std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n< log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n< break;\n< }\n---\n> std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n> log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n> break;\n> }\n284c278\n< log_internal(\"New search string: \" + search_string);\n---\n> log_internal(\"New search string: \" + search_string);\n286,287c280,281\n< std::cout << \"After removing one character: \" << search_string << std::endl;\n< raw_output += search_string + '\\n';\n---\n> std::cout << \"After removing one character: \" << search_string << std::endl;\n> raw_output += search_string + '\\n';\n289c283\n< results.clear();\n---\n> results.clear();\n291c285\n< search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n---\n> search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n293,295c287,288\n< if (debug_mode) {\n< print_debug_info(substrings, raw_output);\n< }\n---\n> if (debug_mode) {\n> print_debug_info(substrings, raw_output);\n297,299c290,291\n< wrap_html_output(substrings, alternatives_map, sentence);\n< exit(0);\n< }\n---\n> wrap_html_output(substrings, alternatives_map, sentence);\n> exit(0);\n301c293\n< return 0;\n---\n> return 0;\n" +Debug: 05-18 23:48:29 Current state: true false true true +Debug: 05-18 23:48:29 getResource: "gdlookup://localhost/?word=88c88 %3C %7D --- %3E return %7B%22%22, %22%22%7D; 94,96c94,95 %3C if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3C search_string %3D argv[i + 1]; %3C break; --- %3E if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3E search_string %3D argv[i + 1]; 100,101c99 %3C if (argc %3C 2) %7B %3C std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; --- %3E if (argc %3C 2) %7B 103,108c101,104 %3C exit(1); %3C %7D %3C for (int i %3D 1; i %3C argc; ++i) %7B %3C if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B %3C // Handle debug mode %3C %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B --- %3E exit(1); %3E %7D %3E for (int i %3D 1; i %3C argc; ++i) %7B %3E if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B 110c106 %3C %7D else %7B --- %3E %7D else %7B 113,114c109,110 %3C break; %3C %7D --- %3E break; %3E %7D 116,117c112 %3C std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; %3C exit(1); --- %3E std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; 119c114 %3C return search_string; --- %3E return search_string; 247c242 %3C std::vector%3Cstd::string%3E substrings; --- %3E std::vector%3Cstd::string%3E substrings; 251c246 %3C while (!search_string.empty()) %7B --- %3E while (!search_string.empty()) %7B 253,254c248,249 %3C while (itr.next()) %7B %3C results.emplace_back(itr.decoded_view(), itr.id()); --- %3E while (itr.next()) %7B %3E results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 %3C log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %3C %7D --- %3E log_internal(%22Found result: %22 + std::string(itr.decoded_view())); 260,261c254,255 %3C for (const auto%26 entry : results) %7B %3C const std::string substring(entry.decoded_view); --- %3E for (const auto%26 entry : results) %7B %3E const std::string substring(entry.decoded_view); 263,269c257,263 %3C derived_map[substring].push_back(search_string); %3C alternatives_map[search_string].insert(substring); %3C log_internal(%22Substring added: %22 + substring); %3C if (!goldendict_mode) %7B %3C std::cout %3C%3C substring %3C%3C std::endl; %3C %7D %3C %7D --- %3E derived_map[substring].push_back(search_string); %3E alternatives_map[search_string].insert(substring); %3E log_internal(%22Substring added: %22 + substring); %3E if (!goldendict_mode) %7B %3E std::cout %3C%3C substring %3C%3C std::endl; %3E %7D %3E %7D 273,274c267,268 %3C const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3C log_internal(%22Removed character: %22 + removed_char); --- %3E const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3E log_internal(%22Removed character: %22 + removed_char); 276,277c270,271 %3C std::cout %3C%3C removed_char %3C%3C std::endl; %3C %7D --- %3E std::cout %3C%3C removed_char %3C%3C std::endl; %3E %7D 279,282c273,276 %3C std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3C log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3C break; %3C %7D --- %3E std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3E log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3E break; %3E %7D 284c278 %3C log_internal(%22New search string: %22 + search_string); --- %3E log_internal(%22New search string: %22 + search_string); 286,287c280,281 %3C std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3C raw_output +%3D search_string + %27%5Cn%27; --- %3E std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3E raw_output +%3D search_string + %27%5Cn%27; 289c283 %3C results.clear(); --- %3E results.clear(); 291c285 %3C search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); --- %3E search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); 293,295c287,288 %3C if (debug_mode) %7B %3C print_debug_info(substrings, raw_output); %3C %7D --- %3E if (debug_mode) %7B %3E print_debug_info(substrings, raw_output); 297,299c290,291 %3C wrap_html_output(substrings, alternatives_map, sentence); %3C exit(0); %3C %7D --- %3E wrap_html_output(substrings, alternatives_map, sentence); %3E exit(0); 301c293 %3C return 0; --- %3E return 0;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:48:29 scheme: "gdlookup" +Debug: 05-18 23:48:29 host: "localhost" +Debug: 05-18 23:48:29 clear current dictionaries: "88c88 < } --- > return {\"\", \"\"}; 94,96c94,95 < if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { < search_string = argv[i + 1]; < break; --- > if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { > search_string = argv[i + 1]; 100,101c99 < if (argc < 2) { < std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; --- > if (argc < 2) { 103,108c101,104 < exit(1); < } < for (int i = 1; i < argc; ++i) { < if (std::strcmp(argv[i], \"--debug\") == 0) { < // Handle debug mode < } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { --- > exit(1); > } > for (int i = 1; i < argc; ++i) { > if (std::strcmp(argv[i], \"--debug\") == 0) { 110c106 < } else { --- > } else { 113,114c109,110 < break; < } --- > break; > } 116,117c112 < std::cerr << \"Search string not provided.\" << std::endl; < exit(1); --- > std::cerr << \"Search string not provided.\" << std::endl; 119c114 < return search_string; --- > return search_string; 247c242 < std::vector substrings; --- > std::vector substrings; 251c246 < while (!search_string.empty()) { --- > while (!search_string.empty()) { 253,254c248,249 < while (itr.next()) { < results.emplace_back(itr.decoded_view(), itr.id()); --- > while (itr.next()) { > results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 < log_internal(\"Found result: \" + std::string(itr.decoded_view())); < } --- > log_internal(\"Found result: \" + std::string(itr.decoded_view())); 260,261c254,255 < for (const auto& entry : results) { < const std::string substring(entry.decoded_view); --- > for (const auto& entry : results) { > const std::string substring(entry.decoded_view); 263,269c257,263 < derived_map[substring].push_back(search_string); < alternatives_map[search_string].insert(substring); < log_internal(\"Substring added: \" + substring); < if (!goldendict_mode) { < std::cout << substring << std::endl; < } < } --- > derived_map[substring].push_back(search_string); > alternatives_map[search_string].insert(substring); > log_internal(\"Substring added: \" + substring); > if (!goldendict_mode) { > std::cout << substring << std::endl; > } > } 273,274c267,268 < const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); < log_internal(\"Removed character: \" + removed_char); --- > const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); > log_internal(\"Removed character: \" + removed_char); 276,277c270,271 < std::cout << removed_char << std::endl; < } --- > std::cout << removed_char << std::endl; > } 279,282c273,276 < std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; < log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); < break; < } --- > std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; > log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); > break; > } 284c278 < log_internal(\"New search string: \" + search_string); --- > log_internal(\"New search string: \" + search_string); 286,287c280,281 < std::cout << \"After removing one character: \" << search_string << std::endl; < raw_output += search_string + '\\n'; --- > std::cout << \"After removing one character: \" << search_string << std::endl; > raw_output += search_string + '\\n'; 289c283 < results.clear(); --- > results.clear(); 291c285 < search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); --- > search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); 293,295c287,288 < if (debug_mode) { < print_debug_info(substrings, raw_output); < } --- > if (debug_mode) { > print_debug_info(substrings, raw_output); 297,299c290,291 < wrap_html_output(substrings, alternatives_map, sentence); < exit(0); < } --- > wrap_html_output(substrings, alternatives_map, sentence); > exit(0); 301c293 < return 0; --- > return 0;" +Debug: 05-18 23:48:29 some body finished +Debug: 05-18 23:48:29 one not finished. +Debug: 05-18 23:48:29 ====reading 6216 of (6216) bytes . Finished: 0 +Debug: 05-18 23:48:29 ====reading 0 of (6216) bytes . Finished: 0 +Debug: 05-18 23:48:29 ====reading 0 of (6216) bytes . Finished: 0 +Warning: 05-18 23:48:29 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:48:33 translating from clipboard or selection +Debug: 05-18 23:48:33 clipboard data: "\n---\n> if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n> search_string = argv[i + 1];\n100,101c99\n< if (argc < 2) {\n< std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n---\n> if (argc < 2) {\n103,108c101,104\n< exit(1);\n< }\n< for (int i = 1; i < argc; ++i) {\n< if (std::strcmp(argv[i], \"--debug\") == 0) {\n< // Handle debug mode\n< } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n---\n> exit(1);\n> }\n> for (int i = 1; i < argc; ++i) {\n> if (std::strcmp(argv[i], \"--debug\") == 0) {\n110c106\n< } else {\n---\n> } else {\n113,114c109,110" +Debug: 05-18 23:48:33 Current state: true false true true +Debug: 05-18 23:48:33 getResource: "gdlookup://localhost/?word=--- %3E if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3E search_string %3D argv[i + 1]; 100,101c99 %3C if (argc %3C 2) %7B %3C std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; --- %3E if (argc %3C 2) %7B 103,108c101,104 %3C exit(1); %3C %7D %3C for (int i %3D 1; i %3C argc; ++i) %7B %3C if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B %3C // Handle debug mode %3C %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B --- %3E exit(1); %3E %7D %3E for (int i %3D 1; i %3C argc; ++i) %7B %3E if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B 110c106 %3C %7D else %7B --- %3E %7D else %7B 113,114c109,110&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:48:33 scheme: "gdlookup" +Debug: 05-18 23:48:33 host: "localhost" +Debug: 05-18 23:48:33 clear current dictionaries: "--- > if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { > search_string = argv[i + 1]; 100,101c99 < if (argc < 2) { < std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; --- > if (argc < 2) { 103,108c101,104 < exit(1); < } < for (int i = 1; i < argc; ++i) { < if (std::strcmp(argv[i], \"--debug\") == 0) { < // Handle debug mode < } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { --- > exit(1); > } > for (int i = 1; i < argc; ++i) { > if (std::strcmp(argv[i], \"--debug\") == 0) { 110c106 < } else { --- > } else { 113,114c109,110" +Debug: 05-18 23:48:33 some body finished +Debug: 05-18 23:48:33 one not finished. +Debug: 05-18 23:48:33 ====reading 2153 of (2153) bytes . Finished: 0 +Debug: 05-18 23:48:33 ====reading 0 of (2153) bytes . Finished: 0 +Debug: 05-18 23:48:33 ====reading 0 of (2153) bytes . Finished: 0 +Warning: 05-18 23:48:33 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:48:57 translating from clipboard or selection +Debug: 05-18 23:48:57 clipboard data: "88c88\n< }\n---\n> return {\"\", \"\"};\n94,96c94,95\n< if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n< search_string = argv[i + 1];\n< break;\n---\n> if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n> search_string = argv[i + 1];\n100,101c99\n< if (argc < 2) {\n< std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n---\n> if (argc < 2) {\n103,108c101,104\n< exit(1);\n< }\n< for (int i = 1; i < argc; ++i) {\n< if (std::strcmp(argv[i], \"--debug\") == 0) {\n< // Handle debug mode\n< } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n---\n> exit(1);\n> }\n> for (int i = 1; i < argc; ++i) {\n> if (std::strcmp(argv[i], \"--debug\") == 0) {\n110c106\n< } else {\n---\n> } else {\n113,114c109,110\n< break;\n< }\n---\n> break;\n> }\n116,117c112\n< std::cerr << \"Search string not provided.\" << std::endl;\n< exit(1);\n---\n> std::cerr << \"Search string not provided.\" << std::endl;\n119c114\n< return search_string;\n---\n> return search_string;\n247c242\n< std::vector substrings;\n---\n> std::vector substrings;\n251c246\n< while (!search_string.empty()) {\n---\n> while (!search_string.empty()) {\n253,254c248,249\n< while (itr.next()) {\n< results.emplace_back(itr.decoded_view(), itr.id());\n---\n> while (itr.next()) {\n> results.emplace_back(itr.decoded_view(), itr.id());\n256,257c251\n< log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n< }\n---\n> log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n260,261c254,255\n< for (const auto& entry : results) {\n< const std::string substring(entry.decoded_view);\n---\n> for (const auto& entry : results) {\n> const std::string substring(entry.decoded_view);\n263,269c257,263\n< derived_map[substring].push_back(search_string);\n< alternatives_map[search_string].insert(substring);\n< log_internal(\"Substring added: \" + substring);\n< if (!goldendict_mode) {\n< std::cout << substring << std::endl;\n< }\n< }\n---\n> derived_map[substring].push_back(search_string);\n> alternatives_map[search_string].insert(substring);\n> log_internal(\"Substring added: \" + substring);\n> if (!goldendict_mode) {\n> std::cout << substring << std::endl;\n> }\n> }\n273,274c267,268\n< const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n< log_internal(\"Removed character: \" + removed_char);\n---\n> const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n> log_internal(\"Removed character: \" + removed_char);\n276,277c270,271\n< std::cout << removed_char << std::endl;\n< }\n---\n> std::cout << removed_char << std::endl;\n> }\n279,282c273,276\n< std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n< log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n< break;\n< }\n---\n> std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n> log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n> break;\n> }\n284c278\n< log_internal(\"New search string: \" + search_string);\n---\n> log_internal(\"New search string: \" + search_string);\n286,287c280,281\n< std::cout << \"After removing one character: \" << search_string << std::endl;\n< raw_output += search_string + '\\n';\n---\n> std::cout << \"After removing one character: \" << search_string << std::endl;\n> raw_output += search_string + '\\n';\n289c283\n< results.clear();\n---\n> results.clear();\n291c285\n< search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n---\n> search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n293,295c287,288\n< if (debug_mode) {\n< print_debug_info(substrings, raw_output);\n< }\n---\n> if (debug_mode) {\n> print_debug_info(substrings, raw_output);\n297,299c290,291\n< wrap_html_output(substrings, alternatives_map, sentence);\n< exit(0);\n< }\n---\n> wrap_html_output(substrings, alternatives_map, sentence);\n> exit(0);\n301c293\n< return 0;\n---\n> return 0;\n" +Debug: 05-18 23:48:57 Current state: true false true true +Debug: 05-18 23:48:57 getResource: "gdlookup://localhost/?word=88c88 %3C %7D --- %3E return %7B%22%22, %22%22%7D; 94,96c94,95 %3C if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3C search_string %3D argv[i + 1]; %3C break; --- %3E if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3E search_string %3D argv[i + 1]; 100,101c99 %3C if (argc %3C 2) %7B %3C std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; --- %3E if (argc %3C 2) %7B 103,108c101,104 %3C exit(1); %3C %7D %3C for (int i %3D 1; i %3C argc; ++i) %7B %3C if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B %3C // Handle debug mode %3C %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B --- %3E exit(1); %3E %7D %3E for (int i %3D 1; i %3C argc; ++i) %7B %3E if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B 110c106 %3C %7D else %7B --- %3E %7D else %7B 113,114c109,110 %3C break; %3C %7D --- %3E break; %3E %7D 116,117c112 %3C std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; %3C exit(1); --- %3E std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; 119c114 %3C return search_string; --- %3E return search_string; 247c242 %3C std::vector%3Cstd::string%3E substrings; --- %3E std::vector%3Cstd::string%3E substrings; 251c246 %3C while (!search_string.empty()) %7B --- %3E while (!search_string.empty()) %7B 253,254c248,249 %3C while (itr.next()) %7B %3C results.emplace_back(itr.decoded_view(), itr.id()); --- %3E while (itr.next()) %7B %3E results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 %3C log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %3C %7D --- %3E log_internal(%22Found result: %22 + std::string(itr.decoded_view())); 260,261c254,255 %3C for (const auto%26 entry : results) %7B %3C const std::string substring(entry.decoded_view); --- %3E for (const auto%26 entry : results) %7B %3E const std::string substring(entry.decoded_view); 263,269c257,263 %3C derived_map[substring].push_back(search_string); %3C alternatives_map[search_string].insert(substring); %3C log_internal(%22Substring added: %22 + substring); %3C if (!goldendict_mode) %7B %3C std::cout %3C%3C substring %3C%3C std::endl; %3C %7D %3C %7D --- %3E derived_map[substring].push_back(search_string); %3E alternatives_map[search_string].insert(substring); %3E log_internal(%22Substring added: %22 + substring); %3E if (!goldendict_mode) %7B %3E std::cout %3C%3C substring %3C%3C std::endl; %3E %7D %3E %7D 273,274c267,268 %3C const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3C log_internal(%22Removed character: %22 + removed_char); --- %3E const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3E log_internal(%22Removed character: %22 + removed_char); 276,277c270,271 %3C std::cout %3C%3C removed_char %3C%3C std::endl; %3C %7D --- %3E std::cout %3C%3C removed_char %3C%3C std::endl; %3E %7D 279,282c273,276 %3C std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3C log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3C break; %3C %7D --- %3E std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3E log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3E break; %3E %7D 284c278 %3C log_internal(%22New search string: %22 + search_string); --- %3E log_internal(%22New search string: %22 + search_string); 286,287c280,281 %3C std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3C raw_output +%3D search_string + %27%5Cn%27; --- %3E std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3E raw_output +%3D search_string + %27%5Cn%27; 289c283 %3C results.clear(); --- %3E results.clear(); 291c285 %3C search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); --- %3E search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); 293,295c287,288 %3C if (debug_mode) %7B %3C print_debug_info(substrings, raw_output); %3C %7D --- %3E if (debug_mode) %7B %3E print_debug_info(substrings, raw_output); 297,299c290,291 %3C wrap_html_output(substrings, alternatives_map, sentence); %3C exit(0); %3C %7D --- %3E wrap_html_output(substrings, alternatives_map, sentence); %3E exit(0); 301c293 %3C return 0; --- %3E return 0;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:48:57 scheme: "gdlookup" +Debug: 05-18 23:48:57 host: "localhost" +Debug: 05-18 23:48:57 clear current dictionaries: "88c88 < } --- > return {\"\", \"\"}; 94,96c94,95 < if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { < search_string = argv[i + 1]; < break; --- > if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { > search_string = argv[i + 1]; 100,101c99 < if (argc < 2) { < std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; --- > if (argc < 2) { 103,108c101,104 < exit(1); < } < for (int i = 1; i < argc; ++i) { < if (std::strcmp(argv[i], \"--debug\") == 0) { < // Handle debug mode < } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { --- > exit(1); > } > for (int i = 1; i < argc; ++i) { > if (std::strcmp(argv[i], \"--debug\") == 0) { 110c106 < } else { --- > } else { 113,114c109,110 < break; < } --- > break; > } 116,117c112 < std::cerr << \"Search string not provided.\" << std::endl; < exit(1); --- > std::cerr << \"Search string not provided.\" << std::endl; 119c114 < return search_string; --- > return search_string; 247c242 < std::vector substrings; --- > std::vector substrings; 251c246 < while (!search_string.empty()) { --- > while (!search_string.empty()) { 253,254c248,249 < while (itr.next()) { < results.emplace_back(itr.decoded_view(), itr.id()); --- > while (itr.next()) { > results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 < log_internal(\"Found result: \" + std::string(itr.decoded_view())); < } --- > log_internal(\"Found result: \" + std::string(itr.decoded_view())); 260,261c254,255 < for (const auto& entry : results) { < const std::string substring(entry.decoded_view); --- > for (const auto& entry : results) { > const std::string substring(entry.decoded_view); 263,269c257,263 < derived_map[substring].push_back(search_string); < alternatives_map[search_string].insert(substring); < log_internal(\"Substring added: \" + substring); < if (!goldendict_mode) { < std::cout << substring << std::endl; < } < } --- > derived_map[substring].push_back(search_string); > alternatives_map[search_string].insert(substring); > log_internal(\"Substring added: \" + substring); > if (!goldendict_mode) { > std::cout << substring << std::endl; > } > } 273,274c267,268 < const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); < log_internal(\"Removed character: \" + removed_char); --- > const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); > log_internal(\"Removed character: \" + removed_char); 276,277c270,271 < std::cout << removed_char << std::endl; < } --- > std::cout << removed_char << std::endl; > } 279,282c273,276 < std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; < log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); < break; < } --- > std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; > log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); > break; > } 284c278 < log_internal(\"New search string: \" + search_string); --- > log_internal(\"New search string: \" + search_string); 286,287c280,281 < std::cout << \"After removing one character: \" << search_string << std::endl; < raw_output += search_string + '\\n'; --- > std::cout << \"After removing one character: \" << search_string << std::endl; > raw_output += search_string + '\\n'; 289c283 < results.clear(); --- > results.clear(); 291c285 < search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); --- > search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); 293,295c287,288 < if (debug_mode) { < print_debug_info(substrings, raw_output); < } --- > if (debug_mode) { > print_debug_info(substrings, raw_output); 297,299c290,291 < wrap_html_output(substrings, alternatives_map, sentence); < exit(0); < } --- > wrap_html_output(substrings, alternatives_map, sentence); > exit(0); 301c293 < return 0; --- > return 0;" +Debug: 05-18 23:48:57 some body finished +Debug: 05-18 23:48:57 one not finished. +Debug: 05-18 23:48:57 ====reading 6216 of (6216) bytes . Finished: 0 +Debug: 05-18 23:48:57 ====reading 0 of (6216) bytes . Finished: 0 +Debug: 05-18 23:48:57 ====reading 0 of (6216) bytes . Finished: 0 +Warning: 05-18 23:48:57 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:50:21 translating from clipboard or selection +Debug: 05-18 23:50:21 clipboard data: "--- hakurei.cpp.orig\t2024-05-19 12:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 12:30:00.000000000 +0000\n@@ -17,7 +17,7 @@\n }\n i++;\n }\n-}\n+ return {\"\", \"\"};\n }\n \n inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n@@ -34,11 +34,11 @@\n \t search_string = argv[i + 1];\n \t break;\n \t}\n- }\n+ }\n } else {\n if (argc < 2) {\n \tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n \texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n@@ -49,7 +49,7 @@\n \t} else {\n \t search_string = argv[i];\n \t break;\n-\t}\n+ }\n }\n }\n }\n" +Debug: 05-18 23:50:21 Current state: true true false true +Debug: 05-18 23:50:21 getResource: "gdlookup://localhost/?word=--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ %7D i++; %7D -%7D + return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B @@ -34,11 +34,11 @@ search_string %3D argv[i + 1]; break; %7D - %7D + %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B @@ -49,7 +49,7 @@ %7D else %7B search_string %3D argv[i]; break; - %7D + %7D %7D %7D %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:50:21 scheme: "gdlookup" +Debug: 05-18 23:50:21 host: "localhost" +Debug: 05-18 23:50:21 clear current dictionaries: "--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ } i++; } -} + return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { @@ -34,11 +34,11 @@ search_string = argv[i + 1]; break; } - } + } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { @@ -49,7 +49,7 @@ } else { search_string = argv[i]; break; - } + } } } }" +Debug: 05-18 23:50:21 some body finished +Debug: 05-18 23:50:21 one not finished. +Debug: 05-18 23:50:21 ====reading 2011 of (2011) bytes . Finished: 0 +Debug: 05-18 23:50:21 ====reading 0 of (2011) bytes . Finished: 0 +Debug: 05-18 23:50:21 ====reading 0 of (2011) bytes . Finished: 0 +Warning: 05-18 23:50:21 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:50:37 translating from clipboard or selection +Debug: 05-18 23:50:37 clipboard data: "88c88\n< }\n---\n> return {\"\", \"\"};\n94,96c94,95\n< if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n< search_string = argv[i + 1];\n< break;\n---\n> if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n> search_string = argv[i + 1];\n100,101c99\n< if (argc < 2) {\n< std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n---\n> if (argc < 2) {\n103,108c101,104\n< exit(1);\n< }\n< for (int i = 1; i < argc; ++i) {\n< if (std::strcmp(argv[i], \"--debug\") == 0) {\n< // Handle debug mode\n< } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n---\n> exit(1);\n> }\n> for (int i = 1; i < argc; ++i) {\n> if (std::strcmp(argv[i], \"--debug\") == 0) {\n110c106\n< } else {\n---\n> } else {\n113,114c109,110\n< break;\n< }\n---\n> break;\n> }\n116,117c112\n< std::cerr << \"Search string not provided.\" << std::endl;\n< exit(1);\n---\n> std::cerr << \"Search string not provided.\" << std::endl;\n119c114\n< return search_string;\n---\n> return search_string;\n247c242\n< std::vector substrings;\n---\n> std::vector substrings;\n251c246\n< while (!search_string.empty()) {\n---\n> while (!search_string.empty()) {\n253,254c248,249\n< while (itr.next()) {\n< results.emplace_back(itr.decoded_view(), itr.id());\n---\n> while (itr.next()) {\n> results.emplace_back(itr.decoded_view(), itr.id());\n256,257c251\n< log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n< }\n---\n> log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n260,261c254,255\n< for (const auto& entry : results) {\n< const std::string substring(entry.decoded_view);\n---\n> for (const auto& entry : results) {\n> const std::string substring(entry.decoded_view);\n263,269c257,263\n< derived_map[substring].push_back(search_string);\n< alternatives_map[search_string].insert(substring);\n< log_internal(\"Substring added: \" + substring);\n< if (!goldendict_mode) {\n< std::cout << substring << std::endl;\n< }\n< }\n---\n> derived_map[substring].push_back(search_string);\n> alternatives_map[search_string].insert(substring);\n> log_internal(\"Substring added: \" + substring);\n> if (!goldendict_mode) {\n> std::cout << substring << std::endl;\n> }\n> }\n273,274c267,268\n< const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n< log_internal(\"Removed character: \" + removed_char);\n---\n> const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n> log_internal(\"Removed character: \" + removed_char);\n276,277c270,271\n< std::cout << removed_char << std::endl;\n< }\n---\n> std::cout << removed_char << std::endl;\n> }\n279,282c273,276\n< std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n< log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n< break;\n< }\n---\n> std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n> log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n> break;\n> }\n284c278\n< log_internal(\"New search string: \" + search_string);\n---\n> log_internal(\"New search string: \" + search_string);\n286,287c280,281\n< std::cout << \"After removing one character: \" << search_string << std::endl;\n< raw_output += search_string + '\\n';\n---\n> std::cout << \"After removing one character: \" << search_string << std::endl;\n> raw_output += search_string + '\\n';\n289c283\n< results.clear();\n---\n> results.clear();\n291c285\n< search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n---\n> search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n293,295c287,288\n< if (debug_mode) {\n< print_debug_info(substrings, raw_output);\n< }\n---\n> if (debug_mode) {\n> print_debug_info(substrings, raw_output);\n297,299c290,291\n< wrap_html_output(substrings, alternatives_map, sentence);\n< exit(0);\n< }\n---\n> wrap_html_output(substrings, alternatives_map, sentence);\n> exit(0);\n301c293\n< return 0;\n---\n> return 0;\n" +Debug: 05-18 23:50:37 Current state: true false false true +Debug: 05-18 23:50:37 getResource: "gdlookup://localhost/?word=88c88 %3C %7D --- %3E return %7B%22%22, %22%22%7D; 94,96c94,95 %3C if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3C search_string %3D argv[i + 1]; %3C break; --- %3E if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3E search_string %3D argv[i + 1]; 100,101c99 %3C if (argc %3C 2) %7B %3C std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; --- %3E if (argc %3C 2) %7B 103,108c101,104 %3C exit(1); %3C %7D %3C for (int i %3D 1; i %3C argc; ++i) %7B %3C if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B %3C // Handle debug mode %3C %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B --- %3E exit(1); %3E %7D %3E for (int i %3D 1; i %3C argc; ++i) %7B %3E if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B 110c106 %3C %7D else %7B --- %3E %7D else %7B 113,114c109,110 %3C break; %3C %7D --- %3E break; %3E %7D 116,117c112 %3C std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; %3C exit(1); --- %3E std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; 119c114 %3C return search_string; --- %3E return search_string; 247c242 %3C std::vector%3Cstd::string%3E substrings; --- %3E std::vector%3Cstd::string%3E substrings; 251c246 %3C while (!search_string.empty()) %7B --- %3E while (!search_string.empty()) %7B 253,254c248,249 %3C while (itr.next()) %7B %3C results.emplace_back(itr.decoded_view(), itr.id()); --- %3E while (itr.next()) %7B %3E results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 %3C log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %3C %7D --- %3E log_internal(%22Found result: %22 + std::string(itr.decoded_view())); 260,261c254,255 %3C for (const auto%26 entry : results) %7B %3C const std::string substring(entry.decoded_view); --- %3E for (const auto%26 entry : results) %7B %3E const std::string substring(entry.decoded_view); 263,269c257,263 %3C derived_map[substring].push_back(search_string); %3C alternatives_map[search_string].insert(substring); %3C log_internal(%22Substring added: %22 + substring); %3C if (!goldendict_mode) %7B %3C std::cout %3C%3C substring %3C%3C std::endl; %3C %7D %3C %7D --- %3E derived_map[substring].push_back(search_string); %3E alternatives_map[search_string].insert(substring); %3E log_internal(%22Substring added: %22 + substring); %3E if (!goldendict_mode) %7B %3E std::cout %3C%3C substring %3C%3C std::endl; %3E %7D %3E %7D 273,274c267,268 %3C const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3C log_internal(%22Removed character: %22 + removed_char); --- %3E const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3E log_internal(%22Removed character: %22 + removed_char); 276,277c270,271 %3C std::cout %3C%3C removed_char %3C%3C std::endl; %3C %7D --- %3E std::cout %3C%3C removed_char %3C%3C std::endl; %3E %7D 279,282c273,276 %3C std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3C log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3C break; %3C %7D --- %3E std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3E log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3E break; %3E %7D 284c278 %3C log_internal(%22New search string: %22 + search_string); --- %3E log_internal(%22New search string: %22 + search_string); 286,287c280,281 %3C std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3C raw_output +%3D search_string + %27%5Cn%27; --- %3E std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3E raw_output +%3D search_string + %27%5Cn%27; 289c283 %3C results.clear(); --- %3E results.clear(); 291c285 %3C search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); --- %3E search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); 293,295c287,288 %3C if (debug_mode) %7B %3C print_debug_info(substrings, raw_output); %3C %7D --- %3E if (debug_mode) %7B %3E print_debug_info(substrings, raw_output); 297,299c290,291 %3C wrap_html_output(substrings, alternatives_map, sentence); %3C exit(0); %3C %7D --- %3E wrap_html_output(substrings, alternatives_map, sentence); %3E exit(0); 301c293 %3C return 0; --- %3E return 0;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:50:37 scheme: "gdlookup" +Debug: 05-18 23:50:37 host: "localhost" +Debug: 05-18 23:50:37 clear current dictionaries: "88c88 < } --- > return {\"\", \"\"}; 94,96c94,95 < if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { < search_string = argv[i + 1]; < break; --- > if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { > search_string = argv[i + 1]; 100,101c99 < if (argc < 2) { < std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; --- > if (argc < 2) { 103,108c101,104 < exit(1); < } < for (int i = 1; i < argc; ++i) { < if (std::strcmp(argv[i], \"--debug\") == 0) { < // Handle debug mode < } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { --- > exit(1); > } > for (int i = 1; i < argc; ++i) { > if (std::strcmp(argv[i], \"--debug\") == 0) { 110c106 < } else { --- > } else { 113,114c109,110 < break; < } --- > break; > } 116,117c112 < std::cerr << \"Search string not provided.\" << std::endl; < exit(1); --- > std::cerr << \"Search string not provided.\" << std::endl; 119c114 < return search_string; --- > return search_string; 247c242 < std::vector substrings; --- > std::vector substrings; 251c246 < while (!search_string.empty()) { --- > while (!search_string.empty()) { 253,254c248,249 < while (itr.next()) { < results.emplace_back(itr.decoded_view(), itr.id()); --- > while (itr.next()) { > results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 < log_internal(\"Found result: \" + std::string(itr.decoded_view())); < } --- > log_internal(\"Found result: \" + std::string(itr.decoded_view())); 260,261c254,255 < for (const auto& entry : results) { < const std::string substring(entry.decoded_view); --- > for (const auto& entry : results) { > const std::string substring(entry.decoded_view); 263,269c257,263 < derived_map[substring].push_back(search_string); < alternatives_map[search_string].insert(substring); < log_internal(\"Substring added: \" + substring); < if (!goldendict_mode) { < std::cout << substring << std::endl; < } < } --- > derived_map[substring].push_back(search_string); > alternatives_map[search_string].insert(substring); > log_internal(\"Substring added: \" + substring); > if (!goldendict_mode) { > std::cout << substring << std::endl; > } > } 273,274c267,268 < const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); < log_internal(\"Removed character: \" + removed_char); --- > const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); > log_internal(\"Removed character: \" + removed_char); 276,277c270,271 < std::cout << removed_char << std::endl; < } --- > std::cout << removed_char << std::endl; > } 279,282c273,276 < std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; < log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); < break; < } --- > std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; > log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); > break; > } 284c278 < log_internal(\"New search string: \" + search_string); --- > log_internal(\"New search string: \" + search_string); 286,287c280,281 < std::cout << \"After removing one character: \" << search_string << std::endl; < raw_output += search_string + '\\n'; --- > std::cout << \"After removing one character: \" << search_string << std::endl; > raw_output += search_string + '\\n'; 289c283 < results.clear(); --- > results.clear(); 291c285 < search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); --- > search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); 293,295c287,288 < if (debug_mode) { < print_debug_info(substrings, raw_output); < } --- > if (debug_mode) { > print_debug_info(substrings, raw_output); 297,299c290,291 < wrap_html_output(substrings, alternatives_map, sentence); < exit(0); < } --- > wrap_html_output(substrings, alternatives_map, sentence); > exit(0); 301c293 < return 0; --- > return 0;" +Debug: 05-18 23:50:37 some body finished +Debug: 05-18 23:50:37 one not finished. +Debug: 05-18 23:50:37 ====reading 6216 of (6216) bytes . Finished: 0 +Debug: 05-18 23:50:37 ====reading 0 of (6216) bytes . Finished: 0 +Debug: 05-18 23:50:37 ====reading 0 of (6216) bytes . Finished: 0 +Warning: 05-18 23:50:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:50:38 translating from clipboard or selection +Debug: 05-18 23:50:38 clipboard data: "88c88\n< }\n---\n> return {\"\", \"\"};\n94,96c94,95\n< if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n< search_string = argv[i + 1];\n< break;\n---\n> if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) {\n> search_string = argv[i + 1];\n100,101c99\n< if (argc < 2) {\n< std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n---\n> if (argc < 2) {\n103,108c101,104\n< exit(1);\n< }\n< for (int i = 1; i < argc; ++i) {\n< if (std::strcmp(argv[i], \"--debug\") == 0) {\n< // Handle debug mode\n< } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) {\n---\n> exit(1);\n> }\n> for (int i = 1; i < argc; ++i) {\n> if (std::strcmp(argv[i], \"--debug\") == 0) {\n110c106\n< } else {\n---\n> } else {\n113,114c109,110\n< break;\n< }\n---\n> break;\n> }\n116,117c112\n< std::cerr << \"Search string not provided.\" << std::endl;\n< exit(1);\n---\n> std::cerr << \"Search string not provided.\" << std::endl;\n119c114\n< return search_string;\n---\n> return search_string;\n247c242\n< std::vector substrings;\n---\n> std::vector substrings;\n251c246\n< while (!search_string.empty()) {\n---\n> while (!search_string.empty()) {\n253,254c248,249\n< while (itr.next()) {\n< results.emplace_back(itr.decoded_view(), itr.id());\n---\n> while (itr.next()) {\n> results.emplace_back(itr.decoded_view(), itr.id());\n256,257c251\n< log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n< }\n---\n> log_internal(\"Found result: \" + std::string(itr.decoded_view()));\n260,261c254,255\n< for (const auto& entry : results) {\n< const std::string substring(entry.decoded_view);\n---\n> for (const auto& entry : results) {\n> const std::string substring(entry.decoded_view);\n263,269c257,263\n< derived_map[substring].push_back(search_string);\n< alternatives_map[search_string].insert(substring);\n< log_internal(\"Substring added: \" + substring);\n< if (!goldendict_mode) {\n< std::cout << substring << std::endl;\n< }\n< }\n---\n> derived_map[substring].push_back(search_string);\n> alternatives_map[search_string].insert(substring);\n> log_internal(\"Substring added: \" + substring);\n> if (!goldendict_mode) {\n> std::cout << substring << std::endl;\n> }\n> }\n273,274c267,268\n< const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n< log_internal(\"Removed character: \" + removed_char);\n---\n> const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string);\n> log_internal(\"Removed character: \" + removed_char);\n276,277c270,271\n< std::cout << removed_char << std::endl;\n< }\n---\n> std::cout << removed_char << std::endl;\n> }\n279,282c273,276\n< std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n< log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n< break;\n< }\n---\n> std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl;\n> log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\");\n> break;\n> }\n284c278\n< log_internal(\"New search string: \" + search_string);\n---\n> log_internal(\"New search string: \" + search_string);\n286,287c280,281\n< std::cout << \"After removing one character: \" << search_string << std::endl;\n< raw_output += search_string + '\\n';\n---\n> std::cout << \"After removing one character: \" << search_string << std::endl;\n> raw_output += search_string + '\\n';\n289c283\n< results.clear();\n---\n> results.clear();\n291c285\n< search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n---\n> search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n293,295c287,288\n< if (debug_mode) {\n< print_debug_info(substrings, raw_output);\n< }\n---\n> if (debug_mode) {\n> print_debug_info(substrings, raw_output);\n297,299c290,291\n< wrap_html_output(substrings, alternatives_map, sentence);\n< exit(0);\n< }\n---\n> wrap_html_output(substrings, alternatives_map, sentence);\n> exit(0);\n301c293\n< return 0;\n---\n> return 0;\n" +Debug: 05-18 23:50:38 Current state: true false true true +Debug: 05-18 23:50:38 getResource: "gdlookup://localhost/?word=88c88 %3C %7D --- %3E return %7B%22%22, %22%22%7D; 94,96c94,95 %3C if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3C search_string %3D argv[i + 1]; %3C break; --- %3E if (std::strcmp(argv[i], %22--sentence%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B %3E search_string %3D argv[i + 1]; 100,101c99 %3C if (argc %3C 2) %7B %3C std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; --- %3E if (argc %3C 2) %7B 103,108c101,104 %3C exit(1); %3C %7D %3C for (int i %3D 1; i %3C argc; ++i) %7B %3C if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B %3C // Handle debug mode %3C %7D else if (std::strcmp(argv[i], %22--dict%22) %3D%3D 0 %26%26 i + 1 %3C argc) %7B --- %3E exit(1); %3E %7D %3E for (int i %3D 1; i %3C argc; ++i) %7B %3E if (std::strcmp(argv[i], %22--debug%22) %3D%3D 0) %7B 110c106 %3C %7D else %7B --- %3E %7D else %7B 113,114c109,110 %3C break; %3C %7D --- %3E break; %3E %7D 116,117c112 %3C std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; %3C exit(1); --- %3E std::cerr %3C%3C %22Search string not provided.%22 %3C%3C std::endl; 119c114 %3C return search_string; --- %3E return search_string; 247c242 %3C std::vector%3Cstd::string%3E substrings; --- %3E std::vector%3Cstd::string%3E substrings; 251c246 %3C while (!search_string.empty()) %7B --- %3E while (!search_string.empty()) %7B 253,254c248,249 %3C while (itr.next()) %7B %3C results.emplace_back(itr.decoded_view(), itr.id()); --- %3E while (itr.next()) %7B %3E results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 %3C log_internal(%22Found result: %22 + std::string(itr.decoded_view())); %3C %7D --- %3E log_internal(%22Found result: %22 + std::string(itr.decoded_view())); 260,261c254,255 %3C for (const auto%26 entry : results) %7B %3C const std::string substring(entry.decoded_view); --- %3E for (const auto%26 entry : results) %7B %3E const std::string substring(entry.decoded_view); 263,269c257,263 %3C derived_map[substring].push_back(search_string); %3C alternatives_map[search_string].insert(substring); %3C log_internal(%22Substring added: %22 + substring); %3C if (!goldendict_mode) %7B %3C std::cout %3C%3C substring %3C%3C std::endl; %3C %7D %3C %7D --- %3E derived_map[substring].push_back(search_string); %3E alternatives_map[search_string].insert(substring); %3E log_internal(%22Substring added: %22 + substring); %3E if (!goldendict_mode) %7B %3E std::cout %3C%3C substring %3C%3C std::endl; %3E %7D %3E %7D 273,274c267,268 %3C const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3C log_internal(%22Removed character: %22 + removed_char); --- %3E const auto [removed_char, new_search_string] %3D remove_one_utf8_char(search_string); %3E log_internal(%22Removed character: %22 + removed_char); 276,277c270,271 %3C std::cout %3C%3C removed_char %3C%3C std::endl; %3C %7D --- %3E std::cout %3C%3C removed_char %3C%3C std::endl; %3E %7D 279,282c273,276 %3C std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3C log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3C break; %3C %7D --- %3E std::cerr %3C%3C %22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22 %3C%3C std::endl; %3E log_internal(%22Error: Search string did not change after removing a character. Exiting to prevent infinite loop.%22); %3E break; %3E %7D 284c278 %3C log_internal(%22New search string: %22 + search_string); --- %3E log_internal(%22New search string: %22 + search_string); 286,287c280,281 %3C std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3C raw_output +%3D search_string + %27%5Cn%27; --- %3E std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; %3E raw_output +%3D search_string + %27%5Cn%27; 289c283 %3C results.clear(); --- %3E results.clear(); 291c285 %3C search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); --- %3E search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); 293,295c287,288 %3C if (debug_mode) %7B %3C print_debug_info(substrings, raw_output); %3C %7D --- %3E if (debug_mode) %7B %3E print_debug_info(substrings, raw_output); 297,299c290,291 %3C wrap_html_output(substrings, alternatives_map, sentence); %3C exit(0); %3C %7D --- %3E wrap_html_output(substrings, alternatives_map, sentence); %3E exit(0); 301c293 %3C return 0; --- %3E return 0;&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:50:38 scheme: "gdlookup" +Debug: 05-18 23:50:38 host: "localhost" +Debug: 05-18 23:50:38 clear current dictionaries: "88c88 < } --- > return {\"\", \"\"}; 94,96c94,95 < if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { < search_string = argv[i + 1]; < break; --- > if (std::strcmp(argv[i], \"--sentence\") == 0 && i + 1 < argc) { > search_string = argv[i + 1]; 100,101c99 < if (argc < 2) { < std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; --- > if (argc < 2) { 103,108c101,104 < exit(1); < } < for (int i = 1; i < argc; ++i) { < if (std::strcmp(argv[i], \"--debug\") == 0) { < // Handle debug mode < } else if (std::strcmp(argv[i], \"--dict\") == 0 && i + 1 < argc) { --- > exit(1); > } > for (int i = 1; i < argc; ++i) { > if (std::strcmp(argv[i], \"--debug\") == 0) { 110c106 < } else { --- > } else { 113,114c109,110 < break; < } --- > break; > } 116,117c112 < std::cerr << \"Search string not provided.\" << std::endl; < exit(1); --- > std::cerr << \"Search string not provided.\" << std::endl; 119c114 < return search_string; --- > return search_string; 247c242 < std::vector substrings; --- > std::vector substrings; 251c246 < while (!search_string.empty()) { --- > while (!search_string.empty()) { 253,254c248,249 < while (itr.next()) { < results.emplace_back(itr.decoded_view(), itr.id()); --- > while (itr.next()) { > results.emplace_back(itr.decoded_view(), itr.id()); 256,257c251 < log_internal(\"Found result: \" + std::string(itr.decoded_view())); < } --- > log_internal(\"Found result: \" + std::string(itr.decoded_view())); 260,261c254,255 < for (const auto& entry : results) { < const std::string substring(entry.decoded_view); --- > for (const auto& entry : results) { > const std::string substring(entry.decoded_view); 263,269c257,263 < derived_map[substring].push_back(search_string); < alternatives_map[search_string].insert(substring); < log_internal(\"Substring added: \" + substring); < if (!goldendict_mode) { < std::cout << substring << std::endl; < } < } --- > derived_map[substring].push_back(search_string); > alternatives_map[search_string].insert(substring); > log_internal(\"Substring added: \" + substring); > if (!goldendict_mode) { > std::cout << substring << std::endl; > } > } 273,274c267,268 < const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); < log_internal(\"Removed character: \" + removed_char); --- > const auto [removed_char, new_search_string] = remove_one_utf8_char(search_string); > log_internal(\"Removed character: \" + removed_char); 276,277c270,271 < std::cout << removed_char << std::endl; < } --- > std::cout << removed_char << std::endl; > } 279,282c273,276 < std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; < log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); < break; < } --- > std::cerr << \"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\" << std::endl; > log_internal(\"Error: Search string did not change after removing a character. Exiting to prevent infinite loop.\"); > break; > } 284c278 < log_internal(\"New search string: \" + search_string); --- > log_internal(\"New search string: \" + search_string); 286,287c280,281 < std::cout << \"After removing one character: \" << search_string << std::endl; < raw_output += search_string + '\\n'; --- > std::cout << \"After removing one character: \" << search_string << std::endl; > raw_output += search_string + '\\n'; 289c283 < results.clear(); --- > results.clear(); 291c285 < search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); --- > search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); 293,295c287,288 < if (debug_mode) { < print_debug_info(substrings, raw_output); < } --- > if (debug_mode) { > print_debug_info(substrings, raw_output); 297,299c290,291 < wrap_html_output(substrings, alternatives_map, sentence); < exit(0); < } --- > wrap_html_output(substrings, alternatives_map, sentence); > exit(0); 301c293 < return 0; --- > return 0;" +Debug: 05-18 23:50:38 some body finished +Debug: 05-18 23:50:38 one not finished. +Debug: 05-18 23:50:38 ====reading 6216 of (6216) bytes . Finished: 0 +Debug: 05-18 23:50:38 ====reading 0 of (6216) bytes . Finished: 0 +Debug: 05-18 23:50:38 ====reading 0 of (6216) bytes . Finished: 0 +Warning: 05-18 23:50:38 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:51:47 translating from clipboard or selection +Debug: 05-18 23:51:47 clipboard data: "--- hakurei.cpp.orig\t2024-05-19 12:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 12:30:00.000000000 +0000\n@@ -17,7 +17,7 @@\n }\n i++;\n }\n-}\n+ return {\"\", \"\"};\n }\n \n inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n@@ -34,11 +34,11 @@\n \t search_string = argv[i + 1];\n \t break;\n \t}\n- }\n+ }\n } else {\n if (argc < 2) {\n \tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n \texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n@@ -49,7 +49,7 @@\n \t} else {\n \t search_string = argv[i];\n \t break;\n-\t}\n+ }\n }\n }\n }\n@@ -134,6 +134,9 @@\n search_string = new_search_string;\n log_internal(\"New search string: \" + search_string);\n \n+ // Break if the search string is empty\n+ if (search_string.empty()) break;\n+\n // Print debug information if in debug mode\n if (debug_mode) {\n std::cout << \"After removing one character: \" << search_string << std::endl;\n@@ -141,6 +144,7 @@\n }\n \n results.clear();\n+\n // Remove leading whitespace\n search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\"));\n }\n@@ -149,6 +153,10 @@\n if (debug_mode) {\n print_debug_info(substrings, raw_output);\n }\n+\n+ // Log if the loop finished without issues\n+ log_internal(\"Finished processing search string\");\n+\n // Wrap the output in HTML format for GoldenDict if in GoldenDict mode\n if (goldendict_mode) {\n wrap_html_output(substrings, alternatives_map, sentence);\n" +Debug: 05-18 23:51:47 Current state: true false true true +Debug: 05-18 23:51:47 getResource: "gdlookup://localhost/?word=--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ %7D i++; %7D -%7D + return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B @@ -34,11 +34,11 @@ search_string %3D argv[i + 1]; break; %7D - %7D + %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B @@ -49,7 +49,7 @@ %7D else %7B search_string %3D argv[i]; break; - %7D + %7D %7D %7D %7D @@ -134,6 +134,9 @@ search_string %3D new_search_string; log_internal(%22New search string: %22 + search_string); + // Break if the search string is empty + if (search_string.empty()) break; + // Print debug information if in debug mode if (debug_mode) %7B std::cout %3C%3C %22After removing one character: %22 %3C%3C search_string %3C%3C std::endl; @@ -141,6 +144,7 @@ %7D results.clear(); + // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(%22 %5Ct%5Cn%5Cr%5Cf%5Cv%22)); %7D @@ -149,6 +153,10 @@ if (debug_mode) %7B print_debug_info(substrings, raw_output); %7D + + // Log if the loop finished without issues + log_internal(%22Finished processing search string%22); + // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) %7B wrap_html_output(substrings, alternatives_map, sentence);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:51:47 scheme: "gdlookup" +Debug: 05-18 23:51:47 host: "localhost" +Debug: 05-18 23:51:47 clear current dictionaries: "--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ } i++; } -} + return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { @@ -34,11 +34,11 @@ search_string = argv[i + 1]; break; } - } + } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { @@ -49,7 +49,7 @@ } else { search_string = argv[i]; break; - } + } } } } @@ -134,6 +134,9 @@ search_string = new_search_string; log_internal(\"New search string: \" + search_string); + // Break if the search string is empty + if (search_string.empty()) break; + // Print debug information if in debug mode if (debug_mode) { std::cout << \"After removing one character: \" << search_string << std::endl; @@ -141,6 +144,7 @@ } results.clear(); + // Remove leading whitespace search_string.erase(0, search_string.find_first_not_of(\" \\t\\n\\r\\f\\v\")); } @@ -149,6 +153,10 @@ if (debug_mode) { print_debug_info(substrings, raw_output); } + + // Log if the loop finished without issues + log_internal(\"Finished processing search string\"); + // Wrap the output in HTML format for GoldenDict if in GoldenDict mode if (goldendict_mode) { wrap_html_output(substrings, alternatives_map, sentence);" +Debug: 05-18 23:51:47 some body finished +Debug: 05-18 23:51:47 one not finished. +Debug: 05-18 23:51:47 ====reading 2876 of (2876) bytes . Finished: 0 +Debug: 05-18 23:51:47 ====reading 0 of (2876) bytes . Finished: 0 +Debug: 05-18 23:51:47 ====reading 0 of (2876) bytes . Finished: 0 +Warning: 05-18 23:51:47 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:51:50 translating from clipboard or selection +Debug: 05-18 23:51:50 clipboard data: "--- hakurei.cpp.orig\t2024-05-19 12:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 12:30:00.000000000 +0000\n@@ -17,7 +17,7 @@\n }\n i++;\n }\n-}\n+ return {\"\", \"\"};\n }\n \n inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n@@ -34,11 +34,11 @@\n \t search_string = argv[i + 1];\n \t break;\n \t}\n- }\n+ }\n } else {\n if (argc < 2) {\n \tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n \texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n@@ -49,7 +49,7 @@\n \t} else {\n \t search_string = argv[i];\n \t break;\n-\t}\n+ }\n }\n }\n }\n" +Debug: 05-18 23:51:50 Current state: true false true true +Debug: 05-18 23:51:50 getResource: "gdlookup://localhost/?word=--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ %7D i++; %7D -%7D + return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B @@ -34,11 +34,11 @@ search_string %3D argv[i + 1]; break; %7D - %7D + %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B @@ -49,7 +49,7 @@ %7D else %7B search_string %3D argv[i]; break; - %7D + %7D %7D %7D %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:51:50 scheme: "gdlookup" +Debug: 05-18 23:51:50 host: "localhost" +Debug: 05-18 23:51:50 clear current dictionaries: "--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ } i++; } -} + return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { @@ -34,11 +34,11 @@ search_string = argv[i + 1]; break; } - } + } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { @@ -49,7 +49,7 @@ } else { search_string = argv[i]; break; - } + } } } }" +Debug: 05-18 23:51:50 some body finished +Debug: 05-18 23:51:50 one not finished. +Debug: 05-18 23:51:50 ====reading 2011 of (2011) bytes . Finished: 0 +Debug: 05-18 23:51:50 ====reading 0 of (2011) bytes . Finished: 0 +Debug: 05-18 23:51:50 ====reading 0 of (2011) bytes . Finished: 0 +Warning: 05-18 23:51:50 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:51:51 translating from clipboard or selection +Debug: 05-18 23:51:51 clipboard data: "--- hakurei.cpp.orig\t2024-05-19 12:00:00.000000000 +0000\n+++ hakurei.cpp\t2024-05-19 12:30:00.000000000 +0000\n@@ -17,7 +17,7 @@\n }\n i++;\n }\n-}\n+ return {\"\", \"\"};\n }\n \n inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) {\n@@ -34,11 +34,11 @@\n \t search_string = argv[i + 1];\n \t break;\n \t}\n- }\n+ }\n } else {\n if (argc < 2) {\n \tstd::cerr << \"Usage: \" << argv[0] << \" \" << std::endl;\n \texit(1);\n }\n for (int i = 1; i < argc; ++i) {\n@@ -49,7 +49,7 @@\n \t} else {\n \t search_string = argv[i];\n \t break;\n-\t}\n+ }\n }\n }\n }\n" +Debug: 05-18 23:51:51 Current state: true false true true +Debug: 05-18 23:51:51 getResource: "gdlookup://localhost/?word=--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ %7D i++; %7D -%7D + return %7B%22%22, %22%22%7D; %7D inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) %7B @@ -34,11 +34,11 @@ search_string %3D argv[i + 1]; break; %7D - %7D + %7D %7D else %7B if (argc %3C 2) %7B std::cerr %3C%3C %22Usage: %22 %3C%3C argv[0] %3C%3C %22 %3Csearch_string%3E%22 %3C%3C std::endl; exit(1); %7D for (int i %3D 1; i %3C argc; ++i) %7B @@ -49,7 +49,7 @@ %7D else %7B search_string %3D argv[i]; break; - %7D + %7D %7D %7D %7D&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:51:51 scheme: "gdlookup" +Debug: 05-18 23:51:51 host: "localhost" +Debug: 05-18 23:51:51 clear current dictionaries: "--- hakurei.cpp.orig 2024-05-19 12:00:00.000000000 +0000 +++ hakurei.cpp 2024-05-19 12:30:00.000000000 +0000 @@ -17,7 +17,7 @@ } i++; } -} + return {\"\", \"\"}; } inline std::string get_input(const int argc, char* const argv[], const bool goldendict_mode) { @@ -34,11 +34,11 @@ search_string = argv[i + 1]; break; } - } + } } else { if (argc < 2) { std::cerr << \"Usage: \" << argv[0] << \" \" << std::endl; exit(1); } for (int i = 1; i < argc; ++i) { @@ -49,7 +49,7 @@ } else { search_string = argv[i]; break; - } + } } } }" +Debug: 05-18 23:51:51 some body finished +Debug: 05-18 23:51:51 one not finished. +Debug: 05-18 23:51:51 ====reading 2011 of (2011) bytes . Finished: 0 +Debug: 05-18 23:51:51 ====reading 0 of (2011) bytes . Finished: 0 +Debug: 05-18 23:51:51 ====reading 0 of (2011) bytes . Finished: 0 +Warning: 05-18 23:51:51 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:52:09 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:52:09 scheme: "gdlookup" +Debug: 05-18 23:52:09 host: "localhost" +Debug: 05-18 23:52:09 clear current dictionaries: "議" +Debug: 05-18 23:52:09 some body finished +Debug: 05-18 23:52:09 one not finished. +Debug: 05-18 23:52:09 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 23:52:09 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:52:09 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 23:52:09 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:52:11 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:52:11 scheme: "gdlookup" +Debug: 05-18 23:52:11 host: "localhost" +Debug: 05-18 23:52:11 clear current dictionaries: "ゆっくり" +Debug: 05-18 23:52:11 some body finished +Debug: 05-18 23:52:11 one not finished. +Debug: 05-18 23:52:11 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 23:52:11 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:52:11 ====reading 0 of (1415) bytes . Finished: 0 +Warning: 05-18 23:52:11 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:52:14 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:52:14 scheme: "gdlookup" +Debug: 05-18 23:52:14 host: "localhost" +Debug: 05-18 23:52:14 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 23:52:14 some body finished +Debug: 05-18 23:52:14 one not finished. +Debug: 05-18 23:52:14 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 23:52:14 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:52:14 ====reading 0 of (1430) bytes . Finished: 0 +Warning: 05-18 23:52:14 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:52:28 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:52:28 scheme: "gdlookup" +Debug: 05-18 23:52:28 host: "localhost" +Debug: 05-18 23:52:28 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:52:28 some body finished +Debug: 05-18 23:52:28 one not finished. +Debug: 05-18 23:52:28 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:52:28 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:52:28 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 23:52:28 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:55:00 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:55:00 scheme: "gdlookup" +Debug: 05-18 23:55:00 host: "localhost" +Debug: 05-18 23:55:00 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:55:00 some body finished +Debug: 05-18 23:55:00 one not finished. +Debug: 05-18 23:55:00 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:55:00 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:55:00 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 23:55:00 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:55:51 translating from clipboard or selection +Debug: 05-18 23:55:51 clipboard data: "&& !sentence.empty()" +Debug: 05-18 23:55:51 Current state: true true false true +Debug: 05-18 23:55:51 getResource: "gdlookup://localhost/?word=%26%26 !sentence.empty()&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:55:51 scheme: "gdlookup" +Debug: 05-18 23:55:51 host: "localhost" +Debug: 05-18 23:55:51 clear current dictionaries: "&& !sentence.empty()" +Debug: 05-18 23:55:51 some body finished +Debug: 05-18 23:55:51 one not finished. +Debug: 05-18 23:55:51 ====reading 1431 of (1431) bytes . Finished: 0 +Debug: 05-18 23:55:51 ====reading 0 of (1431) bytes . Finished: 0 +Debug: 05-18 23:55:51 ====reading 0 of (1431) bytes . Finished: 0 +Warning: 05-18 23:55:51 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:55:52 translating from clipboard or selection +Debug: 05-18 23:55:52 clipboard data: "&& !sentence.empty()" +Debug: 05-18 23:55:52 Current state: true false false true +Debug: 05-18 23:55:52 getResource: "gdlookup://localhost/?word=%26%26 !sentence.empty()&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:55:52 scheme: "gdlookup" +Debug: 05-18 23:55:52 host: "localhost" +Debug: 05-18 23:55:52 clear current dictionaries: "&& !sentence.empty()" +Debug: 05-18 23:55:52 some body finished +Debug: 05-18 23:55:52 one not finished. +Debug: 05-18 23:55:52 ====reading 1431 of (1431) bytes . Finished: 0 +Debug: 05-18 23:55:52 ====reading 0 of (1431) bytes . Finished: 0 +Debug: 05-18 23:55:52 ====reading 0 of (1431) bytes . Finished: 0 +Warning: 05-18 23:55:52 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:55:53 translating from clipboard or selection +Debug: 05-18 23:55:53 clipboard data: "&& !sentence.empty()" +Debug: 05-18 23:55:53 Current state: true false true true +Debug: 05-18 23:55:53 getResource: "gdlookup://localhost/?word=%26%26 !sentence.empty()&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:55:53 scheme: "gdlookup" +Debug: 05-18 23:55:53 host: "localhost" +Debug: 05-18 23:55:53 clear current dictionaries: "&& !sentence.empty()" +Debug: 05-18 23:55:53 some body finished +Debug: 05-18 23:55:53 one not finished. +Debug: 05-18 23:55:53 ====reading 1431 of (1431) bytes . Finished: 0 +Debug: 05-18 23:55:53 ====reading 0 of (1431) bytes . Finished: 0 +Debug: 05-18 23:55:53 ====reading 0 of (1431) bytes . Finished: 0 +Warning: 05-18 23:55:53 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:13 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:13 scheme: "gdlookup" +Debug: 05-18 23:56:13 host: "localhost" +Debug: 05-18 23:56:13 clear current dictionaries: "議" +Debug: 05-18 23:56:13 some body finished +Debug: 05-18 23:56:13 one not finished. +Debug: 05-18 23:56:13 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 23:56:13 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:56:13 ====reading 0 of (1406) bytes . Finished: 0 +Warning: 05-18 23:56:13 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:14 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:14 scheme: "gdlookup" +Debug: 05-18 23:56:14 host: "localhost" +Debug: 05-18 23:56:14 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:56:14 some body finished +Debug: 05-18 23:56:14 one not finished. +Debug: 05-18 23:56:14 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:56:14 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:56:14 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 23:56:14 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:30 translating from clipboard or selection +Debug: 05-18 23:56:30 clipboard data: "og_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:30 Current state: true true false true +Debug: 05-18 23:56:30 getResource: "gdlookup://localhost/?word=og_internal(%22Search string overridden by sentence: %22 + search_string);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:30 scheme: "gdlookup" +Debug: 05-18 23:56:30 host: "localhost" +Debug: 05-18 23:56:30 clear current dictionaries: "og_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:30 some body finished +Debug: 05-18 23:56:30 one not finished. +Debug: 05-18 23:56:30 ====reading 1483 of (1483) bytes . Finished: 0 +Debug: 05-18 23:56:30 ====reading 0 of (1483) bytes . Finished: 0 +Debug: 05-18 23:56:30 ====reading 0 of (1483) bytes . Finished: 0 +Warning: 05-18 23:56:30 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:32 translating from clipboard or selection +Debug: 05-18 23:56:32 clipboard data: "search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:32 Current state: true false false true +Debug: 05-18 23:56:32 getResource: "gdlookup://localhost/?word=search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:32 scheme: "gdlookup" +Debug: 05-18 23:56:32 host: "localhost" +Debug: 05-18 23:56:32 clear current dictionaries: "search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:32 some body finished +Debug: 05-18 23:56:32 one not finished. +Debug: 05-18 23:56:32 ====reading 1510 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:32 ====reading 0 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:32 ====reading 0 of (1510) bytes . Finished: 0 +Warning: 05-18 23:56:32 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:33 translating from clipboard or selection +Debug: 05-18 23:56:33 clipboard data: " search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:33 Current state: true false true true +Debug: 05-18 23:56:33 getResource: "gdlookup://localhost/?word=search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:33 scheme: "gdlookup" +Debug: 05-18 23:56:33 host: "localhost" +Debug: 05-18 23:56:33 clear current dictionaries: "search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:33 some body finished +Debug: 05-18 23:56:33 one not finished. +Debug: 05-18 23:56:33 ====reading 1510 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:33 ====reading 0 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:33 ====reading 0 of (1510) bytes . Finished: 0 +Warning: 05-18 23:56:33 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:34 translating from clipboard or selection +Debug: 05-18 23:56:34 clipboard data: " search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:34 Current state: true false true true +Debug: 05-18 23:56:34 getResource: "gdlookup://localhost/?word=search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:34 scheme: "gdlookup" +Debug: 05-18 23:56:34 host: "localhost" +Debug: 05-18 23:56:34 clear current dictionaries: "search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:34 some body finished +Debug: 05-18 23:56:34 one not finished. +Debug: 05-18 23:56:34 ====reading 1510 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:34 ====reading 0 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:34 ====reading 0 of (1510) bytes . Finished: 0 +Warning: 05-18 23:56:34 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:35 translating from clipboard or selection +Debug: 05-18 23:56:35 clipboard data: " search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:35 Current state: true false true true +Debug: 05-18 23:56:35 getResource: "gdlookup://localhost/?word=search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:35 scheme: "gdlookup" +Debug: 05-18 23:56:35 host: "localhost" +Debug: 05-18 23:56:35 clear current dictionaries: "search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:35 some body finished +Debug: 05-18 23:56:35 one not finished. +Debug: 05-18 23:56:35 ====reading 1510 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:35 ====reading 0 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:35 ====reading 0 of (1510) bytes . Finished: 0 +Warning: 05-18 23:56:35 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:56:37 translating from clipboard or selection +Debug: 05-18 23:56:37 clipboard data: " search_string = sentence;\n log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:37 Current state: true false true true +Debug: 05-18 23:56:37 getResource: "gdlookup://localhost/?word=search_string %3D sentence; log_internal(%22Search string overridden by sentence: %22 + search_string);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:56:37 scheme: "gdlookup" +Debug: 05-18 23:56:37 host: "localhost" +Debug: 05-18 23:56:37 clear current dictionaries: "search_string = sentence; log_internal(\"Search string overridden by sentence: \" + search_string);" +Debug: 05-18 23:56:37 some body finished +Debug: 05-18 23:56:37 one not finished. +Debug: 05-18 23:56:37 ====reading 1510 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:37 ====reading 0 of (1510) bytes . Finished: 0 +Debug: 05-18 23:56:37 ====reading 0 of (1510) bytes . Finished: 0 +Warning: 05-18 23:56:37 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:57:07 translating from clipboard or selection +Debug: 05-18 23:57:07 clipboard data: "get_input(argc, argv, goldendict_mode);" +Debug: 05-18 23:57:07 Current state: true false true true +Debug: 05-18 23:57:07 getResource: "gdlookup://localhost/?word=get_input(argc, argv, goldendict_mode);&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:07 scheme: "gdlookup" +Debug: 05-18 23:57:07 host: "localhost" +Debug: 05-18 23:57:07 clear current dictionaries: "get_input(argc, argv, goldendict_mode);" +Debug: 05-18 23:57:07 some body finished +Debug: 05-18 23:57:07 one not finished. +Debug: 05-18 23:57:07 ====reading 1442 of (1442) bytes . Finished: 0 +Debug: 05-18 23:57:07 ====reading 0 of (1442) bytes . Finished: 0 +Debug: 05-18 23:57:07 ====reading 0 of (1442) bytes . Finished: 0 +Warning: 05-18 23:57:07 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:57:08 translating from clipboard or selection +Debug: 05-18 23:57:08 clipboard data: "get_input(argc, argv, goldendict_mode)" +Debug: 05-18 23:57:08 Current state: true false true true +Debug: 05-18 23:57:08 getResource: "gdlookup://localhost/?word=get_input(argc, argv, goldendict_mode)&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:08 scheme: "gdlookup" +Debug: 05-18 23:57:08 host: "localhost" +Debug: 05-18 23:57:08 clear current dictionaries: "get_input(argc, argv, goldendict_mode)" +Debug: 05-18 23:57:08 some body finished +Debug: 05-18 23:57:08 one not finished. +Debug: 05-18 23:57:08 ====reading 1441 of (1441) bytes . Finished: 0 +Debug: 05-18 23:57:08 ====reading 0 of (1441) bytes . Finished: 0 +Debug: 05-18 23:57:08 ====reading 0 of (1441) bytes . Finished: 0 +Warning: 05-18 23:57:08 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:57:09 translating from clipboard or selection +Debug: 05-18 23:57:09 clipboard data: "get_input(argc, argv, goldendict_mode)" +Debug: 05-18 23:57:09 Current state: true false true true +Debug: 05-18 23:57:09 getResource: "gdlookup://localhost/?word=get_input(argc, argv, goldendict_mode)&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:09 scheme: "gdlookup" +Debug: 05-18 23:57:09 host: "localhost" +Debug: 05-18 23:57:09 clear current dictionaries: "get_input(argc, argv, goldendict_mode)" +Debug: 05-18 23:57:09 some body finished +Debug: 05-18 23:57:09 one not finished. +Debug: 05-18 23:57:09 ====reading 1441 of (1441) bytes . Finished: 0 +Debug: 05-18 23:57:09 ====reading 0 of (1441) bytes . Finished: 0 +Debug: 05-18 23:57:09 ====reading 0 of (1441) bytes . Finished: 0 +Warning: 05-18 23:57:09 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:57:32 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:32 scheme: "gdlookup" +Debug: 05-18 23:57:32 host: "localhost" +Debug: 05-18 23:57:32 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:57:32 some body finished +Debug: 05-18 23:57:32 one not finished. +Debug: 05-18 23:57:32 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:57:32 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:57:32 ====reading 0 of (1421) bytes . Finished: 0 +Warning: 05-18 23:57:32 QProcess: Destroyed while process ("/tmp/Hakurei/hakurei") is still running. +Debug: 05-18 23:57:32 some body finished +Debug: 05-18 23:57:32 one finished. +Debug: 05-18 23:57:32 erasing.. +Debug: 05-18 23:57:32 erase done.. +Debug: 05-18 23:57:32 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:32 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:57:32 ====reading 4009 of (5430) bytes . Finished: 1 +Debug: 05-18 23:57:32 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:57:32 scheme: "gico" +Debug: 05-18 23:57:32 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:32 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 23:57:39 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:39 scheme: "gdlookup" +Debug: 05-18 23:57:39 host: "localhost" +Debug: 05-18 23:57:39 clear current dictionaries: "ゆっくり" +Debug: 05-18 23:57:39 some body finished +Debug: 05-18 23:57:39 one not finished. +Debug: 05-18 23:57:39 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 23:57:39 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:57:39 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:57:39 some body finished +Debug: 05-18 23:57:39 one finished. +Debug: 05-18 23:57:39 erasing.. +Debug: 05-18 23:57:39 erase done.. +Debug: 05-18 23:57:39 send dicts(finished): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:39 ====reading 3955 of (5370) bytes . Finished: 1 +Debug: 05-18 23:57:39 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:57:39 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:57:39 scheme: "gico" +Debug: 05-18 23:57:39 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:39 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b9663" true +Debug: 05-18 23:57:39 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:39 scheme: "gdlookup" +Debug: 05-18 23:57:39 host: "localhost" +Debug: 05-18 23:57:39 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 23:57:39 some body finished +Debug: 05-18 23:57:39 one not finished. +Debug: 05-18 23:57:39 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 23:57:39 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:57:39 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:57:39 some body finished +Debug: 05-18 23:57:39 one finished. +Debug: 05-18 23:57:39 erasing.. +Debug: 05-18 23:57:39 erase done.. +Debug: 05-18 23:57:39 send dicts(finished): "groupId:1,word:転生したら剣でした,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:39 ====reading 5340 of (6770) bytes . Finished: 1 +Debug: 05-18 23:57:39 receive dicts, current word: "転生したら剣でした" "転生したら剣でした" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:57:39 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:57:39 scheme: "gico" +Debug: 05-18 23:57:39 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:39 article view loaded url: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22" true +Debug: 05-18 23:57:40 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:40 scheme: "gdlookup" +Debug: 05-18 23:57:40 host: "localhost" +Debug: 05-18 23:57:40 clear current dictionaries: "ゆっくり" +Debug: 05-18 23:57:40 some body finished +Debug: 05-18 23:57:40 one not finished. +Debug: 05-18 23:57:40 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 23:57:40 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:57:40 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:57:40 some body finished +Debug: 05-18 23:57:40 one finished. +Debug: 05-18 23:57:40 erasing.. +Debug: 05-18 23:57:40 erase done.. +Debug: 05-18 23:57:40 send dicts(finished): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:40 ====reading 3955 of (5370) bytes . Finished: 1 +Debug: 05-18 23:57:40 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:57:40 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:57:40 scheme: "gico" +Debug: 05-18 23:57:40 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:40 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b9663" true +Debug: 05-18 23:57:40 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:40 scheme: "gdlookup" +Debug: 05-18 23:57:40 host: "localhost" +Debug: 05-18 23:57:40 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:57:40 some body finished +Debug: 05-18 23:57:40 one not finished. +Debug: 05-18 23:57:40 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:57:40 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:57:40 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:57:40 some body finished +Debug: 05-18 23:57:40 one finished. +Debug: 05-18 23:57:40 erasing.. +Debug: 05-18 23:57:40 erase done.. +Debug: 05-18 23:57:40 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:40 ====reading 4009 of (5430) bytes . Finished: 1 +Debug: 05-18 23:57:40 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:57:40 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:57:40 scheme: "gico" +Debug: 05-18 23:57:40 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:40 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 23:57:41 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:41 scheme: "gdlookup" +Debug: 05-18 23:57:41 host: "localhost" +Debug: 05-18 23:57:41 clear current dictionaries: "違和感" +Debug: 05-18 23:57:41 some body finished +Debug: 05-18 23:57:41 one not finished. +Debug: 05-18 23:57:41 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 23:57:41 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:57:41 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:57:41 some body finished +Debug: 05-18 23:57:41 one finished. +Debug: 05-18 23:57:41 erasing.. +Debug: 05-18 23:57:41 erase done.. +Debug: 05-18 23:57:41 send dicts(finished): "groupId:1,word:違和感,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:41 receive dicts, current word: "違和感" "違和感" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:57:41 ====reading 2678 of (4090) bytes . Finished: 1 +Debug: 05-18 23:57:41 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:57:41 scheme: "gico" +Debug: 05-18 23:57:41 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:41 article view loaded url: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96631" true +Debug: 05-18 23:57:41 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:57:41 scheme: "gdlookup" +Debug: 05-18 23:57:41 host: "localhost" +Debug: 05-18 23:57:41 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 23:57:41 some body finished +Debug: 05-18 23:57:41 one not finished. +Debug: 05-18 23:57:41 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 23:57:41 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:57:41 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:57:41 some body finished +Debug: 05-18 23:57:41 one finished. +Debug: 05-18 23:57:41 erasing.. +Debug: 05-18 23:57:41 erase done.. +Debug: 05-18 23:57:41 send dicts(finished): "groupId:1,word:転生したら剣でした,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:41 ====reading 5340 of (6770) bytes . Finished: 1 +Debug: 05-18 23:57:41 receive dicts, current word: "転生したら剣でした" "転生したら剣でした" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:57:41 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:57:41 scheme: "gico" +Debug: 05-18 23:57:41 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:57:41 article view loaded url: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22" true +Debug: 05-18 23:58:01 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:01 scheme: "gdlookup" +Debug: 05-18 23:58:01 host: "localhost" +Debug: 05-18 23:58:01 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:58:01 some body finished +Debug: 05-18 23:58:01 one not finished. +Debug: 05-18 23:58:01 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:01 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:01 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:01 some body finished +Debug: 05-18 23:58:01 one finished. +Debug: 05-18 23:58:01 erasing.. +Debug: 05-18 23:58:01 erase done.. +Debug: 05-18 23:58:01 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:01 ====reading 4009 of (5430) bytes . Finished: 1 +Debug: 05-18 23:58:01 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:01 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:01 scheme: "gico" +Debug: 05-18 23:58:01 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:01 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 23:58:01 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:01 scheme: "gdlookup" +Debug: 05-18 23:58:01 host: "localhost" +Debug: 05-18 23:58:01 clear current dictionaries: "違和感" +Debug: 05-18 23:58:01 some body finished +Debug: 05-18 23:58:01 one not finished. +Debug: 05-18 23:58:01 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:01 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:01 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:01 some body finished +Debug: 05-18 23:58:01 one finished. +Debug: 05-18 23:58:01 erasing.. +Debug: 05-18 23:58:01 erase done.. +Debug: 05-18 23:58:01 send dicts(finished): "groupId:1,word:違和感,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:01 receive dicts, current word: "違和感" "違和感" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:01 ====reading 2678 of (4090) bytes . Finished: 1 +Debug: 05-18 23:58:01 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:01 scheme: "gico" +Debug: 05-18 23:58:01 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:01 article view loaded url: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96631" true +Debug: 05-18 23:58:02 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:02 scheme: "gdlookup" +Debug: 05-18 23:58:02 host: "localhost" +Debug: 05-18 23:58:02 clear current dictionaries: "議" +Debug: 05-18 23:58:02 some body finished +Debug: 05-18 23:58:02 one not finished. +Debug: 05-18 23:58:02 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:02 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:02 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:02 some body finished +Debug: 05-18 23:58:02 one finished. +Debug: 05-18 23:58:02 erasing.. +Debug: 05-18 23:58:02 erase done.. +Debug: 05-18 23:58:02 send dicts(finished): "groupId:1,word:議,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:02 receive dicts, current word: "議" "議" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:02 ====reading 1329 of (2735) bytes . Finished: 1 +Debug: 05-18 23:58:02 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:02 scheme: "gico" +Debug: 05-18 23:58:02 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:02 article view loaded url: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a" true +Debug: 05-18 23:58:02 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:02 scheme: "gdlookup" +Debug: 05-18 23:58:02 host: "localhost" +Debug: 05-18 23:58:02 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:58:02 some body finished +Debug: 05-18 23:58:02 one not finished. +Debug: 05-18 23:58:02 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:02 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:02 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:02 some body finished +Debug: 05-18 23:58:02 one finished. +Debug: 05-18 23:58:02 erasing.. +Debug: 05-18 23:58:02 erase done.. +Debug: 05-18 23:58:02 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:02 ====reading 4009 of (5430) bytes . Finished: 1 +Debug: 05-18 23:58:02 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:02 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:02 scheme: "gico" +Debug: 05-18 23:58:02 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:02 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 23:58:02 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:02 scheme: "gdlookup" +Debug: 05-18 23:58:02 host: "localhost" +Debug: 05-18 23:58:02 clear current dictionaries: "ゆっくり" +Debug: 05-18 23:58:02 some body finished +Debug: 05-18 23:58:02 one not finished. +Debug: 05-18 23:58:02 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:02 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:02 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:02 some body finished +Debug: 05-18 23:58:02 one finished. +Debug: 05-18 23:58:02 erasing.. +Debug: 05-18 23:58:02 erase done.. +Debug: 05-18 23:58:02 send dicts(finished): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:02 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:02 ====reading 3955 of (5370) bytes . Finished: 1 +Debug: 05-18 23:58:02 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:02 scheme: "gico" +Debug: 05-18 23:58:02 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:02 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b9663" true +Debug: 05-18 23:58:03 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:03 scheme: "gdlookup" +Debug: 05-18 23:58:03 host: "localhost" +Debug: 05-18 23:58:03 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 23:58:03 some body finished +Debug: 05-18 23:58:03 one not finished. +Debug: 05-18 23:58:03 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 23:58:03 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:58:03 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:58:03 some body finished +Debug: 05-18 23:58:03 one finished. +Debug: 05-18 23:58:03 erasing.. +Debug: 05-18 23:58:03 erase done.. +Debug: 05-18 23:58:03 send dicts(finished): "groupId:1,word:転生したら剣でした,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:03 ====reading 5340 of (6770) bytes . Finished: 1 +Debug: 05-18 23:58:03 receive dicts, current word: "転生したら剣でした" "転生したら剣でした" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:03 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:03 scheme: "gico" +Debug: 05-18 23:58:03 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:03 article view loaded url: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22" true +Debug: 05-18 23:58:03 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:03 scheme: "gdlookup" +Debug: 05-18 23:58:03 host: "localhost" +Debug: 05-18 23:58:03 clear current dictionaries: "議" +Debug: 05-18 23:58:03 some body finished +Debug: 05-18 23:58:03 one not finished. +Debug: 05-18 23:58:03 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:03 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:03 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:03 some body finished +Debug: 05-18 23:58:03 one finished. +Debug: 05-18 23:58:03 erasing.. +Debug: 05-18 23:58:03 erase done.. +Debug: 05-18 23:58:03 send dicts(finished): "groupId:1,word:議,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:03 receive dicts, current word: "議" "議" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:03 ====reading 1329 of (2735) bytes . Finished: 1 +Debug: 05-18 23:58:03 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:03 scheme: "gico" +Debug: 05-18 23:58:03 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:03 article view loaded url: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a" true +Debug: 05-18 23:58:04 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:04 scheme: "gdlookup" +Debug: 05-18 23:58:04 host: "localhost" +Debug: 05-18 23:58:04 clear current dictionaries: "納得が行く" +Debug: 05-18 23:58:04 some body finished +Debug: 05-18 23:58:04 one not finished. +Debug: 05-18 23:58:04 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 23:58:04 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 23:58:04 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 23:58:04 some body finished +Debug: 05-18 23:58:04 one finished. +Debug: 05-18 23:58:04 erasing.. +Debug: 05-18 23:58:04 erase done.. +Debug: 05-18 23:58:04 send dicts(finished): "groupId:1,word:納得が行く,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:04 receive dicts, current word: "納得が行く" "納得が行く" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:04 ====reading 3991 of (5409) bytes . Finished: 1 +Debug: 05-18 23:58:04 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:04 scheme: "gico" +Debug: 05-18 23:58:04 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:04 article view loaded url: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966" true +Debug: 05-18 23:58:04 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:04 scheme: "gdlookup" +Debug: 05-18 23:58:04 host: "localhost" +Debug: 05-18 23:58:04 clear current dictionaries: "ゆっくり" +Debug: 05-18 23:58:04 some body finished +Debug: 05-18 23:58:04 one not finished. +Debug: 05-18 23:58:04 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:04 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:04 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:04 some body finished +Debug: 05-18 23:58:04 one finished. +Debug: 05-18 23:58:04 erasing.. +Debug: 05-18 23:58:04 erase done.. +Debug: 05-18 23:58:04 send dicts(finished): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:04 ====reading 3955 of (5370) bytes . Finished: 1 +Debug: 05-18 23:58:04 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:04 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:04 scheme: "gico" +Debug: 05-18 23:58:04 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:04 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b9663" true +Debug: 05-18 23:58:05 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:05 scheme: "gdlookup" +Debug: 05-18 23:58:05 host: "localhost" +Debug: 05-18 23:58:05 clear current dictionaries: "違和感" +Debug: 05-18 23:58:05 some body finished +Debug: 05-18 23:58:05 one not finished. +Debug: 05-18 23:58:05 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:05 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:05 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:05 some body finished +Debug: 05-18 23:58:05 one finished. +Debug: 05-18 23:58:05 erasing.. +Debug: 05-18 23:58:05 erase done.. +Debug: 05-18 23:58:05 send dicts(finished): "groupId:1,word:違和感,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:05 ====reading 2678 of (4090) bytes . Finished: 1 +Debug: 05-18 23:58:05 receive dicts, current word: "違和感" "違和感" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:05 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:05 scheme: "gico" +Debug: 05-18 23:58:05 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:05 article view loaded url: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96631" true +Debug: 05-18 23:58:05 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:05 scheme: "gdlookup" +Debug: 05-18 23:58:05 host: "localhost" +Debug: 05-18 23:58:05 clear current dictionaries: "転生したら剣でした" +Debug: 05-18 23:58:05 some body finished +Debug: 05-18 23:58:05 one not finished. +Debug: 05-18 23:58:05 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-18 23:58:05 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:58:05 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-18 23:58:05 some body finished +Debug: 05-18 23:58:05 one finished. +Debug: 05-18 23:58:05 erasing.. +Debug: 05-18 23:58:05 erase done.. +Debug: 05-18 23:58:05 send dicts(finished): "groupId:1,word:転生したら剣でした,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:05 ====reading 5340 of (6770) bytes . Finished: 1 +Debug: 05-18 23:58:05 receive dicts, current word: "転生したら剣でした" "転生したら剣でした" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:05 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:05 scheme: "gico" +Debug: 05-18 23:58:05 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:05 article view loaded url: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22" true +Debug: 05-18 23:58:05 getResource: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:05 scheme: "gdlookup" +Debug: 05-18 23:58:05 host: "localhost" +Debug: 05-18 23:58:05 clear current dictionaries: "違和感" +Debug: 05-18 23:58:05 some body finished +Debug: 05-18 23:58:05 one not finished. +Debug: 05-18 23:58:05 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:05 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:05 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-18 23:58:05 some body finished +Debug: 05-18 23:58:05 one finished. +Debug: 05-18 23:58:05 erasing.. +Debug: 05-18 23:58:05 erase done.. +Debug: 05-18 23:58:05 send dicts(finished): "groupId:1,word:違和感,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:05 ====reading 2678 of (4090) bytes . Finished: 1 +Debug: 05-18 23:58:05 receive dicts, current word: "違和感" "違和感" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:05 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:05 scheme: "gico" +Debug: 05-18 23:58:05 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:05 article view loaded url: "gdlookup://localhost/?word=違和感&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96631" true +Debug: 05-18 23:58:17 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:17 scheme: "gdlookup" +Debug: 05-18 23:58:17 host: "localhost" +Debug: 05-18 23:58:17 clear current dictionaries: "ゆっくり" +Debug: 05-18 23:58:17 some body finished +Debug: 05-18 23:58:17 one not finished. +Debug: 05-18 23:58:17 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:17 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:17 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:17 some body finished +Debug: 05-18 23:58:17 one finished. +Debug: 05-18 23:58:17 erasing.. +Debug: 05-18 23:58:17 erase done.. +Debug: 05-18 23:58:17 send dicts(finished): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:17 ====reading 3955 of (5370) bytes . Finished: 1 +Debug: 05-18 23:58:17 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:17 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:17 scheme: "gico" +Debug: 05-18 23:58:17 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:17 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b9663" true +Debug: 05-18 23:58:17 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:17 scheme: "gdlookup" +Debug: 05-18 23:58:17 host: "localhost" +Debug: 05-18 23:58:17 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:58:17 some body finished +Debug: 05-18 23:58:17 one not finished. +Debug: 05-18 23:58:17 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:17 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:17 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:58:18 some body finished +Debug: 05-18 23:58:18 one finished. +Debug: 05-18 23:58:18 erasing.. +Debug: 05-18 23:58:18 erase done.. +Debug: 05-18 23:58:18 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 ====reading 4009 of (5430) bytes . Finished: 1 +Debug: 05-18 23:58:18 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:18 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:18 scheme: "gico" +Debug: 05-18 23:58:18 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 23:58:18 getResource: "gdlookup://localhost/?word=意識&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:18 scheme: "gdlookup" +Debug: 05-18 23:58:18 host: "localhost" +Debug: 05-18 23:58:18 clear current dictionaries: "意識" +Debug: 05-18 23:58:18 some body finished +Debug: 05-18 23:58:18 one not finished. +Debug: 05-18 23:58:18 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 23:58:18 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 23:58:18 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 23:58:18 some body finished +Debug: 05-18 23:58:18 one finished. +Debug: 05-18 23:58:18 erasing.. +Debug: 05-18 23:58:18 erase done.. +Debug: 05-18 23:58:18 send dicts(finished): "groupId:1,word:意識,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 ====reading 2600 of (4009) bytes . Finished: 1 +Debug: 05-18 23:58:18 receive dicts, current word: "意識" "意識" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:18 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:18 scheme: "gico" +Debug: 05-18 23:58:18 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 article view loaded url: "gdlookup://localhost/?word=意識&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313" true +Debug: 05-18 23:58:18 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:18 scheme: "gdlookup" +Debug: 05-18 23:58:18 host: "localhost" +Debug: 05-18 23:58:18 clear current dictionaries: "議" +Debug: 05-18 23:58:18 some body finished +Debug: 05-18 23:58:18 one not finished. +Debug: 05-18 23:58:18 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:18 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:18 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:58:18 some body finished +Debug: 05-18 23:58:18 one finished. +Debug: 05-18 23:58:18 erasing.. +Debug: 05-18 23:58:18 erase done.. +Debug: 05-18 23:58:18 send dicts(finished): "groupId:1,word:議,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 receive dicts, current word: "議" "議" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:18 ====reading 1329 of (2735) bytes . Finished: 1 +Debug: 05-18 23:58:18 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:18 scheme: "gico" +Debug: 05-18 23:58:18 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 article view loaded url: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a" true +Debug: 05-18 23:58:18 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:58:18 scheme: "gdlookup" +Debug: 05-18 23:58:18 host: "localhost" +Debug: 05-18 23:58:18 clear current dictionaries: "ゆっくり" +Debug: 05-18 23:58:18 some body finished +Debug: 05-18 23:58:18 one not finished. +Debug: 05-18 23:58:18 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:18 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:18 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-18 23:58:18 some body finished +Debug: 05-18 23:58:18 one finished. +Debug: 05-18 23:58:18 erasing.. +Debug: 05-18 23:58:18 erase done.. +Debug: 05-18 23:58:18 send dicts(finished): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:58:18 ====reading 3955 of (5370) bytes . Finished: 1 +Debug: 05-18 23:58:18 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:58:18 scheme: "gico" +Debug: 05-18 23:58:18 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:58:18 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b9663" true +Debug: 05-18 23:59:24 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:59:24 scheme: "gdlookup" +Debug: 05-18 23:59:24 host: "localhost" +Debug: 05-18 23:59:24 clear current dictionaries: "地獄の苦しみ" +Debug: 05-18 23:59:24 some body finished +Debug: 05-18 23:59:24 one not finished. +Debug: 05-18 23:59:24 ====reading 1421 of (1421) bytes . Finished: 0 +Debug: 05-18 23:59:24 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:59:24 ====reading 0 of (1421) bytes . Finished: 0 +Debug: 05-18 23:59:24 some body finished +Debug: 05-18 23:59:24 one finished. +Debug: 05-18 23:59:24 erasing.. +Debug: 05-18 23:59:24 erase done.. +Debug: 05-18 23:59:24 send dicts(finished): "groupId:1,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:24 ====reading 1292 of (2713) bytes . Finished: 1 +Debug: 05-18 23:59:24 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:59:24 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:59:24 scheme: "gico" +Debug: 05-18 23:59:24 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:24 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b96" true +Debug: 05-18 23:59:25 getResource: "gdlookup://localhost/?word=意識&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:59:25 scheme: "gdlookup" +Debug: 05-18 23:59:25 host: "localhost" +Debug: 05-18 23:59:25 clear current dictionaries: "意識" +Debug: 05-18 23:59:25 some body finished +Debug: 05-18 23:59:25 one not finished. +Debug: 05-18 23:59:25 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-18 23:59:25 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 23:59:25 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-18 23:59:25 some body finished +Debug: 05-18 23:59:25 one finished. +Debug: 05-18 23:59:25 erasing.. +Debug: 05-18 23:59:25 erase done.. +Debug: 05-18 23:59:25 send dicts(finished): "groupId:1,word:意識,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:25 receive dicts, current word: "意識" "意識" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:59:25 ====reading 1292 of (2701) bytes . Finished: 1 +Debug: 05-18 23:59:25 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:59:25 scheme: "gico" +Debug: 05-18 23:59:25 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:25 article view loaded url: "gdlookup://localhost/?word=意識&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313" true +Debug: 05-18 23:59:25 getResource: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:59:25 scheme: "gdlookup" +Debug: 05-18 23:59:25 host: "localhost" +Debug: 05-18 23:59:25 clear current dictionaries: "議" +Debug: 05-18 23:59:25 some body finished +Debug: 05-18 23:59:25 one not finished. +Debug: 05-18 23:59:25 ====reading 1406 of (1406) bytes . Finished: 0 +Debug: 05-18 23:59:25 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:59:25 ====reading 0 of (1406) bytes . Finished: 0 +Debug: 05-18 23:59:25 some body finished +Debug: 05-18 23:59:25 one finished. +Debug: 05-18 23:59:25 erasing.. +Debug: 05-18 23:59:25 erase done.. +Debug: 05-18 23:59:25 send dicts(finished): "groupId:1,word:議,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:25 receive dicts, current word: "議" "議" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:59:25 ====reading 1292 of (2698) bytes . Finished: 1 +Debug: 05-18 23:59:25 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:59:25 scheme: "gico" +Debug: 05-18 23:59:25 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:25 article view loaded url: "gdlookup://localhost/?word=議&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a" true +Debug: 05-18 23:59:44 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-18 23:59:44 scheme: "gdlookup" +Debug: 05-18 23:59:44 host: "localhost" +Debug: 05-18 23:59:44 clear current dictionaries: "納得が行く" +Debug: 05-18 23:59:44 some body finished +Debug: 05-18 23:59:44 one not finished. +Debug: 05-18 23:59:44 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-18 23:59:44 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 23:59:44 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-18 23:59:44 some body finished +Debug: 05-18 23:59:44 one finished. +Debug: 05-18 23:59:44 erasing.. +Debug: 05-18 23:59:44 erase done.. +Debug: 05-18 23:59:44 send dicts(finished): "groupId:1,word:納得が行く,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:44 ====reading 3991 of (5409) bytes . Finished: 1 +Debug: 05-18 23:59:44 receive dicts, current word: "納得が行く" "納得が行く" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-18 23:59:44 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-18 23:59:44 scheme: "gico" +Debug: 05-18 23:59:44 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-18 23:59:44 article view loaded url: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966" true +Debug: 05-19 00:00:00 translating from clipboard or selection +Debug: 05-19 00:00:00 clipboard data: "" +Debug: 05-19 00:00:16 open link url: QUrl("bword:が行") +Debug: 05-19 00:00:16 getResource: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:16 scheme: "gdlookup" +Debug: 05-19 00:00:16 host: "localhost" +Debug: 05-19 00:00:16 clear current dictionaries: "が行" +Debug: 05-19 00:00:16 some body finished +Debug: 05-19 00:00:16 one not finished. +Debug: 05-19 00:00:16 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:16 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:16 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:16 some body finished +Debug: 05-19 00:00:16 one finished. +Debug: 05-19 00:00:16 erasing.. +Debug: 05-19 00:00:16 erase done.. +Debug: 05-19 00:00:16 send dicts(finished): "groupId:1,word:が行,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:16 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:16 receive dicts, current word: "が行" "が行" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:00:16 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:16 scheme: "gico" +Debug: 05-19 00:00:16 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:16 article view loaded url: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:17 open link url: QUrl("bword:が行") +Debug: 05-19 00:00:17 getResource: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:17 scheme: "gdlookup" +Debug: 05-19 00:00:17 host: "localhost" +Debug: 05-19 00:00:17 clear current dictionaries: "が行" +Debug: 05-19 00:00:17 some body finished +Debug: 05-19 00:00:17 one not finished. +Debug: 05-19 00:00:17 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:17 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:17 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:17 some body finished +Debug: 05-19 00:00:17 one finished. +Debug: 05-19 00:00:17 erasing.. +Debug: 05-19 00:00:17 erase done.. +Debug: 05-19 00:00:17 send dicts(finished): "groupId:1,word:が行,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:17 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:17 receive dicts, current word: "が行" "が行" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:00:17 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:17 scheme: "gico" +Debug: 05-19 00:00:17 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:17 article view loaded url: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Info: 05-19 00:00:20 libpng warning: iCCP: known incorrect sRGB profile +Debug: 05-19 00:00:20 getResource: "gdlookup://localhost/?word=が行&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:20 scheme: "gdlookup" +Debug: 05-19 00:00:20 host: "localhost" +Debug: 05-19 00:00:20 clear current dictionaries: "が行" +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 ====reading 1472 of (1472) bytes . Finished: 0 +Debug: 05-19 00:00:20 ====reading 0 of (1472) bytes . Finished: 0 +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 ====reading 0 of (1472) bytes . Finished: 0 +Debug: 05-19 00:00:20 open link url: QUrl("bword:納得") +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:20 scheme: "gdlookup" +Debug: 05-19 00:00:20 host: "localhost" +Debug: 05-19 00:00:20 some body finished +Debug: 05-19 00:00:20 one not finished. +Debug: 05-19 00:00:20 ====reading 1409 of (1409) bytes . Finished: 0 +Warning: 05-19 00:00:20 QProcess: Destroyed while process ("gd-tools") is still running. +Debug: 05-19 00:00:20 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:21 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:21 some body finished +Debug: 05-19 00:00:21 one finished. +Debug: 05-19 00:00:21 erasing.. +Debug: 05-19 00:00:21 erase done.. +Debug: 05-19 00:00:21 send dicts(finished): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:21 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:21 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:21 scheme: "gico" +Debug: 05-19 00:00:21 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:21 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:22 open link url: QUrl("bword:が行") +Debug: 05-19 00:00:22 getResource: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:22 scheme: "gdlookup" +Debug: 05-19 00:00:22 host: "localhost" +Debug: 05-19 00:00:22 some body finished +Debug: 05-19 00:00:22 one not finished. +Debug: 05-19 00:00:22 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:22 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:22 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:22 some body finished +Debug: 05-19 00:00:22 one finished. +Debug: 05-19 00:00:22 erasing.. +Debug: 05-19 00:00:22 erase done.. +Debug: 05-19 00:00:22 send dicts(finished): "groupId:1,word:が行,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:22 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:22 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:22 scheme: "gico" +Debug: 05-19 00:00:22 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:22 article view loaded url: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:24 open link url: QUrl("bword:納得") +Debug: 05-19 00:00:24 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:24 scheme: "gdlookup" +Debug: 05-19 00:00:24 host: "localhost" +Debug: 05-19 00:00:24 some body finished +Debug: 05-19 00:00:24 one not finished. +Debug: 05-19 00:00:24 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:24 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:24 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:24 some body finished +Debug: 05-19 00:00:24 one finished. +Debug: 05-19 00:00:24 erasing.. +Debug: 05-19 00:00:24 erase done.. +Debug: 05-19 00:00:24 send dicts(finished): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:24 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:24 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:24 scheme: "gico" +Debug: 05-19 00:00:24 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:25 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:34 open link url: QUrl("bword:納得") +Debug: 05-19 00:00:34 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:34 scheme: "gdlookup" +Debug: 05-19 00:00:34 host: "localhost" +Debug: 05-19 00:00:34 some body finished +Debug: 05-19 00:00:34 one not finished. +Debug: 05-19 00:00:34 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:34 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:34 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:34 some body finished +Debug: 05-19 00:00:34 one finished. +Debug: 05-19 00:00:34 erasing.. +Debug: 05-19 00:00:34 erase done.. +Debug: 05-19 00:00:34 send dicts(finished): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:34 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:34 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:34 scheme: "gico" +Debug: 05-19 00:00:34 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:34 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:35 open link url: QUrl("bword:納得") +Debug: 05-19 00:00:35 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:35 scheme: "gdlookup" +Debug: 05-19 00:00:35 host: "localhost" +Debug: 05-19 00:00:35 some body finished +Debug: 05-19 00:00:35 one not finished. +Debug: 05-19 00:00:35 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:35 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:35 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:35 some body finished +Debug: 05-19 00:00:35 one finished. +Debug: 05-19 00:00:35 erasing.. +Debug: 05-19 00:00:35 erase done.. +Debug: 05-19 00:00:35 send dicts(finished): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:35 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:35 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:35 scheme: "gico" +Debug: 05-19 00:00:35 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:35 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:36 open link url: QUrl("bword:納得が行く") +Debug: 05-19 00:00:36 getResource: "gdlookup://localhost/?word=納得が行く&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:36 scheme: "gdlookup" +Debug: 05-19 00:00:36 host: "localhost" +Debug: 05-19 00:00:36 some body finished +Debug: 05-19 00:00:36 one not finished. +Debug: 05-19 00:00:36 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-19 00:00:36 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:00:36 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:00:36 some body finished +Debug: 05-19 00:00:36 one finished. +Debug: 05-19 00:00:36 erasing.. +Debug: 05-19 00:00:36 erase done.. +Debug: 05-19 00:00:36 send dicts(finished): "groupId:1,word:納得が行く,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:36 ====reading 3991 of (5409) bytes . Finished: 1 +Debug: 05-19 00:00:36 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:36 scheme: "gico" +Debug: 05-19 00:00:36 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:36 article view loaded url: "gdlookup://localhost/?word=納得が行く&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f" true +Debug: 05-19 00:00:37 open link url: QUrl("bword:納得") +Debug: 05-19 00:00:37 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:37 scheme: "gdlookup" +Debug: 05-19 00:00:37 host: "localhost" +Debug: 05-19 00:00:37 some body finished +Debug: 05-19 00:00:37 one not finished. +Debug: 05-19 00:00:37 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:37 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:37 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:37 some body finished +Debug: 05-19 00:00:37 one finished. +Debug: 05-19 00:00:37 erasing.. +Debug: 05-19 00:00:37 erase done.. +Debug: 05-19 00:00:37 send dicts(finished): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:37 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:37 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:37 scheme: "gico" +Debug: 05-19 00:00:37 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:37 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:37 open link url: QUrl("bword:納得が行く") +Debug: 05-19 00:00:37 getResource: "gdlookup://localhost/?word=納得が行く&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:37 scheme: "gdlookup" +Debug: 05-19 00:00:37 host: "localhost" +Debug: 05-19 00:00:37 some body finished +Debug: 05-19 00:00:37 one not finished. +Debug: 05-19 00:00:37 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-19 00:00:37 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:00:37 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:00:37 some body finished +Debug: 05-19 00:00:37 one finished. +Debug: 05-19 00:00:37 erasing.. +Debug: 05-19 00:00:37 erase done.. +Debug: 05-19 00:00:37 send dicts(finished): "groupId:1,word:納得が行く,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:37 ====reading 3991 of (5409) bytes . Finished: 1 +Debug: 05-19 00:00:37 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:37 scheme: "gico" +Debug: 05-19 00:00:37 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:37 article view loaded url: "gdlookup://localhost/?word=納得が行く&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f" true +Debug: 05-19 00:00:38 open link url: QUrl("bword:納得") +Debug: 05-19 00:00:38 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:00:38 scheme: "gdlookup" +Debug: 05-19 00:00:38 host: "localhost" +Debug: 05-19 00:00:38 some body finished +Debug: 05-19 00:00:38 one not finished. +Debug: 05-19 00:00:38 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:38 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:38 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:00:38 some body finished +Debug: 05-19 00:00:38 one finished. +Debug: 05-19 00:00:38 erasing.. +Debug: 05-19 00:00:38 erase done.. +Debug: 05-19 00:00:38 send dicts(finished): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:38 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:00:38 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:38 scheme: "gico" +Debug: 05-19 00:00:38 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:38 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422" true +Debug: 05-19 00:00:39 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:39 scheme: "gdlookup" +Debug: 05-19 00:00:39 host: "localhost" +Debug: 05-19 00:00:39 clear current dictionaries: "地獄の苦しみ" +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 ====reading 1484 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 some body finished +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one finished. +Debug: 05-19 00:00:39 erasing.. +Debug: 05-19 00:00:39 erase done.. +Debug: 05-19 00:00:39 one not finished. +Debug: 05-19 00:00:39 send dicts(updated): "groupId:3,word:地獄の苦しみ,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:39 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-19 00:00:39 ====reading 3094 of (4578) bytes . Finished: 0 +Debug: 05-19 00:00:39 ====reading 0 of (4578) bytes . Finished: 0 +Debug: 05-19 00:00:39 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-19 00:00:39 scheme: "gico" +Debug: 05-19 00:00:39 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 send dicts(finished): "groupId:3,word:地獄の苦しみ,dictId:77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:40 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("77635cf22dadc58222f44f3c4f281c1f") +Debug: 05-19 00:00:40 ====reading 2312 of (6890) bytes . Finished: 1 +Debug: 05-19 00:00:40 getResource: "bres://77635cf22dadc58222f44f3c4f281c1f/thesaurus.css" +Debug: 05-19 00:00:40 scheme: "bres" +Debug: 05-19 00:00:40 host: "77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:40 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-19 00:00:40 scheme: "gico" +Debug: 05-19 00:00:40 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:40 getResource: "gico://77635cf22dadc58222f44f3c4f281c1f/dicticon.png" +Debug: 05-19 00:00:40 scheme: "gico" +Debug: 05-19 00:00:40 host: "77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:40 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" true +Debug: 05-19 00:00:40 getResource: "gdlookup://localhost/?word=議&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:40 scheme: "gdlookup" +Debug: 05-19 00:00:40 host: "localhost" +Debug: 05-19 00:00:40 clear current dictionaries: "議" +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 ====reading 1469 of (1469) bytes . Finished: 0 +Debug: 05-19 00:00:40 ====reading 0 of (1469) bytes . Finished: 0 +Debug: 05-19 00:00:40 offset = 28ad5d + +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 ====reading 0 of (1469) bytes . Finished: 0 +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one finished. +Debug: 05-19 00:00:40 erasing.. +Debug: 05-19 00:00:40 erase done.. +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 send dicts(updated): "groupId:3,word:議,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:40 ====reading 2391 of (3860) bytes . Finished: 0 +Debug: 05-19 00:00:40 receive dicts, current word: "議" "議" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-19 00:00:40 ====reading 0 of (3860) bytes . Finished: 0 +Debug: 05-19 00:00:40 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-19 00:00:40 scheme: "gico" +Debug: 05-19 00:00:40 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:40 some body finished +Debug: 05-19 00:00:40 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 getResource: "gdlookup://localhost/?word=ゆっくり&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:41 scheme: "gdlookup" +Debug: 05-19 00:00:41 host: "localhost" +Debug: 05-19 00:00:41 clear current dictionaries: "ゆっくり" +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 ====reading 1478 of (1478) bytes . Finished: 0 +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 ====reading 0 of (1478) bytes . Finished: 0 +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 ====reading 0 of (1478) bytes . Finished: 0 +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:41 offset = d64a00 + +Debug: 05-19 00:00:41 some body finished +Debug: 05-19 00:00:41 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 send dicts(updated): "groupId:3,word:ゆっくり,dictId:00824c93f503c5d1680483abdf367948,c63783324ee9b8fc3309849bd8302845,7363ba2e34cddead0f19a4a2ec51304e,968c3a374ef50d74e019560ae8f69488,646c2fbd2278d23caf8bc5b44599f5aa,41e48e169f3b09f5d08c9821aa0e88af,133436b45f37007263000dd395a5cb19,f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 ====reading 28068 of (29546) bytes . Finished: 0 +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 ====reading 0 of (29546) bytes . Finished: 0 +Debug: 05-19 00:00:42 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:42 scheme: "gdlookup" +Debug: 05-19 00:00:42 host: "localhost" +Debug: 05-19 00:00:42 clear current dictionaries: "地獄の苦しみ" +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 ====reading 1484 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:42 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 getResource: "bres://c63783324ee9b8fc3309849bd8302845/REIKOKU.css" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "c63783324ee9b8fc3309849bd8302845" +Debug: 05-19 00:00:42 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 send dicts(updated): "groupId:3,word:地獄の苦しみ,dictId:00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:42 ====reading 3094 of (4578) bytes . Finished: 0 +Debug: 05-19 00:00:42 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("00824c93f503c5d1680483abdf367948") +Debug: 05-19 00:00:42 ====reading 0 of (4578) bytes . Finished: 0 +Debug: 05-19 00:00:42 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/kojien.css" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:42 getResource: "gico://c63783324ee9b8fc3309849bd8302845/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "c63783324ee9b8fc3309849bd8302845" +Debug: 05-19 00:00:42 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/kojien.js" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:42 getResource: "bres://968c3a374ef50d74e019560ae8f69488/NHK日本語発音アクセント辞書.css" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:00:42 getResource: "bres://646c2fbd2278d23caf8bc5b44599f5aa/smk8.css" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "646c2fbd2278d23caf8bc5b44599f5aa" +Debug: 05-19 00:00:42 getResource: "bres://646c2fbd2278d23caf8bc5b44599f5aa/Audio.png" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "646c2fbd2278d23caf8bc5b44599f5aa" +Debug: 05-19 00:00:42 getResource: "bres://41e48e169f3b09f5d08c9821aa0e88af/daijirin2.css" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "41e48e169f3b09f5d08c9821aa0e88af" +Debug: 05-19 00:00:42 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/nikkoku.css" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:42 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E02D.gif" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:42 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E030.gif" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:42 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E031.gif" +Debug: 05-19 00:00:42 scheme: "bres" +Debug: 05-19 00:00:42 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:42 getResource: "gico://7363ba2e34cddead0f19a4a2ec51304e/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:42 getResource: "gico://968c3a374ef50d74e019560ae8f69488/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:00:42 getResource: "gico://646c2fbd2278d23caf8bc5b44599f5aa/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "646c2fbd2278d23caf8bc5b44599f5aa" +Debug: 05-19 00:00:42 getResource: "gico://41e48e169f3b09f5d08c9821aa0e88af/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "41e48e169f3b09f5d08c9821aa0e88af" +Debug: 05-19 00:00:42 getResource: "gico://133436b45f37007263000dd395a5cb19/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "133436b45f37007263000dd395a5cb19" +Debug: 05-19 00:00:42 getResource: "gico://f2f3fca4482e832d2b39e39931f1861e/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 send dicts(finished): "groupId:3,word:ゆっくり,dictId:f60affb79583cb692ba2bca6df57444d,71ac9bc6d781652a85341bcf5a7fd63c,c3bba9ed1957c4d6553f24a97adf0202,f26420c7eb1d59c1076d59ccf790a337,8431bdd6831e3f351ad8799dc6d42d73,d0e35c7d8c2b432d0a57cdf7941f912a,fd22dd8651fc9f5383ca576b5ed6a3cf,304a839a02ce8080037171de2de2d336,38386df88d70b0c53b53e9b70967bf8e,0c31f468bbb31b720212d9a43bb8e0e6,fb4e6f53358b387157bec73b6cbe4c8c,76920f4e8caf20bf370acb7fea5fc232,77635cf22dadc58222f44f3c4f281c1f,f6038dc4737356a34acc5a0c8a194f4a,8dda33ca157805525b1038e6fef3b56c,c05cc9bea6ab9ca5a7e4fd9bd485c294,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 send dicts(finished): "groupId:3,word:地獄の苦しみ,dictId:77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:42 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("77635cf22dadc58222f44f3c4f281c1f") +Debug: 05-19 00:00:42 ====reading 2312 of (6890) bytes . Finished: 1 +Debug: 05-19 00:00:42 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:42 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:42 scheme: "gdlookup" +Debug: 05-19 00:00:42 host: "localhost" +Debug: 05-19 00:00:42 clear current dictionaries: "地獄の苦しみ" +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 ====reading 1484 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:42 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 ====reading 0 of (1484) bytes . Finished: 0 +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one not finished. +Debug: 05-19 00:00:42 some body finished +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 one finished. +Debug: 05-19 00:00:42 erasing.. +Debug: 05-19 00:00:42 erase done.. +Debug: 05-19 00:00:42 send dicts(finished): "groupId:3,word:地獄の苦しみ,dictId:00824c93f503c5d1680483abdf367948,77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:42 ====reading 5406 of (6890) bytes . Finished: 1 +Debug: 05-19 00:00:42 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("00824c93f503c5d1680483abdf367948", "77635cf22dadc58222f44f3c4f281c1f") +Debug: 05-19 00:00:42 getResource: "gico://00824c93f503c5d1680483abdf367948/dicticon.png" +Debug: 05-19 00:00:42 scheme: "gico" +Debug: 05-19 00:00:42 host: "00824c93f503c5d1680483abdf367948" +Debug: 05-19 00:00:43 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" true +Debug: 05-19 00:00:46 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:46 scheme: "gdlookup" +Debug: 05-19 00:00:46 host: "localhost" +Debug: 05-19 00:00:46 clear current dictionaries: "地獄の苦しみ" +Debug: 05-19 00:00:46 some body finished +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 one finished. +Debug: 05-19 00:00:46 erasing.. +Debug: 05-19 00:00:46 erase done.. +Debug: 05-19 00:00:46 send dicts(finished): "groupId:3,word:地獄の苦しみ,dictId:77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:46 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("77635cf22dadc58222f44f3c4f281c1f") +Debug: 05-19 00:00:46 In-place finish. + +Debug: 05-19 00:00:46 ====reading 3729 of (3729) bytes . Finished: 1 +Debug: 05-19 00:00:46 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,9dfe38c28e4eb0d417245e761da52517" true +Debug: 05-19 00:00:49 getResource: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" +Debug: 05-19 00:00:49 scheme: "gdlookup" +Debug: 05-19 00:00:49 host: "localhost" +Debug: 05-19 00:00:49 clear current dictionaries: "地獄の苦しみ" +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 send dicts(updated): "groupId:3,word:地獄の苦しみ,dictId:77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:49 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("77635cf22dadc58222f44f3c4f281c1f") +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 ====reading 3672 of (3672) bytes . Finished: 0 +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 ====reading 0 of (3672) bytes . Finished: 0 +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one not finished. +Debug: 05-19 00:00:49 ====reading 0 of (3672) bytes . Finished: 0 +Debug: 05-19 00:00:49 some body finished +Debug: 05-19 00:00:49 one finished. +Debug: 05-19 00:00:49 erasing.. +Debug: 05-19 00:00:49 erase done.. +Debug: 05-19 00:00:49 send dicts(finished): "groupId:3,word:地獄の苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:49 ====reading 4076 of (7748) bytes . Finished: 1 +Debug: 05-19 00:00:49 receive dicts, current word: "地獄の苦しみ" "地獄の苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:00:49 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:49 scheme: "gico" +Debug: 05-19 00:00:49 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:49 article view loaded url: "gdlookup://localhost/?word=地獄の苦しみ&group=3&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" true +Debug: 05-19 00:00:51 open link url: QUrl("bword:苦しみ") +Debug: 05-19 00:00:51 getResource: "gdlookup://localhost/?word=苦しみ&group=3&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" +Debug: 05-19 00:00:51 scheme: "gdlookup" +Debug: 05-19 00:00:51 host: "localhost" +Debug: 05-19 00:00:51 clear current dictionaries: "苦しみ" +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 ====reading 1475 of (1475) bytes . Finished: 0 +Debug: 05-19 00:00:51 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-19 00:00:51 offset = 4f0886 + +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:51 some body finished +Debug: 05-19 00:00:51 one not finished. +Debug: 05-19 00:00:53 some body finished +Debug: 05-19 00:00:53 one not finished. +Debug: 05-19 00:00:53 some body finished +Debug: 05-19 00:00:53 one not finished. +Debug: 05-19 00:00:53 some body finished +Debug: 05-19 00:00:53 one finished. +Debug: 05-19 00:00:53 erasing.. +Debug: 05-19 00:00:53 erase done.. +Debug: 05-19 00:00:53 one not finished. +Debug: 05-19 00:00:53 send dicts(updated): "groupId:3,word:苦しみ,dictId:c63783324ee9b8fc3309849bd8302845" +Debug: 05-19 00:00:53 receive dicts, current word: "苦しみ" "苦しみ" : QList("c63783324ee9b8fc3309849bd8302845") +Debug: 05-19 00:00:53 ====reading 2369 of (3844) bytes . Finished: 0 +Debug: 05-19 00:00:53 ====reading 0 of (3844) bytes . Finished: 0 +Debug: 05-19 00:00:53 getResource: "bres://c63783324ee9b8fc3309849bd8302845/REIKOKU.css" +Debug: 05-19 00:00:53 scheme: "bres" +Debug: 05-19 00:00:53 host: "c63783324ee9b8fc3309849bd8302845" +Debug: 05-19 00:00:53 getResource: "gico://c63783324ee9b8fc3309849bd8302845/dicticon.png" +Debug: 05-19 00:00:53 scheme: "gico" +Debug: 05-19 00:00:53 host: "c63783324ee9b8fc3309849bd8302845" +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one not finished. +Debug: 05-19 00:00:54 send dicts(updated): "groupId:3,word:苦しみ,dictId:7363ba2e34cddead0f19a4a2ec51304e,968c3a374ef50d74e019560ae8f69488,41e48e169f3b09f5d08c9821aa0e88af,133436b45f37007263000dd395a5cb19,f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 receive dicts, current word: "苦しみ" "苦しみ" : QList("7363ba2e34cddead0f19a4a2ec51304e", "968c3a374ef50d74e019560ae8f69488", "41e48e169f3b09f5d08c9821aa0e88af", "133436b45f37007263000dd395a5cb19", "f2f3fca4482e832d2b39e39931f1861e") +Debug: 05-19 00:00:54 ====reading 18377 of (22221) bytes . Finished: 0 +Debug: 05-19 00:00:54 ====reading 0 of (22221) bytes . Finished: 0 +Debug: 05-19 00:00:54 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/kojien.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:54 getResource: "gico://7363ba2e34cddead0f19a4a2ec51304e/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:54 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/kojien.js" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:54 getResource: "gico://968c3a374ef50d74e019560ae8f69488/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:00:54 getResource: "bres://968c3a374ef50d74e019560ae8f69488/NHK日本語発音アクセント辞書.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:00:54 getResource: "gico://41e48e169f3b09f5d08c9821aa0e88af/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "41e48e169f3b09f5d08c9821aa0e88af" +Debug: 05-19 00:00:54 getResource: "bres://41e48e169f3b09f5d08c9821aa0e88af/daijirin2.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "41e48e169f3b09f5d08c9821aa0e88af" +Debug: 05-19 00:00:54 getResource: "gico://133436b45f37007263000dd395a5cb19/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "133436b45f37007263000dd395a5cb19" +Debug: 05-19 00:00:54 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/nikkoku.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E030.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E02F.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E035.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E032.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E031.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/1C9F.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "gico://f2f3fca4482e832d2b39e39931f1861e/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:00:54 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/くるしみ【苦しみ】.png" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:54 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/くるしみ【苦しみ】2.png" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:54 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/Ten Mincho Text Regular.otf" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:00:54 some body finished +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 one finished. +Debug: 05-19 00:00:54 erasing.. +Debug: 05-19 00:00:54 erase done.. +Debug: 05-19 00:00:54 send dicts(finished): "groupId:3,word:苦しみ,dictId:71ac9bc6d781652a85341bcf5a7fd63c,c3bba9ed1957c4d6553f24a97adf0202,d0e35c7d8c2b432d0a57cdf7941f912a,fd22dd8651fc9f5383ca576b5ed6a3cf,304a839a02ce8080037171de2de2d336,0c31f468bbb31b720212d9a43bb8e0e6,ab6643336366d243d73d1ce4b7fd8b8d,727597d1015ede1f019990d436029401,77635cf22dadc58222f44f3c4f281c1f,f6038dc4737356a34acc5a0c8a194f4a,8dda33ca157805525b1038e6fef3b56c,43bc82454c7f9962132daee50f10e63b,c05cc9bea6ab9ca5a7e4fd9bd485c294,b1e3f422135b95f15c0225ae27692050,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:54 ====reading 43315 of (134264) bytes . Finished: 1 +Debug: 05-19 00:00:54 receive dicts, current word: "苦しみ" "苦しみ" : QList("71ac9bc6d781652a85341bcf5a7fd63c", "c3bba9ed1957c4d6553f24a97adf0202", "d0e35c7d8c2b432d0a57cdf7941f912a", "fd22dd8651fc9f5383ca576b5ed6a3cf", "304a839a02ce8080037171de2de2d336", "0c31f468bbb31b720212d9a43bb8e0e6", "ab6643336366d243d73d1ce4b7fd8b8d", "727597d1015ede1f019990d436029401", "77635cf22dadc58222f44f3c4f281c1f", "f6038dc4737356a34acc5a0c8a194f4a", "8dda33ca157805525b1038e6fef3b56c", "43bc82454c7f9962132daee50f10e63b", "c05cc9bea6ab9ca5a7e4fd9bd485c294", "b1e3f422135b95f15c0225ae27692050", "9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:00:54 ====reading 22221 of (134264) bytes . Finished: 1 +Debug: 05-19 00:00:54 getResource: "gico://71ac9bc6d781652a85341bcf5a7fd63c/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/pe.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/pixiv-logo.png" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/pe.js" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "gico://c3bba9ed1957c4d6553f24a97adf0202/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "c3bba9ed1957c4d6553f24a97adf0202" +Debug: 05-19 00:00:54 getResource: "bres://c3bba9ed1957c4d6553f24a97adf0202/DAIJIRIN3.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "c3bba9ed1957c4d6553f24a97adf0202" +Debug: 05-19 00:00:54 getResource: "gico://d0e35c7d8c2b432d0a57cdf7941f912a/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/nikkoku.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 ====reading 43315 of (134264) bytes . Finished: 1 +Debug: 05-19 00:00:54 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E030.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 ====reading 3192 of (134264) bytes . Finished: 1 +Debug: 05-19 00:00:54 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E02F.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E035.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 getResource: "gico://fd22dd8651fc9f5383ca576b5ed6a3cf/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "fd22dd8651fc9f5383ca576b5ed6a3cf" +Debug: 05-19 00:00:54 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E032.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E031.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/1C9F.gif" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:00:54 getResource: "gico://304a839a02ce8080037171de2de2d336/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "304a839a02ce8080037171de2de2d336" +Debug: 05-19 00:00:54 getResource: "bres://fd22dd8651fc9f5383ca576b5ed6a3cf/DJS.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "fd22dd8651fc9f5383ca576b5ed6a3cf" +Debug: 05-19 00:00:54 getResource: "bres://304a839a02ce8080037171de2de2d336/MK3.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "304a839a02ce8080037171de2de2d336" +Debug: 05-19 00:00:54 getResource: "bres://304a839a02ce8080037171de2de2d336/gaiji/参考1.svg" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "304a839a02ce8080037171de2de2d336" +Debug: 05-19 00:00:54 getResource: "bres://0c31f468bbb31b720212d9a43bb8e0e6/gcy.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "0c31f468bbb31b720212d9a43bb8e0e6" +Debug: 05-19 00:00:54 getResource: "bres://727597d1015ede1f019990d436029401/nhgkt.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "727597d1015ede1f019990d436029401" +Debug: 05-19 00:00:54 getResource: "bres://727597d1015ede1f019990d436029401/1.png" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "727597d1015ede1f019990d436029401" +Debug: 05-19 00:00:54 getResource: "gico://0c31f468bbb31b720212d9a43bb8e0e6/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "0c31f468bbb31b720212d9a43bb8e0e6" +Debug: 05-19 00:00:54 getResource: "gico://ab6643336366d243d73d1ce4b7fd8b8d/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "ab6643336366d243d73d1ce4b7fd8b8d" +Debug: 05-19 00:00:54 getResource: "gico://727597d1015ede1f019990d436029401/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "727597d1015ede1f019990d436029401" +Debug: 05-19 00:00:54 getResource: "bres://77635cf22dadc58222f44f3c4f281c1f/thesaurus.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:54 getResource: "bres://f6038dc4737356a34acc5a0c8a194f4a/thsrs.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "f6038dc4737356a34acc5a0c8a194f4a" +Debug: 05-19 00:00:54 getResource: "gico://77635cf22dadc58222f44f3c4f281c1f/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:00:54 getResource: "gico://f6038dc4737356a34acc5a0c8a194f4a/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "f6038dc4737356a34acc5a0c8a194f4a" +Debug: 05-19 00:00:54 getResource: "bres://8dda33ca157805525b1038e6fef3b56c/ysx.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "8dda33ca157805525b1038e6fef3b56c" +Debug: 05-19 00:00:54 getResource: "gico://8dda33ca157805525b1038e6fef3b56c/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "8dda33ca157805525b1038e6fef3b56c" +Debug: 05-19 00:00:54 getResource: "gico://43bc82454c7f9962132daee50f10e63b/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "43bc82454c7f9962132daee50f10e63b" +Debug: 05-19 00:00:54 getResource: "gico://c05cc9bea6ab9ca5a7e4fd9bd485c294/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:00:54 getResource: "bres://43bc82454c7f9962132daee50f10e63b/duiyiyu.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "43bc82454c7f9962132daee50f10e63b" +Debug: 05-19 00:00:54 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/ktsn.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:00:54 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/ktsn.js" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:00:54 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.css" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:00:54 getResource: "gico://b1e3f422135b95f15c0225ae27692050/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:00:54 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:00:54 scheme: "gico" +Debug: 05-19 00:00:54 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:00:54 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/logo.svg" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/fonts/A-OTF Ryumin Pr6N EB-KL.otf" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/fonts/UDDigiKyokashoNP-R.ttf" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/fonts/A-OTF Ryumin Pr6N H-KL.otf" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:54 getResource: "bres://71ac9bc6d781652a85341bcf5a7fd63c/fonts/A-OTF Gothic MB101 Pr6N M.otf" +Debug: 05-19 00:00:54 scheme: "bres" +Debug: 05-19 00:00:54 host: "71ac9bc6d781652a85341bcf5a7fd63c" +Debug: 05-19 00:00:55 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/image/lig99.png" +Debug: 05-19 00:00:55 scheme: "bres" +Debug: 05-19 00:00:55 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:00:58 article view loaded url: "gdlookup://localhost/?word=苦しみ&group=3&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" true +Info: 05-19 00:01:01 libpng warning: iCCP: known incorrect sRGB profile +Info: 05-19 00:01:01 libpng warning: iCCP: cHRM chunk does not match sRGB +Debug: 05-19 00:01:02 Epwing: can not found subbook directory,try to fix automatically, dir=> "eidai6" +Debug: 05-19 00:01:02 Epwing: found "EIDAI6" +Debug: 05-19 00:01:02 Epwing: can not found subbook directory,try to fix automatically, dir=> "hyogen" +Debug: 05-19 00:01:02 Epwing: found "HYOGEN" +Debug: 05-19 00:01:02 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-19 00:01:02 Epwing: found "RUIGIGO" +Debug: 05-19 00:01:03 Epwing: can not found subbook directory,try to fix automatically, dir=> "ruigigo" +Debug: 05-19 00:01:03 Epwing: found "RUIGIGO" +Debug: 05-19 00:01:03 Epwing: can not found subbook directory,try to fix automatically, dir=> "ency" +Debug: 05-19 00:01:03 Epwing: found "ENCY" +Debug: 05-19 00:01:03 Epwing: can not found subbook directory,try to fix automatically, dir=> "snmkg99" +Debug: 05-19 00:01:03 Epwing: found "Snmkg99" +Debug: 05-19 00:01:03 Epwing: can not found subbook directory,try to fix automatically, dir=> "body" +Debug: 05-19 00:01:03 Epwing: found "BODY" +Debug: 05-19 00:01:03 Epwing: can not found subbook directory,try to fix automatically, dir=> "meikyojj" +Debug: 05-19 00:01:03 Epwing: found "MEIKYOJJ" +Info: 05-19 00:01:04 libpng warning: iCCP: known incorrect sRGB profile +Info: 05-19 00:01:04 libpng warning: iCCP: known incorrect sRGB profile +Debug: 05-19 00:01:05 "OrderAndProps" +Debug: 05-19 00:01:05 "Groups" +Debug: 05-19 00:01:16 Reloading all the tabs... +Debug: 05-19 00:01:16 starting create the fts with thread: 11 +Debug: 05-19 00:01:16 waiting for all the fts creation to finish. +Debug: 05-19 00:01:16 finished/cancel all the fts creation +Debug: 05-19 00:01:16 getResource: "gdlookup://localhost/?word=苦しみ&group=3&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" +Debug: 05-19 00:01:16 scheme: "gdlookup" +Debug: 05-19 00:01:16 host: "localhost" +Debug: 05-19 00:01:16 clear current dictionaries: "苦しみ" +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 offset = 4f0886 + +Debug: 05-19 00:01:16 ====reading 1475 of (1475) bytes . Finished: 0 +Debug: 05-19 00:01:16 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one not finished. +Debug: 05-19 00:01:16 some body finished +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 one finished. +Debug: 05-19 00:01:16 erasing.. +Debug: 05-19 00:01:16 erase done.. +Debug: 05-19 00:01:16 send dicts(finished): "groupId:3,word:苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517,c63783324ee9b8fc3309849bd8302845,7363ba2e34cddead0f19a4a2ec51304e,968c3a374ef50d74e019560ae8f69488,41e48e169f3b09f5d08c9821aa0e88af,133436b45f37007263000dd395a5cb19,f2f3fca4482e832d2b39e39931f1861e,71ac9bc6d781652a85341bcf5a7fd63c,c3bba9ed1957c4d6553f24a97adf0202,d0e35c7d8c2b432d0a57cdf7941f912a,fd22dd8651fc9f5383ca576b5ed6a3cf,304a839a02ce8080037171de2de2d336,0c31f468bbb31b720212d9a43bb8e0e6,ab6643336366d243d73d1ce4b7fd8b8d,727597d1015ede1f019990d436029401,77635cf22dadc58222f44f3c4f281c1f,f6038dc4737356a34acc5a0c8a194f4a,8dda33ca157805525b1038e6fef3b56c,43bc82454c7f9962132daee50f10e63b,c05cc9bea6ab9ca5a7e4fd9bd485c294,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:16 ====reading 64061 of (134264) bytes . Finished: 1 +Debug: 05-19 00:01:16 receive dicts, current word: "苦しみ" "苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517", "c63783324ee9b8fc3309849bd8302845", "7363ba2e34cddead0f19a4a2ec51304e", "968c3a374ef50d74e019560ae8f69488", "41e48e169f3b09f5d08c9821aa0e88af", "133436b45f37007263000dd395a5cb19", "f2f3fca4482e832d2b39e39931f1861e", "71ac9bc6d781652a85341bcf5a7fd63c", "c3bba9ed1957c4d6553f24a97adf0202", "d0e35c7d8c2b432d0a57cdf7941f912a", "fd22dd8651fc9f5383ca576b5ed6a3cf", "304a839a02ce8080037171de2de2d336", "0c31f468bbb31b720212d9a43bb8e0e6", "ab6643336366d243d73d1ce4b7fd8b8d", "727597d1015ede1f019990d436029401", "77635cf22dadc58222f44f3c4f281c1f", "f6038dc4737356a34acc5a0c8a194f4a", "8dda33ca157805525b1038e6fef3b56c", "43bc82454c7f9962132daee50f10e63b", "c05cc9bea6ab9ca5a7e4fd9bd485c294", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:16 ====reading 65536 of (134264) bytes . Finished: 1 +Debug: 05-19 00:01:16 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:16 scheme: "gico" +Debug: 05-19 00:01:16 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:16 ====reading 3192 of (134264) bytes . Finished: 1 +Debug: 05-19 00:01:16 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:16 scheme: "gico" +Debug: 05-19 00:01:16 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:16 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/くるしみ【苦しみ】.png" +Debug: 05-19 00:01:16 scheme: "bres" +Debug: 05-19 00:01:16 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:16 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/くるしみ【苦しみ】2.png" +Debug: 05-19 00:01:16 scheme: "bres" +Debug: 05-19 00:01:16 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:16 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/image/lig99.png" +Debug: 05-19 00:01:16 scheme: "bres" +Debug: 05-19 00:01:16 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:01:16 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:16 scheme: "bres" +Debug: 05-19 00:01:16 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:18 open link url: QUrl("bword:苦しみ") +Debug: 05-19 00:01:18 getResource: "gdlookup://localhost/?word=苦しみ&group=3&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" +Debug: 05-19 00:01:18 scheme: "gdlookup" +Debug: 05-19 00:01:18 host: "localhost" +Debug: 05-19 00:01:18 clear current dictionaries: "苦しみ" +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 ====reading 1475 of (1475) bytes . Finished: 0 +Debug: 05-19 00:01:18 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-19 00:01:18 offset = 4f0886 + +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 ====reading 0 of (1475) bytes . Finished: 0 +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one not finished. +Debug: 05-19 00:01:18 some body finished +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 one finished. +Debug: 05-19 00:01:18 erasing.. +Debug: 05-19 00:01:18 erase done.. +Debug: 05-19 00:01:18 send dicts(finished): "groupId:3,word:苦しみ,dictId:9dfe38c28e4eb0d417245e761da52517,c63783324ee9b8fc3309849bd8302845,7363ba2e34cddead0f19a4a2ec51304e,968c3a374ef50d74e019560ae8f69488,41e48e169f3b09f5d08c9821aa0e88af,133436b45f37007263000dd395a5cb19,f2f3fca4482e832d2b39e39931f1861e,71ac9bc6d781652a85341bcf5a7fd63c,c3bba9ed1957c4d6553f24a97adf0202,d0e35c7d8c2b432d0a57cdf7941f912a,fd22dd8651fc9f5383ca576b5ed6a3cf,304a839a02ce8080037171de2de2d336,0c31f468bbb31b720212d9a43bb8e0e6,ab6643336366d243d73d1ce4b7fd8b8d,727597d1015ede1f019990d436029401,77635cf22dadc58222f44f3c4f281c1f,f6038dc4737356a34acc5a0c8a194f4a,8dda33ca157805525b1038e6fef3b56c,43bc82454c7f9962132daee50f10e63b,c05cc9bea6ab9ca5a7e4fd9bd485c294,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:18 ====reading 64061 of (134264) bytes . Finished: 1 +Debug: 05-19 00:01:18 receive dicts, current word: "苦しみ" "苦しみ" : QList("9dfe38c28e4eb0d417245e761da52517", "c63783324ee9b8fc3309849bd8302845", "7363ba2e34cddead0f19a4a2ec51304e", "968c3a374ef50d74e019560ae8f69488", "41e48e169f3b09f5d08c9821aa0e88af", "133436b45f37007263000dd395a5cb19", "f2f3fca4482e832d2b39e39931f1861e", "71ac9bc6d781652a85341bcf5a7fd63c", "c3bba9ed1957c4d6553f24a97adf0202", "d0e35c7d8c2b432d0a57cdf7941f912a", "fd22dd8651fc9f5383ca576b5ed6a3cf", "304a839a02ce8080037171de2de2d336", "0c31f468bbb31b720212d9a43bb8e0e6", "ab6643336366d243d73d1ce4b7fd8b8d", "727597d1015ede1f019990d436029401", "77635cf22dadc58222f44f3c4f281c1f", "f6038dc4737356a34acc5a0c8a194f4a", "8dda33ca157805525b1038e6fef3b56c", "43bc82454c7f9962132daee50f10e63b", "c05cc9bea6ab9ca5a7e4fd9bd485c294", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:18 ====reading 65536 of (134264) bytes . Finished: 1 +Debug: 05-19 00:01:18 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:18 scheme: "gico" +Debug: 05-19 00:01:18 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:18 ====reading 3192 of (134264) bytes . Finished: 1 +Debug: 05-19 00:01:18 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:18 scheme: "gico" +Debug: 05-19 00:01:18 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:18 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/くるしみ【苦しみ】.png" +Debug: 05-19 00:01:18 scheme: "bres" +Debug: 05-19 00:01:18 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:18 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/くるしみ【苦しみ】2.png" +Debug: 05-19 00:01:18 scheme: "bres" +Debug: 05-19 00:01:18 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:18 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/image/lig99.png" +Debug: 05-19 00:01:18 scheme: "bres" +Debug: 05-19 00:01:18 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:01:18 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:18 scheme: "bres" +Debug: 05-19 00:01:18 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:20 open link url: QUrl("bword:苦し") +Debug: 05-19 00:01:20 getResource: "gdlookup://localhost/?word=苦し&group=3&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" +Debug: 05-19 00:01:20 scheme: "gdlookup" +Debug: 05-19 00:01:20 host: "localhost" +Debug: 05-19 00:01:20 clear current dictionaries: "苦し" +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 ====reading 1472 of (1472) bytes . Finished: 0 +Debug: 05-19 00:01:20 ====reading 0 of (1472) bytes . Finished: 0 +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 ====reading 0 of (1472) bytes . Finished: 0 +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 send dicts(updated): "groupId:3,word:苦し,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:20 receive dicts, current word: "苦し" "苦し" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:20 ====reading 3952 of (5424) bytes . Finished: 0 +Debug: 05-19 00:01:20 ====reading 0 of (5424) bytes . Finished: 0 +Debug: 05-19 00:01:20 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:20 scheme: "gico" +Debug: 05-19 00:01:20 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 send dicts(updated): "groupId:3,word:苦し,dictId:41e48e169f3b09f5d08c9821aa0e88af" +Debug: 05-19 00:01:20 receive dicts, current word: "苦し" "苦し" : QList("41e48e169f3b09f5d08c9821aa0e88af") +Debug: 05-19 00:01:20 ====reading 2417 of (7841) bytes . Finished: 0 +Debug: 05-19 00:01:20 ====reading 0 of (7841) bytes . Finished: 0 +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 send dicts(updated): "groupId:3,word:苦し,dictId:f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:01:20 receive dicts, current word: "苦し" "苦し" : QList("f2f3fca4482e832d2b39e39931f1861e") +Debug: 05-19 00:01:20 ====reading 2057 of (9898) bytes . Finished: 0 +Debug: 05-19 00:01:20 ====reading 0 of (9898) bytes . Finished: 0 +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one not finished. +Debug: 05-19 00:01:20 send dicts(updated): "groupId:3,word:苦し,dictId:f60affb79583cb692ba2bca6df57444d,c3bba9ed1957c4d6553f24a97adf0202,d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:20 receive dicts, current word: "苦し" "苦し" : QList("f60affb79583cb692ba2bca6df57444d", "c3bba9ed1957c4d6553f24a97adf0202", "d0e35c7d8c2b432d0a57cdf7941f912a") +Debug: 05-19 00:01:20 ====reading 5818 of (15716) bytes . Finished: 0 +Debug: 05-19 00:01:20 ====reading 0 of (15716) bytes . Finished: 0 +Debug: 05-19 00:01:20 getResource: "gico://f60affb79583cb692ba2bca6df57444d/dicticon.png" +Debug: 05-19 00:01:20 scheme: "gico" +Debug: 05-19 00:01:20 host: "f60affb79583cb692ba2bca6df57444d" +Debug: 05-19 00:01:20 some body finished +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 one finished. +Debug: 05-19 00:01:20 erasing.. +Debug: 05-19 00:01:20 erase done.. +Debug: 05-19 00:01:20 send dicts(finished): "groupId:3,word:苦し,dictId:68ea7837dab9dc82d592a7762c4e8092" +Debug: 05-19 00:01:20 receive dicts, current word: "苦し" "苦し" : QList("68ea7837dab9dc82d592a7762c4e8092") +Debug: 05-19 00:01:20 ====reading 6426 of (22142) bytes . Finished: 1 +Debug: 05-19 00:01:20 getResource: "bres://68ea7837dab9dc82d592a7762c4e8092/kogo.css" +Debug: 05-19 00:01:20 scheme: "bres" +Debug: 05-19 00:01:20 host: "68ea7837dab9dc82d592a7762c4e8092" +Debug: 05-19 00:01:20 getResource: "gico://68ea7837dab9dc82d592a7762c4e8092/dicticon.png" +Debug: 05-19 00:01:20 scheme: "gico" +Debug: 05-19 00:01:20 host: "68ea7837dab9dc82d592a7762c4e8092" +Debug: 05-19 00:01:20 article view loaded url: "gdlookup://localhost/?word=苦し&group=3&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" true +Debug: 05-19 00:01:23 open link url: QUrl("bword:地獄") +Debug: 05-19 00:01:23 getResource: "gdlookup://localhost/?word=地獄&group=3&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7" +Debug: 05-19 00:01:23 scheme: "gdlookup" +Debug: 05-19 00:01:23 host: "localhost" +Debug: 05-19 00:01:23 clear current dictionaries: "地獄" +Debug: 05-19 00:01:23 offset = d5a1c0 + +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 ====reading 1472 of (1472) bytes . Finished: 0 +Debug: 05-19 00:01:23 ====reading 0 of (1472) bytes . Finished: 0 +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 ====reading 0 of (1472) bytes . Finished: 0 +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one finished. +Debug: 05-19 00:01:23 erasing.. +Debug: 05-19 00:01:23 erase done.. +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 send dicts(updated): "groupId:3,word:地獄,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:23 receive dicts, current word: "地獄" "地獄" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:23 ====reading 3952 of (5424) bytes . Finished: 0 +Debug: 05-19 00:01:23 ====reading 0 of (5424) bytes . Finished: 0 +Debug: 05-19 00:01:23 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:23 scheme: "gico" +Debug: 05-19 00:01:23 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one finished. +Debug: 05-19 00:01:23 erasing.. +Debug: 05-19 00:01:23 erase done.. +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 send dicts(updated): "groupId:3,word:地獄,dictId:c63783324ee9b8fc3309849bd8302845" +Debug: 05-19 00:01:23 receive dicts, current word: "地獄" "地獄" : QList("c63783324ee9b8fc3309849bd8302845") +Debug: 05-19 00:01:23 ====reading 3231 of (8655) bytes . Finished: 0 +Debug: 05-19 00:01:23 ====reading 0 of (8655) bytes . Finished: 0 +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:23 some body finished +Debug: 05-19 00:01:23 one not finished. +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 send dicts(updated): "groupId:3,word:地獄,dictId:7363ba2e34cddead0f19a4a2ec51304e,968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:01:24 receive dicts, current word: "地獄" "地獄" : QList("7363ba2e34cddead0f19a4a2ec51304e", "968c3a374ef50d74e019560ae8f69488") +Debug: 05-19 00:01:24 ====reading 9024 of (17679) bytes . Finished: 0 +Debug: 05-19 00:01:24 ====reading 0 of (17679) bytes . Finished: 0 +Debug: 05-19 00:01:24 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/kojien.js" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:24 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/じ‐ごく【地獄】.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:24 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/じ‐ごく【地獄】2.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:24 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/じごく【地獄】.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:24 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/img/じごく【地獄】2.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 getResource: "bres://7363ba2e34cddead0f19a4a2ec51304e/SourceHanSerifCN.otf" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "7363ba2e34cddead0f19a4a2ec51304e" +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one not finished. +Debug: 05-19 00:01:24 send dicts(updated): "groupId:3,word:地獄,dictId:646c2fbd2278d23caf8bc5b44599f5aa,41e48e169f3b09f5d08c9821aa0e88af,133436b45f37007263000dd395a5cb19,f2f3fca4482e832d2b39e39931f1861e,f60affb79583cb692ba2bca6df57444d" +Debug: 05-19 00:01:24 receive dicts, current word: "地獄" "地獄" : QList("646c2fbd2278d23caf8bc5b44599f5aa", "41e48e169f3b09f5d08c9821aa0e88af", "133436b45f37007263000dd395a5cb19", "f2f3fca4482e832d2b39e39931f1861e", "f60affb79583cb692ba2bca6df57444d") +Debug: 05-19 00:01:24 ====reading 42121 of (59800) bytes . Finished: 0 +Debug: 05-19 00:01:24 ====reading 0 of (59800) bytes . Finished: 0 +Debug: 05-19 00:01:24 getResource: "bres://646c2fbd2278d23caf8bc5b44599f5aa/smk8.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "646c2fbd2278d23caf8bc5b44599f5aa" +Debug: 05-19 00:01:24 getResource: "gico://646c2fbd2278d23caf8bc5b44599f5aa/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "646c2fbd2278d23caf8bc5b44599f5aa" +Debug: 05-19 00:01:24 some body finished +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 one finished. +Debug: 05-19 00:01:24 erasing.. +Debug: 05-19 00:01:24 erase done.. +Debug: 05-19 00:01:24 send dicts(finished): "groupId:3,word:地獄,dictId:71ac9bc6d781652a85341bcf5a7fd63c,5672141bb28e74f28e750058bfca0956,c3bba9ed1957c4d6553f24a97adf0202,f26420c7eb1d59c1076d59ccf790a337,8431bdd6831e3f351ad8799dc6d42d73,d0e35c7d8c2b432d0a57cdf7941f912a,fd22dd8651fc9f5383ca576b5ed6a3cf,304a839a02ce8080037171de2de2d336,38386df88d70b0c53b53e9b70967bf8e,0c31f468bbb31b720212d9a43bb8e0e6,fb4e6f53358b387157bec73b6cbe4c8c,36a7df6c1b1d19a4e7df65b79fa98a67,0dc93d9e25edee78f80b6c12013b4d9a,0a5c32cda34c580f09fd0b5fc015e1b3,cb8bfcfc5c40f1be931fb77ea3d87a35,888d7bb796756084542d33d9c6e0685f,97295be38a11d07b041a97b8144cb152,68ea7837dab9dc82d592a7762c4e8092,23e549f189b1238b16b9c6a2fc2860f0,76920f4e8caf20bf370acb7fea5fc232,439501f369c57bb5d3f0933b088cb23f,69012e49a9b1bb44848ace9b2ec951d0,77635cf22dadc58222f44f3c4f281c1f,f6038dc4737356a34acc5a0c8a194f4a,8dda33ca157805525b1038e6fef3b56c,43bc82454c7f9962132daee50f10e63b,c05cc9bea6ab9ca5a7e4fd9bd485c294,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:24 ====reading 16384 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 receive dicts, current word: "地獄" "地獄" : QList("71ac9bc6d781652a85341bcf5a7fd63c", "5672141bb28e74f28e750058bfca0956", "c3bba9ed1957c4d6553f24a97adf0202", "f26420c7eb1d59c1076d59ccf790a337", "8431bdd6831e3f351ad8799dc6d42d73", "d0e35c7d8c2b432d0a57cdf7941f912a", "fd22dd8651fc9f5383ca576b5ed6a3cf", "304a839a02ce8080037171de2de2d336", "38386df88d70b0c53b53e9b70967bf8e", "0c31f468bbb31b720212d9a43bb8e0e6", "fb4e6f53358b387157bec73b6cbe4c8c", "36a7df6c1b1d19a4e7df65b79fa98a67", "0dc93d9e25edee78f80b6c12013b4d9a", "0a5c32cda34c580f09fd0b5fc015e1b3", "cb8bfcfc5c40f1be931fb77ea3d87a35", "888d7bb796756084542d33d9c6e0685f", "97295be38a11d07b041a97b8144cb152", "68ea7837dab9dc82d592a7762c4e8092", "23e549f189b1238b16b9c6a2fc2860f0", "76920f4e8caf20bf370acb7fea5fc232", "439501f369c57bb5d3f0933b088cb23f", "69012e49a9b1bb44848ace9b2ec951d0", "77635cf22dadc58222f44f3c4f281c1f", "f6038dc4737356a34acc5a0c8a194f4a", "8dda33ca157805525b1038e6fef3b56c", "43bc82454c7f9962132daee50f10e63b", "c05cc9bea6ab9ca5a7e4fd9bd485c294", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:24 ====reading 49152 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 ====reading 16384 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 getResource: "bres://646c2fbd2278d23caf8bc5b44599f5aa/Audio.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "646c2fbd2278d23caf8bc5b44599f5aa" +Debug: 05-19 00:01:24 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E2EB.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:01:24 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E2E9.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:01:24 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E2E7.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:01:24 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/1701.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:01:24 ====reading 49152 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 ====reading 16384 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 getResource: "bres://f2f3fca4482e832d2b39e39931f1861e/gaiji/E256.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "f2f3fca4482e832d2b39e39931f1861e" +Debug: 05-19 00:01:24 ====reading 49152 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 ====reading 16384 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 getResource: "gico://5672141bb28e74f28e750058bfca0956/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "5672141bb28e74f28e750058bfca0956" +Debug: 05-19 00:01:24 getResource: "bres://5672141bb28e74f28e750058bfca0956/nipponica.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "5672141bb28e74f28e750058bfca0956" +Debug: 05-19 00:01:24 getResource: "gico://f26420c7eb1d59c1076d59ccf790a337/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "f26420c7eb1d59c1076d59ccf790a337" +Debug: 05-19 00:01:24 getResource: "bres://f26420c7eb1d59c1076d59ccf790a337/SANKOKU7.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "f26420c7eb1d59c1076d59ccf790a337" +Debug: 05-19 00:01:24 getResource: "gico://8431bdd6831e3f351ad8799dc6d42d73/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "8431bdd6831e3f351ad8799dc6d42d73" +Debug: 05-19 00:01:24 ====reading 19207 of (291999) bytes . Finished: 1 +Debug: 05-19 00:01:24 getResource: "bres://8431bdd6831e3f351ad8799dc6d42d73/sinmei.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "8431bdd6831e3f351ad8799dc6d42d73" +Debug: 05-19 00:01:24 getResource: "bres://8431bdd6831e3f351ad8799dc6d42d73/Audio.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "8431bdd6831e3f351ad8799dc6d42d73" +Debug: 05-19 00:01:24 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E2EB.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:24 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E2E9.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:24 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E2E7.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:24 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/1701.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:24 getResource: "gico://38386df88d70b0c53b53e9b70967bf8e/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "38386df88d70b0c53b53e9b70967bf8e" +Debug: 05-19 00:01:24 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E256.gif" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:24 getResource: "bres://304a839a02ce8080037171de2de2d336/MK3.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "304a839a02ce8080037171de2de2d336" +Debug: 05-19 00:01:24 getResource: "bres://304a839a02ce8080037171de2de2d336/gaiji/対義語.svg" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "304a839a02ce8080037171de2de2d336" +Debug: 05-19 00:01:24 getResource: "bres://38386df88d70b0c53b53e9b70967bf8e/iwakoku.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "38386df88d70b0c53b53e9b70967bf8e" +Debug: 05-19 00:01:24 getResource: "bres://0c31f468bbb31b720212d9a43bb8e0e6/yajirusi2.svg" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "0c31f468bbb31b720212d9a43bb8e0e6" +Debug: 05-19 00:01:24 getResource: "bres://fb4e6f53358b387157bec73b6cbe4c8c/OBS.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "fb4e6f53358b387157bec73b6cbe4c8c" +Debug: 05-19 00:01:24 getResource: "bres://36a7df6c1b1d19a4e7df65b79fa98a67/Kanjikai2.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "36a7df6c1b1d19a4e7df65b79fa98a67" +Debug: 05-19 00:01:24 getResource: "bres://0dc93d9e25edee78f80b6c12013b4d9a/DHHCD02407.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "0dc93d9e25edee78f80b6c12013b4d9a" +Debug: 05-19 00:01:24 getResource: "bres://0a5c32cda34c580f09fd0b5fc015e1b3/kanjigen5.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "0a5c32cda34c580f09fd0b5fc015e1b3" +Debug: 05-19 00:01:24 getResource: "bres://cb8bfcfc5c40f1be931fb77ea3d87a35/JITSU.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "cb8bfcfc5c40f1be931fb77ea3d87a35" +Debug: 05-19 00:01:24 getResource: "bres://888d7bb796756084542d33d9c6e0685f/NKGORIN2.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "888d7bb796756084542d33d9c6e0685f" +Debug: 05-19 00:01:24 getResource: "bres://888d7bb796756084542d33d9c6e0685f/img/B134.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "888d7bb796756084542d33d9c6e0685f" +Debug: 05-19 00:01:24 getResource: "bres://888d7bb796756084542d33d9c6e0685f/img/B133.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "888d7bb796756084542d33d9c6e0685f" +Debug: 05-19 00:01:24 getResource: "gico://fb4e6f53358b387157bec73b6cbe4c8c/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "fb4e6f53358b387157bec73b6cbe4c8c" +Debug: 05-19 00:01:24 getResource: "gico://36a7df6c1b1d19a4e7df65b79fa98a67/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "36a7df6c1b1d19a4e7df65b79fa98a67" +Debug: 05-19 00:01:24 getResource: "gico://0dc93d9e25edee78f80b6c12013b4d9a/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "0dc93d9e25edee78f80b6c12013b4d9a" +Debug: 05-19 00:01:24 getResource: "gico://0a5c32cda34c580f09fd0b5fc015e1b3/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "0a5c32cda34c580f09fd0b5fc015e1b3" +Debug: 05-19 00:01:24 getResource: "gico://cb8bfcfc5c40f1be931fb77ea3d87a35/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "cb8bfcfc5c40f1be931fb77ea3d87a35" +Debug: 05-19 00:01:24 getResource: "gico://888d7bb796756084542d33d9c6e0685f/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "888d7bb796756084542d33d9c6e0685f" +Debug: 05-19 00:01:24 getResource: "gico://97295be38a11d07b041a97b8144cb152/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "97295be38a11d07b041a97b8144cb152" +Debug: 05-19 00:01:24 getResource: "gico://23e549f189b1238b16b9c6a2fc2860f0/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "23e549f189b1238b16b9c6a2fc2860f0" +Debug: 05-19 00:01:24 getResource: "bres://97295be38a11d07b041a97b8144cb152/SHINJIGEN.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "97295be38a11d07b041a97b8144cb152" +Debug: 05-19 00:01:24 getResource: "bres://23e549f189b1238b16b9c6a2fc2860f0/kogodai.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "23e549f189b1238b16b9c6a2fc2860f0" +Debug: 05-19 00:01:24 getResource: "gico://76920f4e8caf20bf370acb7fea5fc232/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "76920f4e8caf20bf370acb7fea5fc232" +Debug: 05-19 00:01:24 getResource: "bres://76920f4e8caf20bf370acb7fea5fc232/iwakoku.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "76920f4e8caf20bf370acb7fea5fc232" +Debug: 05-19 00:01:24 getResource: "bres://76920f4e8caf20bf370acb7fea5fc232/b326.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "76920f4e8caf20bf370acb7fea5fc232" +Debug: 05-19 00:01:24 getResource: "bres://76920f4e8caf20bf370acb7fea5fc232/b327.png" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "76920f4e8caf20bf370acb7fea5fc232" +Debug: 05-19 00:01:24 getResource: "gico://439501f369c57bb5d3f0933b088cb23f/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "439501f369c57bb5d3f0933b088cb23f" +Debug: 05-19 00:01:24 getResource: "gico://69012e49a9b1bb44848ace9b2ec951d0/dicticon.png" +Debug: 05-19 00:01:24 scheme: "gico" +Debug: 05-19 00:01:24 host: "69012e49a9b1bb44848ace9b2ec951d0" +Debug: 05-19 00:01:24 getResource: "bres://439501f369c57bb5d3f0933b088cb23f/common.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "439501f369c57bb5d3f0933b088cb23f" +Debug: 05-19 00:01:24 getResource: "bres://439501f369c57bb5d3f0933b088cb23f/kankenkj2.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "439501f369c57bb5d3f0933b088cb23f" +Debug: 05-19 00:01:24 getResource: "bres://69012e49a9b1bb44848ace9b2ec951d0/JMnedict.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "69012e49a9b1bb44848ace9b2ec951d0" +Debug: 05-19 00:01:24 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/ktsn.css" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:01:24 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:24 scheme: "bres" +Debug: 05-19 00:01:24 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:25 getResource: "bres://c3bba9ed1957c4d6553f24a97adf0202/DAIJIRIN3.css" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "c3bba9ed1957c4d6553f24a97adf0202" +Debug: 05-19 00:01:25 getResource: "gico://c3bba9ed1957c4d6553f24a97adf0202/dicticon.png" +Debug: 05-19 00:01:25 scheme: "gico" +Debug: 05-19 00:01:25 host: "c3bba9ed1957c4d6553f24a97adf0202" +Debug: 05-19 00:01:25 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/nikkoku.css" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:25 getResource: "gico://d0e35c7d8c2b432d0a57cdf7941f912a/dicticon.png" +Debug: 05-19 00:01:25 scheme: "gico" +Debug: 05-19 00:01:25 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:25 getResource: "bres://fd22dd8651fc9f5383ca576b5ed6a3cf/DJS.css" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "fd22dd8651fc9f5383ca576b5ed6a3cf" +Debug: 05-19 00:01:25 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E030.gif" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:25 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E02F.gif" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:25 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E032.gif" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:25 getResource: "gico://fd22dd8651fc9f5383ca576b5ed6a3cf/dicticon.png" +Debug: 05-19 00:01:25 scheme: "gico" +Debug: 05-19 00:01:25 host: "fd22dd8651fc9f5383ca576b5ed6a3cf" +Debug: 05-19 00:01:25 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E035.gif" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:25 getResource: "bres://d0e35c7d8c2b432d0a57cdf7941f912a/gaiji/E031.gif" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "d0e35c7d8c2b432d0a57cdf7941f912a" +Debug: 05-19 00:01:25 getResource: "bres://0c31f468bbb31b720212d9a43bb8e0e6/gcy.css" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "0c31f468bbb31b720212d9a43bb8e0e6" +Debug: 05-19 00:01:25 getResource: "gico://304a839a02ce8080037171de2de2d336/dicticon.png" +Debug: 05-19 00:01:25 scheme: "gico" +Debug: 05-19 00:01:25 host: "304a839a02ce8080037171de2de2d336" +Debug: 05-19 00:01:25 getResource: "gico://0c31f468bbb31b720212d9a43bb8e0e6/dicticon.png" +Debug: 05-19 00:01:25 scheme: "gico" +Debug: 05-19 00:01:25 host: "0c31f468bbb31b720212d9a43bb8e0e6" +Debug: 05-19 00:01:25 getResource: "bres://97295be38a11d07b041a97b8144cb152/SourceHanSerifJP-Regular.otf" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "97295be38a11d07b041a97b8144cb152" +Debug: 05-19 00:01:25 getResource: "bres://97295be38a11d07b041a97b8144cb152/SourceHanSansJP-Regular.otf" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "97295be38a11d07b041a97b8144cb152" +Debug: 05-19 00:01:25 getResource: "bres://cb8bfcfc5c40f1be931fb77ea3d87a35/ヒラギノ明朝 ProN.ttc" +Debug: 05-19 00:01:25 scheme: "bres" +Debug: 05-19 00:01:25 host: "cb8bfcfc5c40f1be931fb77ea3d87a35" +Debug: 05-19 00:01:26 getResource: "bres://68ea7837dab9dc82d592a7762c4e8092/kogo.css" +Debug: 05-19 00:01:26 scheme: "bres" +Debug: 05-19 00:01:26 host: "68ea7837dab9dc82d592a7762c4e8092" +Debug: 05-19 00:01:26 getResource: "gico://68ea7837dab9dc82d592a7762c4e8092/dicticon.png" +Debug: 05-19 00:01:26 scheme: "gico" +Debug: 05-19 00:01:26 host: "68ea7837dab9dc82d592a7762c4e8092" +Debug: 05-19 00:01:26 getResource: "bres://97295be38a11d07b041a97b8144cb152/SHINJIMinchoW3.otf" +Debug: 05-19 00:01:26 scheme: "bres" +Debug: 05-19 00:01:26 host: "97295be38a11d07b041a97b8144cb152" +Debug: 05-19 00:01:26 getResource: "bres://77635cf22dadc58222f44f3c4f281c1f/thesaurus.css" +Debug: 05-19 00:01:26 scheme: "bres" +Debug: 05-19 00:01:26 host: "77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:01:26 getResource: "gico://77635cf22dadc58222f44f3c4f281c1f/dicticon.png" +Debug: 05-19 00:01:26 scheme: "gico" +Debug: 05-19 00:01:26 host: "77635cf22dadc58222f44f3c4f281c1f" +Debug: 05-19 00:01:26 getResource: "bres://23e549f189b1238b16b9c6a2fc2860f0/KogoGaiji.ttf" +Debug: 05-19 00:01:26 scheme: "bres" +Debug: 05-19 00:01:26 host: "23e549f189b1238b16b9c6a2fc2860f0" +Debug: 05-19 00:01:26 getResource: "bres://f6038dc4737356a34acc5a0c8a194f4a/thsrs.css" +Debug: 05-19 00:01:26 scheme: "bres" +Debug: 05-19 00:01:26 host: "f6038dc4737356a34acc5a0c8a194f4a" +Debug: 05-19 00:01:26 getResource: "gico://f6038dc4737356a34acc5a0c8a194f4a/dicticon.png" +Debug: 05-19 00:01:26 scheme: "gico" +Debug: 05-19 00:01:26 host: "f6038dc4737356a34acc5a0c8a194f4a" +Debug: 05-19 00:01:26 getResource: "bres://8dda33ca157805525b1038e6fef3b56c/ysx.css" +Debug: 05-19 00:01:26 scheme: "bres" +Debug: 05-19 00:01:26 host: "8dda33ca157805525b1038e6fef3b56c" +Debug: 05-19 00:01:26 getResource: "gico://8dda33ca157805525b1038e6fef3b56c/dicticon.png" +Debug: 05-19 00:01:26 scheme: "gico" +Debug: 05-19 00:01:26 host: "8dda33ca157805525b1038e6fef3b56c" +Debug: 05-19 00:01:27 getResource: "bres://43bc82454c7f9962132daee50f10e63b/duiyiyu.css" +Debug: 05-19 00:01:27 scheme: "bres" +Debug: 05-19 00:01:27 host: "43bc82454c7f9962132daee50f10e63b" +Debug: 05-19 00:01:27 getResource: "gico://43bc82454c7f9962132daee50f10e63b/dicticon.png" +Debug: 05-19 00:01:27 scheme: "gico" +Debug: 05-19 00:01:27 host: "43bc82454c7f9962132daee50f10e63b" +Debug: 05-19 00:01:27 getResource: "gico://c05cc9bea6ab9ca5a7e4fd9bd485c294/dicticon.png" +Debug: 05-19 00:01:27 scheme: "gico" +Debug: 05-19 00:01:27 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:01:27 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/ktsn.js" +Debug: 05-19 00:01:27 scheme: "bres" +Debug: 05-19 00:01:27 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:01:27 getResource: "bres://c05cc9bea6ab9ca5a7e4fd9bd485c294/image/lig99.png" +Debug: 05-19 00:01:27 scheme: "bres" +Debug: 05-19 00:01:27 host: "c05cc9bea6ab9ca5a7e4fd9bd485c294" +Debug: 05-19 00:01:27 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.css" +Debug: 05-19 00:01:27 scheme: "bres" +Debug: 05-19 00:01:27 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:27 getResource: "gico://b1e3f422135b95f15c0225ae27692050/dicticon.png" +Debug: 05-19 00:01:27 scheme: "gico" +Debug: 05-19 00:01:27 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:27 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:27 scheme: "bres" +Debug: 05-19 00:01:27 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:27 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:27 scheme: "bres" +Debug: 05-19 00:01:27 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:28 getResource: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:28 scheme: "gdlookup" +Debug: 05-19 00:01:28 host: "localhost" +Debug: 05-19 00:01:28 clear current dictionaries: "地獄" +Debug: 05-19 00:01:28 some body finished +Debug: 05-19 00:01:28 one not finished. +Debug: 05-19 00:01:28 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:28 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:28 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:28 some body finished +Debug: 05-19 00:01:28 one finished. +Debug: 05-19 00:01:28 erasing.. +Debug: 05-19 00:01:28 erase done.. +Debug: 05-19 00:01:28 send dicts(finished): "groupId:1,word:地獄,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:28 ====reading 4009 of (5418) bytes . Finished: 1 +Debug: 05-19 00:01:28 receive dicts, current word: "地獄" "地獄" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:28 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:28 scheme: "gico" +Debug: 05-19 00:01:28 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:29 article view loaded url: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313" true +Debug: 05-19 00:01:31 getResource: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:31 scheme: "gdlookup" +Debug: 05-19 00:01:31 host: "localhost" +Debug: 05-19 00:01:31 clear current dictionaries: "地獄" +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 send dicts(updated): "groupId:1,word:地獄,dictId:968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:01:31 receive dicts, current word: "地獄" "地獄" : QList("968c3a374ef50d74e019560ae8f69488") +Debug: 05-19 00:01:31 ====reading 2958 of (4367) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (4367) bytes . Finished: 0 +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 send dicts(finished): "groupId:1,word:地獄,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:31 receive dicts, current word: "地獄" "地獄" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:31 ====reading 4076 of (8443) bytes . Finished: 1 +Debug: 05-19 00:01:31 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:31 scheme: "gico" +Debug: 05-19 00:01:31 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:31 article view loaded url: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c" true +Debug: 05-19 00:01:31 getResource: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:31 scheme: "gdlookup" +Debug: 05-19 00:01:31 host: "localhost" +Debug: 05-19 00:01:31 clear current dictionaries: "地獄" +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 send dicts(updated): "groupId:1,word:地獄,dictId:968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:01:31 receive dicts, current word: "地獄" "地獄" : QList("968c3a374ef50d74e019560ae8f69488") +Debug: 05-19 00:01:31 ====reading 2958 of (4367) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (4367) bytes . Finished: 0 +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 send dicts(finished): "groupId:1,word:地獄,dictId:ec855a5ed10fb99483666514453d9bac,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:31 receive dicts, current word: "地獄" "地獄" : QList("ec855a5ed10fb99483666514453d9bac", "9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:31 ====reading 6277 of (10644) bytes . Finished: 1 +Debug: 05-19 00:01:31 getResource: "bres://ec855a5ed10fb99483666514453d9bac/jm_pt.css" +Debug: 05-19 00:01:31 scheme: "bres" +Debug: 05-19 00:01:31 host: "ec855a5ed10fb99483666514453d9bac" +Debug: 05-19 00:01:31 getResource: "gico://ec855a5ed10fb99483666514453d9bac/dicticon.png" +Debug: 05-19 00:01:31 scheme: "gico" +Debug: 05-19 00:01:31 host: "ec855a5ed10fb99483666514453d9bac" +Debug: 05-19 00:01:31 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:31 scheme: "gico" +Debug: 05-19 00:01:31 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:31 article view loaded url: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,b1e3f422135b95f15c0225ae27692050,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170e" true +Debug: 05-19 00:01:31 getResource: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:31 scheme: "gdlookup" +Debug: 05-19 00:01:31 host: "localhost" +Debug: 05-19 00:01:31 clear current dictionaries: "地獄" +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 send dicts(updated): "groupId:1,word:地獄,dictId:968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:31 receive dicts, current word: "地獄" "地獄" : QList("968c3a374ef50d74e019560ae8f69488", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:31 ====reading 9124 of (10533) bytes . Finished: 0 +Debug: 05-19 00:01:31 ====reading 0 of (10533) bytes . Finished: 0 +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one not finished. +Debug: 05-19 00:01:31 some body finished +Debug: 05-19 00:01:31 one finished. +Debug: 05-19 00:01:31 erasing.. +Debug: 05-19 00:01:31 erase done.. +Debug: 05-19 00:01:31 send dicts(finished): "groupId:1,word:地獄,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:31 receive dicts, current word: "地獄" "地獄" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:31 ====reading 4076 of (14609) bytes . Finished: 1 +Debug: 05-19 00:01:31 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:31 scheme: "bres" +Debug: 05-19 00:01:31 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:31 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:31 scheme: "gico" +Debug: 05-19 00:01:31 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:31 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:31 scheme: "bres" +Debug: 05-19 00:01:31 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:31 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:31 scheme: "bres" +Debug: 05-19 00:01:31 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:31 article view loaded url: "gdlookup://localhost/?word=地獄&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8" true +Debug: 05-19 00:01:35 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:35 scheme: "gdlookup" +Debug: 05-19 00:01:35 host: "localhost" +Debug: 05-19 00:01:35 clear current dictionaries: "納得が行く" +Debug: 05-19 00:01:35 some body finished +Debug: 05-19 00:01:35 one not finished. +Debug: 05-19 00:01:35 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:35 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:35 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:35 some body finished +Debug: 05-19 00:01:35 one finished. +Debug: 05-19 00:01:35 erasing.. +Debug: 05-19 00:01:35 erase done.. +Debug: 05-19 00:01:35 one not finished. +Debug: 05-19 00:01:35 some body finished +Debug: 05-19 00:01:35 one not finished. +Debug: 05-19 00:01:35 some body finished +Debug: 05-19 00:01:35 one not finished. +Debug: 05-19 00:01:35 some body finished +Debug: 05-19 00:01:35 one finished. +Debug: 05-19 00:01:35 erasing.. +Debug: 05-19 00:01:35 erase done.. +Debug: 05-19 00:01:35 one finished. +Debug: 05-19 00:01:35 erasing.. +Debug: 05-19 00:01:35 erase done.. +Debug: 05-19 00:01:35 one finished. +Debug: 05-19 00:01:35 erasing.. +Debug: 05-19 00:01:35 erase done.. +Debug: 05-19 00:01:35 send dicts(finished): "groupId:1,word:納得が行く,dictId:ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050,9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:35 receive dicts, current word: "納得が行く" "納得が行く" : QList("ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050", "9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:35 ====reading 8550 of (9968) bytes . Finished: 1 +Debug: 05-19 00:01:35 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:35 scheme: "bres" +Debug: 05-19 00:01:35 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:35 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:35 scheme: "gico" +Debug: 05-19 00:01:35 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:35 article view loaded url: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcb" true +Debug: 05-19 00:01:40 "OrderAndProps" +Debug: 05-19 00:01:40 "Groups" +Debug: 05-19 00:01:46 Reloading all the tabs... +Debug: 05-19 00:01:46 starting create the fts with thread: 11 +Debug: 05-19 00:01:46 waiting for all the fts creation to finish. +Debug: 05-19 00:01:46 finished/cancel all the fts creation +Debug: 05-19 00:01:46 getResource: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:46 scheme: "gdlookup" +Debug: 05-19 00:01:46 host: "localhost" +Debug: 05-19 00:01:46 clear current dictionaries: "納得が行く" +Debug: 05-19 00:01:46 some body finished +Debug: 05-19 00:01:46 one not finished. +Debug: 05-19 00:01:46 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:46 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:46 some body finished +Debug: 05-19 00:01:46 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:46 one not finished. +Debug: 05-19 00:01:46 some body finished +Debug: 05-19 00:01:46 one not finished. +Debug: 05-19 00:01:46 some body finished +Debug: 05-19 00:01:46 one not finished. +Debug: 05-19 00:01:46 some body finished +Debug: 05-19 00:01:46 one finished. +Debug: 05-19 00:01:46 erasing.. +Debug: 05-19 00:01:46 erase done.. +Debug: 05-19 00:01:46 one finished. +Debug: 05-19 00:01:46 erasing.. +Debug: 05-19 00:01:46 erase done.. +Debug: 05-19 00:01:46 one finished. +Debug: 05-19 00:01:46 erasing.. +Debug: 05-19 00:01:46 erase done.. +Debug: 05-19 00:01:46 one finished. +Debug: 05-19 00:01:46 erasing.. +Debug: 05-19 00:01:46 erase done.. +Debug: 05-19 00:01:46 send dicts(finished): "groupId:1,word:納得が行く,dictId:9dfe38c28e4eb0d417245e761da52517,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:46 ====reading 8550 of (9968) bytes . Finished: 1 +Debug: 05-19 00:01:46 receive dicts, current word: "納得が行く" "納得が行く" : QList("9dfe38c28e4eb0d417245e761da52517", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:46 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:46 scheme: "gico" +Debug: 05-19 00:01:46 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:46 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:46 scheme: "bres" +Debug: 05-19 00:01:46 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:46 article view loaded url: "gdlookup://localhost/?word=納得が行く&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcb" true +Debug: 05-19 00:01:48 open link url: QUrl("bword:納得が行く") +Debug: 05-19 00:01:48 getResource: "gdlookup://localhost/?word=納得が行く&group=1&scrollto=gdfrom-&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:48 scheme: "gdlookup" +Debug: 05-19 00:01:48 host: "localhost" +Debug: 05-19 00:01:48 clear current dictionaries: "納得が行く" +Debug: 05-19 00:01:48 some body finished +Debug: 05-19 00:01:48 one not finished. +Debug: 05-19 00:01:48 ====reading 1418 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:48 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:48 ====reading 0 of (1418) bytes . Finished: 0 +Debug: 05-19 00:01:48 some body finished +Debug: 05-19 00:01:48 one not finished. +Debug: 05-19 00:01:48 some body finished +Debug: 05-19 00:01:48 one not finished. +Debug: 05-19 00:01:48 some body finished +Debug: 05-19 00:01:48 one not finished. +Debug: 05-19 00:01:48 some body finished +Debug: 05-19 00:01:48 one finished. +Debug: 05-19 00:01:48 erasing.. +Debug: 05-19 00:01:48 erase done.. +Debug: 05-19 00:01:48 one finished. +Debug: 05-19 00:01:48 erasing.. +Debug: 05-19 00:01:48 erase done.. +Debug: 05-19 00:01:48 one finished. +Debug: 05-19 00:01:48 erasing.. +Debug: 05-19 00:01:48 erase done.. +Debug: 05-19 00:01:48 one finished. +Debug: 05-19 00:01:48 erasing.. +Debug: 05-19 00:01:48 erase done.. +Debug: 05-19 00:01:48 send dicts(finished): "groupId:1,word:納得が行く,dictId:9dfe38c28e4eb0d417245e761da52517,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:48 receive dicts, current word: "納得が行く" "納得が行く" : QList("9dfe38c28e4eb0d417245e761da52517", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:48 ====reading 8550 of (9968) bytes . Finished: 1 +Debug: 05-19 00:01:48 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:48 scheme: "gico" +Debug: 05-19 00:01:48 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:48 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:48 scheme: "bres" +Debug: 05-19 00:01:48 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:48 article view loaded url: "gdlookup://localhost/?word=納得が行く&group=1&scrollto=gdfrom-&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea" true +Debug: 05-19 00:01:49 open link url: QUrl("bword:が行") +Debug: 05-19 00:01:49 getResource: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:49 scheme: "gdlookup" +Debug: 05-19 00:01:49 host: "localhost" +Debug: 05-19 00:01:49 clear current dictionaries: "が行" +Debug: 05-19 00:01:49 some body finished +Debug: 05-19 00:01:49 one not finished. +Debug: 05-19 00:01:49 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:49 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:49 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:49 some body finished +Debug: 05-19 00:01:49 one not finished. +Debug: 05-19 00:01:49 some body finished +Debug: 05-19 00:01:49 one not finished. +Debug: 05-19 00:01:49 some body finished +Debug: 05-19 00:01:49 one not finished. +Debug: 05-19 00:01:49 some body finished +Debug: 05-19 00:01:49 one finished. +Debug: 05-19 00:01:49 erasing.. +Debug: 05-19 00:01:49 erase done.. +Debug: 05-19 00:01:49 one finished. +Debug: 05-19 00:01:49 erasing.. +Debug: 05-19 00:01:49 erase done.. +Debug: 05-19 00:01:49 one finished. +Debug: 05-19 00:01:49 erasing.. +Debug: 05-19 00:01:49 erase done.. +Debug: 05-19 00:01:49 one finished. +Debug: 05-19 00:01:49 erasing.. +Debug: 05-19 00:01:49 erase done.. +Debug: 05-19 00:01:49 send dicts(finished): "groupId:1,word:が行,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:49 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:01:49 receive dicts, current word: "が行" "が行" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:49 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:49 scheme: "gico" +Debug: 05-19 00:01:49 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:49 article view loaded url: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fff" true +Debug: 05-19 00:01:50 open link url: QUrl("bword:納得") +Debug: 05-19 00:01:50 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:50 scheme: "gdlookup" +Debug: 05-19 00:01:50 host: "localhost" +Debug: 05-19 00:01:50 clear current dictionaries: "納得" +Debug: 05-19 00:01:50 some body finished +Debug: 05-19 00:01:50 one not finished. +Debug: 05-19 00:01:50 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:50 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:50 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:50 some body finished +Debug: 05-19 00:01:50 one not finished. +Debug: 05-19 00:01:50 some body finished +Debug: 05-19 00:01:50 one not finished. +Debug: 05-19 00:01:50 some body finished +Debug: 05-19 00:01:50 one finished. +Debug: 05-19 00:01:50 erasing.. +Debug: 05-19 00:01:50 erase done.. +Debug: 05-19 00:01:50 one not finished. +Debug: 05-19 00:01:50 send dicts(updated): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:50 ====reading 3934 of (5343) bytes . Finished: 0 +Debug: 05-19 00:01:50 receive dicts, current word: "納得" "納得" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:50 ====reading 0 of (5343) bytes . Finished: 0 +Debug: 05-19 00:01:50 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:50 scheme: "gico" +Debug: 05-19 00:01:50 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:50 some body finished +Debug: 05-19 00:01:50 one finished. +Debug: 05-19 00:01:50 erasing.. +Debug: 05-19 00:01:50 erase done.. +Debug: 05-19 00:01:50 one finished. +Debug: 05-19 00:01:50 erasing.. +Debug: 05-19 00:01:50 erase done.. +Debug: 05-19 00:01:50 one finished. +Debug: 05-19 00:01:50 erasing.. +Debug: 05-19 00:01:50 erase done.. +Debug: 05-19 00:01:50 send dicts(finished): "groupId:1,word:納得,dictId:968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:50 receive dicts, current word: "納得" "納得" : QList("968c3a374ef50d74e019560ae8f69488", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:50 ====reading 10360 of (15703) bytes . Finished: 1 +Debug: 05-19 00:01:50 getResource: "bres://968c3a374ef50d74e019560ae8f69488/NHK日本語発音アクセント辞書.css" +Debug: 05-19 00:01:50 scheme: "bres" +Debug: 05-19 00:01:50 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:01:50 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:50 scheme: "gico" +Debug: 05-19 00:01:50 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:50 getResource: "gico://968c3a374ef50d74e019560ae8f69488/dicticon.png" +Debug: 05-19 00:01:50 scheme: "gico" +Debug: 05-19 00:01:50 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:01:50 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:50 scheme: "bres" +Debug: 05-19 00:01:50 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:50 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:50 scheme: "bres" +Debug: 05-19 00:01:50 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:50 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:50 scheme: "bres" +Debug: 05-19 00:01:50 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:50 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fff" true +Debug: 05-19 00:01:53 open link url: QUrl("bword:が行") +Debug: 05-19 00:01:53 getResource: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:53 scheme: "gdlookup" +Debug: 05-19 00:01:53 host: "localhost" +Debug: 05-19 00:01:53 clear current dictionaries: "が行" +Debug: 05-19 00:01:53 some body finished +Debug: 05-19 00:01:53 one not finished. +Debug: 05-19 00:01:53 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:53 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:53 some body finished +Debug: 05-19 00:01:53 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:53 one not finished. +Debug: 05-19 00:01:53 some body finished +Debug: 05-19 00:01:53 one not finished. +Debug: 05-19 00:01:53 some body finished +Debug: 05-19 00:01:53 one not finished. +Debug: 05-19 00:01:53 some body finished +Debug: 05-19 00:01:53 one finished. +Debug: 05-19 00:01:53 erasing.. +Debug: 05-19 00:01:53 erase done.. +Debug: 05-19 00:01:53 one finished. +Debug: 05-19 00:01:53 erasing.. +Debug: 05-19 00:01:53 erase done.. +Debug: 05-19 00:01:53 one finished. +Debug: 05-19 00:01:53 erasing.. +Debug: 05-19 00:01:53 erase done.. +Debug: 05-19 00:01:53 one finished. +Debug: 05-19 00:01:53 erasing.. +Debug: 05-19 00:01:53 erase done.. +Debug: 05-19 00:01:53 send dicts(finished): "groupId:1,word:が行,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:53 ====reading 3991 of (5400) bytes . Finished: 1 +Debug: 05-19 00:01:53 receive dicts, current word: "が行" "が行" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:53 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:53 scheme: "gico" +Debug: 05-19 00:01:53 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:53 article view loaded url: "gdlookup://localhost/?word=が行&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fff" true +Debug: 05-19 00:01:54 open link url: QUrl("bword:納得") +Debug: 05-19 00:01:54 getResource: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:54 scheme: "gdlookup" +Debug: 05-19 00:01:54 host: "localhost" +Debug: 05-19 00:01:54 clear current dictionaries: "納得" +Debug: 05-19 00:01:54 some body finished +Debug: 05-19 00:01:54 one not finished. +Debug: 05-19 00:01:54 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:54 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:54 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:54 some body finished +Debug: 05-19 00:01:54 one not finished. +Debug: 05-19 00:01:54 some body finished +Debug: 05-19 00:01:54 one not finished. +Debug: 05-19 00:01:54 some body finished +Debug: 05-19 00:01:54 one not finished. +Debug: 05-19 00:01:54 some body finished +Debug: 05-19 00:01:54 one finished. +Debug: 05-19 00:01:54 erasing.. +Debug: 05-19 00:01:54 erase done.. +Debug: 05-19 00:01:54 one finished. +Debug: 05-19 00:01:54 erasing.. +Debug: 05-19 00:01:54 erase done.. +Debug: 05-19 00:01:54 one finished. +Debug: 05-19 00:01:54 erasing.. +Debug: 05-19 00:01:54 erase done.. +Debug: 05-19 00:01:54 one finished. +Debug: 05-19 00:01:54 erasing.. +Debug: 05-19 00:01:54 erase done.. +Debug: 05-19 00:01:54 send dicts(finished): "groupId:1,word:納得,dictId:9dfe38c28e4eb0d417245e761da52517,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:54 receive dicts, current word: "納得" "納得" : QList("9dfe38c28e4eb0d417245e761da52517", "968c3a374ef50d74e019560ae8f69488", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:54 ====reading 14294 of (15703) bytes . Finished: 1 +Debug: 05-19 00:01:54 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:54 scheme: "gico" +Debug: 05-19 00:01:54 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:54 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:54 scheme: "bres" +Debug: 05-19 00:01:54 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:54 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:54 scheme: "bres" +Debug: 05-19 00:01:54 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:54 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:54 scheme: "bres" +Debug: 05-19 00:01:54 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:54 article view loaded url: "gdlookup://localhost/?word=納得&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fff" true +Debug: 05-19 00:01:56 getResource: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:56 scheme: "gdlookup" +Debug: 05-19 00:01:56 host: "localhost" +Debug: 05-19 00:01:56 clear current dictionaries: "ゆっくり" +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 ====reading 1415 of (1415) bytes . Finished: 0 +Debug: 05-19 00:01:56 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-19 00:01:56 ====reading 0 of (1415) bytes . Finished: 0 +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 send dicts(updated): "groupId:1,word:ゆっくり,dictId:9dfe38c28e4eb0d417245e761da52517,968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:01:56 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("9dfe38c28e4eb0d417245e761da52517", "968c3a374ef50d74e019560ae8f69488") +Debug: 05-19 00:01:56 ====reading 6975 of (8390) bytes . Finished: 0 +Debug: 05-19 00:01:56 ====reading 0 of (8390) bytes . Finished: 0 +Debug: 05-19 00:01:56 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:56 scheme: "gico" +Debug: 05-19 00:01:56 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 send dicts(finished): "groupId:1,word:ゆっくり,dictId:ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 receive dicts, current word: "ゆっくり" "ゆっくり" : QList("ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:56 ====reading 12849 of (21239) bytes . Finished: 1 +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:56 scheme: "gico" +Debug: 05-19 00:01:56 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:56 scheme: "bres" +Debug: 05-19 00:01:56 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:56 article view loaded url: "gdlookup://localhost/?word=ゆっくり&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbf" true +Debug: 05-19 00:01:56 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:56 scheme: "gdlookup" +Debug: 05-19 00:01:56 host: "localhost" +Debug: 05-19 00:01:56 clear current dictionaries: "転生したら剣でした" +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-19 00:01:56 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-19 00:01:56 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one not finished. +Debug: 05-19 00:01:56 some body finished +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 one finished. +Debug: 05-19 00:01:56 erasing.. +Debug: 05-19 00:01:56 erase done.. +Debug: 05-19 00:01:56 send dicts(finished): "groupId:1,word:転生したら剣でした,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:56 receive dicts, current word: "転生したら剣でした" "転生したら剣でした" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:56 ====reading 5340 of (6770) bytes . Finished: 1 +Debug: 05-19 00:01:56 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:56 scheme: "gico" +Debug: 05-19 00:01:56 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:56 article view loaded url: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf" true +Debug: 05-19 00:01:57 open link url: QUrl("bword:転生") +Debug: 05-19 00:01:57 getResource: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:57 scheme: "gdlookup" +Debug: 05-19 00:01:57 host: "localhost" +Debug: 05-19 00:01:57 clear current dictionaries: "転生" +Debug: 05-19 00:01:57 some body finished +Debug: 05-19 00:01:57 one not finished. +Debug: 05-19 00:01:57 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:57 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:57 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:57 some body finished +Debug: 05-19 00:01:57 one not finished. +Debug: 05-19 00:01:57 some body finished +Debug: 05-19 00:01:57 one not finished. +Debug: 05-19 00:01:57 some body finished +Debug: 05-19 00:01:57 one finished. +Debug: 05-19 00:01:57 erasing.. +Debug: 05-19 00:01:57 erase done.. +Debug: 05-19 00:01:57 one finished. +Debug: 05-19 00:01:57 erasing.. +Debug: 05-19 00:01:57 erase done.. +Debug: 05-19 00:01:57 one not finished. +Debug: 05-19 00:01:57 send dicts(updated): "groupId:1,word:転生,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:57 receive dicts, current word: "転生" "転生" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:57 ====reading 5283 of (6692) bytes . Finished: 0 +Debug: 05-19 00:01:57 ====reading 0 of (6692) bytes . Finished: 0 +Debug: 05-19 00:01:57 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:57 scheme: "gico" +Debug: 05-19 00:01:57 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:58 some body finished +Debug: 05-19 00:01:58 one finished. +Debug: 05-19 00:01:58 erasing.. +Debug: 05-19 00:01:58 erase done.. +Debug: 05-19 00:01:58 one finished. +Debug: 05-19 00:01:58 erasing.. +Debug: 05-19 00:01:58 erase done.. +Debug: 05-19 00:01:58 send dicts(finished): "groupId:1,word:転生,dictId:ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:58 receive dicts, current word: "転生" "転生" : QList("ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:58 ====reading 7296 of (13988) bytes . Finished: 1 +Debug: 05-19 00:01:58 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:58 scheme: "bres" +Debug: 05-19 00:01:58 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:58 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:58 scheme: "gico" +Debug: 05-19 00:01:58 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:58 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:58 scheme: "bres" +Debug: 05-19 00:01:58 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:58 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:58 scheme: "bres" +Debug: 05-19 00:01:58 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:58 article view loaded url: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cf" true +Debug: 05-19 00:01:58 open link url: QUrl("bword:したら") +Debug: 05-19 00:01:58 getResource: "gdlookup://localhost/?word=したら&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:58 scheme: "gdlookup" +Debug: 05-19 00:01:58 host: "localhost" +Debug: 05-19 00:01:58 clear current dictionaries: "したら" +Debug: 05-19 00:01:58 some body finished +Debug: 05-19 00:01:58 one not finished. +Debug: 05-19 00:01:58 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-19 00:01:58 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-19 00:01:58 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-19 00:01:58 some body finished +Debug: 05-19 00:01:58 one not finished. +Debug: 05-19 00:01:58 some body finished +Debug: 05-19 00:01:58 one not finished. +Debug: 05-19 00:01:58 some body finished +Debug: 05-19 00:01:58 one not finished. +Debug: 05-19 00:01:58 some body finished +Debug: 05-19 00:01:58 one finished. +Debug: 05-19 00:01:58 erasing.. +Debug: 05-19 00:01:58 erase done.. +Debug: 05-19 00:01:58 one finished. +Debug: 05-19 00:01:58 erasing.. +Debug: 05-19 00:01:58 erase done.. +Debug: 05-19 00:01:58 one finished. +Debug: 05-19 00:01:58 erasing.. +Debug: 05-19 00:01:58 erase done.. +Debug: 05-19 00:01:58 one finished. +Debug: 05-19 00:01:58 erasing.. +Debug: 05-19 00:01:58 erase done.. +Debug: 05-19 00:01:58 send dicts(finished): "groupId:1,word:したら,dictId:9dfe38c28e4eb0d417245e761da52517,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:58 receive dicts, current word: "したら" "したら" : QList("9dfe38c28e4eb0d417245e761da52517", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:01:58 ====reading 7529 of (8941) bytes . Finished: 1 +Debug: 05-19 00:01:58 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:58 scheme: "gico" +Debug: 05-19 00:01:58 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:58 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:01:58 scheme: "bres" +Debug: 05-19 00:01:58 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:01:58 article view loaded url: "gdlookup://localhost/?word=したら&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259ff" true +Debug: 05-19 00:01:59 open link url: QUrl("bword:でし") +Debug: 05-19 00:01:59 getResource: "gdlookup://localhost/?word=でし&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:01:59 scheme: "gdlookup" +Debug: 05-19 00:01:59 host: "localhost" +Debug: 05-19 00:01:59 clear current dictionaries: "でし" +Debug: 05-19 00:01:59 some body finished +Debug: 05-19 00:01:59 one not finished. +Debug: 05-19 00:01:59 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:59 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:59 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:01:59 some body finished +Debug: 05-19 00:01:59 one not finished. +Debug: 05-19 00:01:59 some body finished +Debug: 05-19 00:01:59 one finished. +Debug: 05-19 00:01:59 erasing.. +Debug: 05-19 00:01:59 erase done.. +Debug: 05-19 00:01:59 one not finished. +Debug: 05-19 00:01:59 send dicts(updated): "groupId:1,word:でし,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:01:59 receive dicts, current word: "でし" "でし" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:01:59 ====reading 5283 of (6692) bytes . Finished: 0 +Debug: 05-19 00:01:59 ====reading 0 of (6692) bytes . Finished: 0 +Debug: 05-19 00:01:59 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:01:59 scheme: "gico" +Debug: 05-19 00:01:59 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:04 some body finished +Debug: 05-19 00:02:04 one finished. +Debug: 05-19 00:02:04 erasing.. +Debug: 05-19 00:02:04 erase done.. +Debug: 05-19 00:02:04 one not finished. +Debug: 05-19 00:02:04 send dicts(updated): "groupId:1,word:でし,dictId:968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:02:04 receive dicts, current word: "でし" "でし" : QList("968c3a374ef50d74e019560ae8f69488") +Debug: 05-19 00:02:04 ====reading 2954 of (9646) bytes . Finished: 0 +Debug: 05-19 00:02:04 ====reading 0 of (9646) bytes . Finished: 0 +Debug: 05-19 00:02:04 some body finished +Debug: 05-19 00:02:04 one finished. +Debug: 05-19 00:02:04 erasing.. +Debug: 05-19 00:02:04 erase done.. +Debug: 05-19 00:02:04 one finished. +Debug: 05-19 00:02:04 erasing.. +Debug: 05-19 00:02:04 erase done.. +Debug: 05-19 00:02:04 send dicts(finished): "groupId:1,word:でし,dictId:ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:04 receive dicts, current word: "でし" "でし" : QList("ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:02:04 ====reading 5558 of (15204) bytes . Finished: 1 +Debug: 05-19 00:02:07 getResource: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:02:07 scheme: "gdlookup" +Debug: 05-19 00:02:07 host: "localhost" +Debug: 05-19 00:02:07 clear current dictionaries: "転生したら剣でした" +Debug: 05-19 00:02:07 some body finished +Debug: 05-19 00:02:07 one not finished. +Debug: 05-19 00:02:07 ====reading 1430 of (1430) bytes . Finished: 0 +Debug: 05-19 00:02:07 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-19 00:02:07 ====reading 0 of (1430) bytes . Finished: 0 +Debug: 05-19 00:02:07 some body finished +Debug: 05-19 00:02:07 one not finished. +Debug: 05-19 00:02:07 some body finished +Debug: 05-19 00:02:07 one not finished. +Debug: 05-19 00:02:07 some body finished +Debug: 05-19 00:02:07 one not finished. +Debug: 05-19 00:02:07 some body finished +Debug: 05-19 00:02:07 one finished. +Debug: 05-19 00:02:07 erasing.. +Debug: 05-19 00:02:07 erase done.. +Debug: 05-19 00:02:07 one finished. +Debug: 05-19 00:02:07 erasing.. +Debug: 05-19 00:02:07 erase done.. +Debug: 05-19 00:02:07 one finished. +Debug: 05-19 00:02:07 erasing.. +Debug: 05-19 00:02:07 erase done.. +Debug: 05-19 00:02:07 one finished. +Debug: 05-19 00:02:07 erasing.. +Debug: 05-19 00:02:07 erase done.. +Debug: 05-19 00:02:07 send dicts(finished): "groupId:1,word:転生したら剣でした,dictId:9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:07 receive dicts, current word: "転生したら剣でした" "転生したら剣でした" : QList("9dfe38c28e4eb0d417245e761da52517") +Debug: 05-19 00:02:07 ====reading 5340 of (6770) bytes . Finished: 1 +Debug: 05-19 00:02:07 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:02:07 scheme: "gico" +Debug: 05-19 00:02:07 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:07 article view loaded url: "gdlookup://localhost/?word=転生したら剣でした&group=1&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf" true +Debug: 05-19 00:02:08 open link url: QUrl("bword:転生") +Debug: 05-19 00:02:08 getResource: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:02:08 scheme: "gdlookup" +Debug: 05-19 00:02:08 host: "localhost" +Debug: 05-19 00:02:08 clear current dictionaries: "転生" +Debug: 05-19 00:02:08 some body finished +Debug: 05-19 00:02:08 one not finished. +Debug: 05-19 00:02:08 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:08 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:08 some body finished +Debug: 05-19 00:02:08 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:08 one not finished. +Debug: 05-19 00:02:08 some body finished +Debug: 05-19 00:02:08 one not finished. +Debug: 05-19 00:02:08 some body finished +Debug: 05-19 00:02:08 one not finished. +Debug: 05-19 00:02:08 some body finished +Debug: 05-19 00:02:08 one finished. +Debug: 05-19 00:02:08 erasing.. +Debug: 05-19 00:02:08 erase done.. +Debug: 05-19 00:02:08 one finished. +Debug: 05-19 00:02:08 erasing.. +Debug: 05-19 00:02:08 erase done.. +Debug: 05-19 00:02:08 one finished. +Debug: 05-19 00:02:08 erasing.. +Debug: 05-19 00:02:08 erase done.. +Debug: 05-19 00:02:08 one finished. +Debug: 05-19 00:02:08 erasing.. +Debug: 05-19 00:02:08 erase done.. +Debug: 05-19 00:02:08 send dicts(finished): "groupId:1,word:転生,dictId:9dfe38c28e4eb0d417245e761da52517,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:08 receive dicts, current word: "転生" "転生" : QList("9dfe38c28e4eb0d417245e761da52517", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:02:08 ====reading 12579 of (13988) bytes . Finished: 1 +Debug: 05-19 00:02:08 getResource: "bres://ec855a5ed10fb99483666514453d9bac/jm_pt.css" +Debug: 05-19 00:02:08 scheme: "bres" +Debug: 05-19 00:02:08 host: "ec855a5ed10fb99483666514453d9bac" +Debug: 05-19 00:02:08 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:02:08 scheme: "gico" +Debug: 05-19 00:02:08 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:08 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.css" +Debug: 05-19 00:02:08 scheme: "bres" +Debug: 05-19 00:02:08 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:08 getResource: "gico://ec855a5ed10fb99483666514453d9bac/dicticon.png" +Debug: 05-19 00:02:08 scheme: "gico" +Debug: 05-19 00:02:08 host: "ec855a5ed10fb99483666514453d9bac" +Debug: 05-19 00:02:08 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:08 scheme: "bres" +Debug: 05-19 00:02:08 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:08 getResource: "gico://b1e3f422135b95f15c0225ae27692050/dicticon.png" +Debug: 05-19 00:02:08 scheme: "gico" +Debug: 05-19 00:02:08 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:09 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:09 scheme: "bres" +Debug: 05-19 00:02:09 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:09 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:09 scheme: "bres" +Debug: 05-19 00:02:09 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:09 article view loaded url: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cf" true +Debug: 05-19 00:02:10 open link url: QUrl("bword:したら") +Debug: 05-19 00:02:10 getResource: "gdlookup://localhost/?word=したら&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:02:10 scheme: "gdlookup" +Debug: 05-19 00:02:10 host: "localhost" +Debug: 05-19 00:02:10 clear current dictionaries: "したら" +Debug: 05-19 00:02:10 some body finished +Debug: 05-19 00:02:10 one not finished. +Debug: 05-19 00:02:10 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-19 00:02:10 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-19 00:02:10 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-19 00:02:10 some body finished +Debug: 05-19 00:02:10 one not finished. +Debug: 05-19 00:02:10 some body finished +Debug: 05-19 00:02:10 one not finished. +Debug: 05-19 00:02:10 some body finished +Debug: 05-19 00:02:10 one not finished. +Debug: 05-19 00:02:10 some body finished +Debug: 05-19 00:02:10 one finished. +Debug: 05-19 00:02:10 erasing.. +Debug: 05-19 00:02:10 erase done.. +Debug: 05-19 00:02:10 one finished. +Debug: 05-19 00:02:10 erasing.. +Debug: 05-19 00:02:10 erase done.. +Debug: 05-19 00:02:10 one finished. +Debug: 05-19 00:02:10 erasing.. +Debug: 05-19 00:02:10 erase done.. +Debug: 05-19 00:02:10 one finished. +Debug: 05-19 00:02:10 erasing.. +Debug: 05-19 00:02:10 erase done.. +Debug: 05-19 00:02:10 send dicts(finished): "groupId:1,word:したら,dictId:9dfe38c28e4eb0d417245e761da52517,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:10 receive dicts, current word: "したら" "したら" : QList("9dfe38c28e4eb0d417245e761da52517", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:02:10 ====reading 7529 of (8941) bytes . Finished: 1 +Debug: 05-19 00:02:10 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:02:10 scheme: "gico" +Debug: 05-19 00:02:10 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:10 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:10 scheme: "bres" +Debug: 05-19 00:02:10 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:10 article view loaded url: "gdlookup://localhost/?word=したら&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259ff" true +Debug: 05-19 00:02:12 open link url: QUrl("bword:転生") +Debug: 05-19 00:02:12 getResource: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:02:12 scheme: "gdlookup" +Debug: 05-19 00:02:12 host: "localhost" +Debug: 05-19 00:02:12 clear current dictionaries: "転生" +Debug: 05-19 00:02:12 some body finished +Debug: 05-19 00:02:12 one not finished. +Debug: 05-19 00:02:12 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:12 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:12 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:12 some body finished +Debug: 05-19 00:02:12 one not finished. +Debug: 05-19 00:02:12 some body finished +Debug: 05-19 00:02:12 one not finished. +Debug: 05-19 00:02:12 some body finished +Debug: 05-19 00:02:12 one not finished. +Debug: 05-19 00:02:12 some body finished +Debug: 05-19 00:02:12 one finished. +Debug: 05-19 00:02:12 erasing.. +Debug: 05-19 00:02:12 erase done.. +Debug: 05-19 00:02:12 one finished. +Debug: 05-19 00:02:12 erasing.. +Debug: 05-19 00:02:12 erase done.. +Debug: 05-19 00:02:12 one finished. +Debug: 05-19 00:02:12 erasing.. +Debug: 05-19 00:02:12 erase done.. +Debug: 05-19 00:02:12 one finished. +Debug: 05-19 00:02:12 erasing.. +Debug: 05-19 00:02:12 erase done.. +Debug: 05-19 00:02:12 send dicts(finished): "groupId:1,word:転生,dictId:9dfe38c28e4eb0d417245e761da52517,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:12 ====reading 12579 of (13988) bytes . Finished: 1 +Debug: 05-19 00:02:12 receive dicts, current word: "転生" "転生" : QList("9dfe38c28e4eb0d417245e761da52517", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:02:12 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:02:12 scheme: "gico" +Debug: 05-19 00:02:12 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:12 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:12 scheme: "bres" +Debug: 05-19 00:02:12 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:12 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:12 scheme: "bres" +Debug: 05-19 00:02:12 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:12 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:12 scheme: "bres" +Debug: 05-19 00:02:12 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:12 article view loaded url: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fff" true +Debug: 05-19 00:02:14 open link url: QUrl("bword:でし") +Debug: 05-19 00:02:14 getResource: "gdlookup://localhost/?word=でし&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:02:14 scheme: "gdlookup" +Debug: 05-19 00:02:14 host: "localhost" +Debug: 05-19 00:02:14 clear current dictionaries: "でし" +Debug: 05-19 00:02:14 some body finished +Debug: 05-19 00:02:14 one not finished. +Debug: 05-19 00:02:14 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:14 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:14 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:14 some body finished +Debug: 05-19 00:02:14 one not finished. +Debug: 05-19 00:02:14 some body finished +Debug: 05-19 00:02:14 one not finished. +Debug: 05-19 00:02:14 some body finished +Debug: 05-19 00:02:14 one not finished. +Debug: 05-19 00:02:14 some body finished +Debug: 05-19 00:02:14 one finished. +Debug: 05-19 00:02:14 erasing.. +Debug: 05-19 00:02:14 erase done.. +Debug: 05-19 00:02:14 one finished. +Debug: 05-19 00:02:14 erasing.. +Debug: 05-19 00:02:14 erase done.. +Debug: 05-19 00:02:14 one finished. +Debug: 05-19 00:02:14 erasing.. +Debug: 05-19 00:02:14 erase done.. +Debug: 05-19 00:02:14 one finished. +Debug: 05-19 00:02:14 erasing.. +Debug: 05-19 00:02:14 erase done.. +Debug: 05-19 00:02:14 send dicts(finished): "groupId:1,word:でし,dictId:9dfe38c28e4eb0d417245e761da52517,968c3a374ef50d74e019560ae8f69488,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:14 ====reading 13795 of (15204) bytes . Finished: 1 +Debug: 05-19 00:02:14 receive dicts, current word: "でし" "でし" : QList("9dfe38c28e4eb0d417245e761da52517", "968c3a374ef50d74e019560ae8f69488", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:02:14 getResource: "bres://968c3a374ef50d74e019560ae8f69488/NHK日本語発音アクセント辞書.css" +Debug: 05-19 00:02:14 scheme: "bres" +Debug: 05-19 00:02:14 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:02:14 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:02:14 scheme: "gico" +Debug: 05-19 00:02:14 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:14 getResource: "gico://968c3a374ef50d74e019560ae8f69488/dicticon.png" +Debug: 05-19 00:02:14 scheme: "gico" +Debug: 05-19 00:02:14 host: "968c3a374ef50d74e019560ae8f69488" +Debug: 05-19 00:02:14 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:14 scheme: "bres" +Debug: 05-19 00:02:14 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:14 article view loaded url: "gdlookup://localhost/?word=でし&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fff" true +Debug: 05-19 00:02:16 open link url: QUrl("bword:転生") +Debug: 05-19 00:02:16 getResource: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:02:16 scheme: "gdlookup" +Debug: 05-19 00:02:16 host: "localhost" +Debug: 05-19 00:02:16 clear current dictionaries: "転生" +Debug: 05-19 00:02:16 some body finished +Debug: 05-19 00:02:16 one not finished. +Debug: 05-19 00:02:16 ====reading 1409 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:16 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:16 some body finished +Debug: 05-19 00:02:16 ====reading 0 of (1409) bytes . Finished: 0 +Debug: 05-19 00:02:16 one not finished. +Debug: 05-19 00:02:16 some body finished +Debug: 05-19 00:02:16 one not finished. +Debug: 05-19 00:02:16 some body finished +Debug: 05-19 00:02:16 one not finished. +Debug: 05-19 00:02:16 some body finished +Debug: 05-19 00:02:16 one finished. +Debug: 05-19 00:02:16 erasing.. +Debug: 05-19 00:02:16 erase done.. +Debug: 05-19 00:02:16 one finished. +Debug: 05-19 00:02:16 erasing.. +Debug: 05-19 00:02:16 erase done.. +Debug: 05-19 00:02:16 one finished. +Debug: 05-19 00:02:16 erasing.. +Debug: 05-19 00:02:16 erase done.. +Debug: 05-19 00:02:16 one finished. +Debug: 05-19 00:02:16 erasing.. +Debug: 05-19 00:02:16 erase done.. +Debug: 05-19 00:02:16 send dicts(finished): "groupId:1,word:転生,dictId:9dfe38c28e4eb0d417245e761da52517,ec855a5ed10fb99483666514453d9bac,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:16 receive dicts, current word: "転生" "転生" : QList("9dfe38c28e4eb0d417245e761da52517", "ec855a5ed10fb99483666514453d9bac", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:02:16 ====reading 12579 of (13988) bytes . Finished: 1 +Debug: 05-19 00:02:16 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:02:16 scheme: "gico" +Debug: 05-19 00:02:16 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:16 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:16 scheme: "bres" +Debug: 05-19 00:02:16 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:16 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:16 scheme: "bres" +Debug: 05-19 00:02:16 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:16 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:16 scheme: "bres" +Debug: 05-19 00:02:16 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:16 article view loaded url: "gdlookup://localhost/?word=転生&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fff" true +Debug: 05-19 00:02:43 open link url: QUrl("bword:したら") +Debug: 05-19 00:02:43 getResource: "gdlookup://localhost/?word=したら&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259fffdd76764f7431170eeb89a0f9,27ea5cfecf6d68fdf7dcbfd8df6f06f7,156e4c2d5407db4c7dc6af55617b6d87,23bf0ce06d2b68a076557b4c34cf1a74" +Debug: 05-19 00:02:43 scheme: "gdlookup" +Debug: 05-19 00:02:43 host: "localhost" +Debug: 05-19 00:02:43 clear current dictionaries: "したら" +Debug: 05-19 00:02:43 some body finished +Debug: 05-19 00:02:43 one not finished. +Debug: 05-19 00:02:43 ====reading 1412 of (1412) bytes . Finished: 0 +Debug: 05-19 00:02:43 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-19 00:02:43 ====reading 0 of (1412) bytes . Finished: 0 +Debug: 05-19 00:02:43 some body finished +Debug: 05-19 00:02:43 one not finished. +Debug: 05-19 00:02:43 some body finished +Debug: 05-19 00:02:43 one not finished. +Debug: 05-19 00:02:43 some body finished +Debug: 05-19 00:02:43 one not finished. +Debug: 05-19 00:02:43 some body finished +Debug: 05-19 00:02:43 one finished. +Debug: 05-19 00:02:43 erasing.. +Debug: 05-19 00:02:43 erase done.. +Debug: 05-19 00:02:43 one finished. +Debug: 05-19 00:02:43 erasing.. +Debug: 05-19 00:02:43 erase done.. +Debug: 05-19 00:02:43 one finished. +Debug: 05-19 00:02:43 erasing.. +Debug: 05-19 00:02:43 erase done.. +Debug: 05-19 00:02:43 one finished. +Debug: 05-19 00:02:43 erasing.. +Debug: 05-19 00:02:43 erase done.. +Debug: 05-19 00:02:43 send dicts(finished): "groupId:1,word:したら,dictId:9dfe38c28e4eb0d417245e761da52517,b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:43 receive dicts, current word: "したら" "したら" : QList("9dfe38c28e4eb0d417245e761da52517", "b1e3f422135b95f15c0225ae27692050") +Debug: 05-19 00:02:43 ====reading 7529 of (8941) bytes . Finished: 1 +Debug: 05-19 00:02:43 getResource: "gico://9dfe38c28e4eb0d417245e761da52517/dicticon.png" +Debug: 05-19 00:02:43 scheme: "gico" +Debug: 05-19 00:02:43 host: "9dfe38c28e4eb0d417245e761da52517" +Debug: 05-19 00:02:43 getResource: "bres://b1e3f422135b95f15c0225ae27692050/fj.js" +Debug: 05-19 00:02:43 scheme: "bres" +Debug: 05-19 00:02:43 host: "b1e3f422135b95f15c0225ae27692050" +Debug: 05-19 00:02:43 article view loaded url: "gdlookup://localhost/?word=したら&group=1&scrollto=gdfrom-9dfe38c28e4eb0d417245e761da52517&muted=00824c93f503c5d1680483abdf367948,6dac50cdfb3265d22b966313a1d228b7,5a560bd16b0c6cbd714faf0c388ae098,90259ff" true diff --git a/.config/goldendict/styles/article-style.css b/.config/goldendict/styles/article-style.css new file mode 100644 index 0000000..90ab372 --- /dev/null +++ b/.config/goldendict/styles/article-style.css @@ -0,0 +1,24 @@ +/* Add padding and a horizontal bar between each entry for the sake of readability */ +.mdict { + border-top: 0.15em solid #c4c4c4; + margin-bottom: 0.5em; + padding-top: 0.5em; +} +.gddictname { + position: relative; + z-index: 9; + margin-bottom: -0.16em; +} +/* Remove duplicate headers in EPWING dictionaries. */ +.epwing_article h3 { + display: none; +} +.epwing_text:first-line { + text-indent: -1em; +} +.epwing_text { + padding-top: 0.5em; + padding-left: 1em; + border-top: 0.15em solid #c4c4c4; + margin-bottom: 0.5em; +} diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 72f26af..ca7ce07 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -1,6 +1,8 @@ +text_gamma_adjustment 1.7 +text_contrast 30 font_size 10 -background_opacity 0.6 +#background_opacity 0.6 # Enable GPU rendering force_bitmap yes # Enable antialiasing diff --git a/.config/lf/lfrc b/.config/lf/lfrc index c651c80..ed8e4fb 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -8,6 +8,19 @@ set sortby name; set info set sortby time; set info time +if %pwd == *'screenshots' {set sortby time; set info time; set reverse; set nodirfirst; } else {set sortby natural; set info ;} + + +# Share on telegram +cmd send ${{ + wmctrl -x -a TelegramDesktop + telegram-desktop -sendpath \ + $(for file in $fx; do readlink -f $file; done) +}} + +map : send + + cmd copy_filename ${{ clean_filename=$(basename "$f") @@ -16,4 +29,6 @@ cmd copy_filename ${{ }} # Map a key to call the copy_filename function -map : copy_filename \ No newline at end of file +map : copy_filename + +# Use C-S-g to go to the bottom/end diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf new file mode 100644 index 0000000..6965e23 --- /dev/null +++ b/.config/mpv/input.conf @@ -0,0 +1,60 @@ +# mpv keybindings + +# Increase / decrease subtitle font size +# https://www.reddit.com/r/mpv/comments/dg5yzj/trouble_decreasing_subtitles_size/ +/ add sub-scale +0.1 +? add sub-scale -0.1 + +# AO volume controls (numpad): +#+ add ao-volume 2 +#- add ao-volume -2 + +# Cycle video aspect ratios; "-1" is the container aspect +A cycle-values video-aspect "16:9" "16:10" "4:3" "2.35:1" "-1" + +# Vim-like seeking +l seek 5 +h seek -5 +j seek -60 +k seek 60 + +# Cycle between subtitle files +K cycle sub +J cycle sub down + +# Skip to previous/next subtitle line (disabled - use mpvacioius) +#H no-osd sub-seek -1 +#L no-osd sub-seek 1 + +# Search sub-text on Jisho.org +# https://github.com/mpv-player/mpv/issues/4695#issuecomment-609876072 +#Ctrl+j run "/bin/sh" "-c" "xdg-open 'https://jisho.org/search?keyword=${sub-text}'" + + + +# skip to next/previous file +> playlist-next +< playlist-prev + +# Add/subtract 50 ms delay from subs +Z add sub-delay +0.05 +z add sub-delay -0.05 +D add sub-delay -92.3 +A add sub-delay -152 + +# Adjust timing to previous/next subtitle +X sub-step 1 +x sub-step -1 + +Ctrl+r set sub-delay 0 + +o show-progress + + + + + +V script-binding visibility + +Ctrl+b run "/bin/sh" "-c" "impd add '${=path}'" + diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 8e49eda..e12a472 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -1,8 +1,8 @@ sub-font-size=30 sub-pos=13 -sub-font='~/.fonts/Motomachi-Regular.ttf' +#sub-font='~/.fonts/Motomachi-Regular.ttf' sub-fontconfig=no -sub-font="Motomachi" +sub-font="Calex Code JP" sub-antialiasing=yes sub-text-outline=0.5 @@ -14,11 +14,36 @@ ass-right-margin=50 screenshot-format=png +screenshot-high-bit-depth=yes +screenshot-png-compression=7 # this requires a lot of cpu screenshot-directory=/mnt/Data/mpv-screenshots/ +input-cursor=no +# then we gonna need this: +# Keybinding to cycle through available audio dubs +ALT+a cycle audio +# Keybinding to cycle through available subtitles +ALT+s cycle sub + + +# youtube + +ytdl-format=bestvideo[height<=?720p]+bestaudio/best + +##### + +## watching videos without getting drowsy +gpu-context=winvk +video-sync=display-resample +display-fps=23 +fps=23 +vf-add=fps=23:round=near + + +# demuxer-thread=yes -demuxer-rawvideo-fps=60 +demuxer-rawvideo-fps=23 demuxer-rawaudio-rate=384000 @@ -30,11 +55,13 @@ z add sub-delay -0.05 D add sub-delay -8900 -# audio normalization -af=lavfi=[dynaudnorm=f=75:g=25:p=0.55] -lavfi=[loudnorm=I=-22:TP=-1.5:LRA=2] + gpu-api=vulkan +vulkan-async-compute=yes +vulkan-async-transfer=yes +vulkan-queue-count=1 + #vo=vaapi @@ -44,10 +71,42 @@ lavfi-complex=vid.vd-lavc-threads=16 # Set cache to avoid lag -cache=yes +#cache=yes # Limit the amount of data demuxed (read from the file) ahead of playback -demuxer-max-bytes=700M +#demuxer-max-bytes=700M + +# shaders +glsl-shader=~~/shaders/Anime4K_Deblur_Original.glsl +glsl-shader=~~/shaders/ravu-r4.hook + +# Set the desired window size +window-scale=2.0 + +# Force video to upscale to at least 2k +vf=scale=w=2048:h=1080:flags=lanczos + +# Set the desired window size (optional, adjust as needed) +geometry=2048x1080 + +# Enable video upscaling +scale=ewa_lanczos + +# Enable higher quality scaling when upscaling +cscale=ewa_lanczos + +# audio +# audio normalization +#af=lavfi=[dynaudnorm=f=75:g=25:p=0.55] +#lavfi=[loudnorm=I=-22:TP=-1.5:LRA=2] + +# BGR +sub-font-size=35 +sub-border-size=1.5 +sub-color="#ffffff" +sub-border-color="#000000" +sub-align-y=24 +sub-ass-force-style=FontName='Calex Code JP',FontSize=48,Outline=0.5,PrimaryColour=&Hffffff&,SecondaryColour=&H000000&,OutlineColour=&H000000&,BackColour=&H000000&,Alignment=2 diff --git a/.config/mpv/script-opts/subs2srs.conf b/.config/mpv/script-opts/subs2srs.conf new file mode 100644 index 0000000..01376ad --- /dev/null +++ b/.config/mpv/script-opts/subs2srs.conf @@ -0,0 +1,271 @@ +### +### Main mpvacious configuration file. +### Save this file to ~/.config/mpv/script-opts/subs2srs.conf +### + +## +## General settings +## + +# Anki deck for new cards. Subdecks are supported. +deck_name=Mining + +# Model names are listed in `Tools -> Manage note types` menu in Anki. +# If you don't have a model for Japanese, get it from +# https://tatsumoto.neocities.org/blog/setting-up-anki.html#import-an-example-mining-deck +model_name=Japanese sentences + +# Field names as they appear in the selected note type. +# If you set `audio_field` or `image_field` empty, +# the corresponding media file will not be created. +sentence_field=SentKanji +secondary_field=SentEng +audio_field=SentAudio +image_field=Image + +# The tag(s) added to new notes. Spaces separate multiple tags. +# Leave nothing after `=` to disable tagging completely. +# The following substitutions are supported: +# %n - the name of the video +# %t - timestamp +# %d - episode number (if none, returns nothing) +# %e - SUBS2SRS_TAGS environment variable (if you have it set) +note_tag=subs2srs +#note_tag=%n %t %e +#note_tag= + +# Size and name of the font used in the menu +menu_font_size=24 +menu_font_name=Noto Serif CJK JP + +## +## Toggleables. +## Possible values: `yes` or `no`. +## + +# Use FFmpeg encoder instead of mpv encoder +# If mpvacious encounters problems creating audio and images for Anki cards, +# setting this to `yes` should fix them. +# +# You need to install ffmpeg and add it to the PATH first. +# https://wiki.archlinux.org/title/FFmpeg +# https://www.ffmpeg.org/download.html +# +# FFmpeg encoder is unable to create audio and images from remote content (like YouTube videos). +use_ffmpeg=no + +# Automatically create the deck for new cards (see deck_name option) +create_deck=yes + +# Allow making notes with the same sentence field. +allow_duplicates=no + +# When mpv starts, automatically copy subs to the clipboard as they appear on screen. +# This option can be also toggled in the addon's OSD menu. +autoclip=yes + +# Command to run when autoclip is triggered. +# If empty, just copies text to the clipboard. +# If set, calls the external program. +# E.g., even though GoldenDict can watch the system clipboard, +# if you send subtitles directly to GoldenDict, you don't pollute the clipboard as much. +autoclip_command=goldendict +#autoclip_command=goldendict + +# Remove all spaces from the primary subtitle text. +# Set this to "yes" for languages without spaces like Japanese. +# However, if mpvacious detects any latin characters in the string, spaces will not be removed. +nuke_spaces=yes + +# if set to `yes`, the volume of the outputted audio file +# depends on the volume of the player at the time of export +tie_volumes=no + +# Remove text in parentheses and leading/trailing spaces or +# newlines that may interfere with Yomichan before copying +# subtitles to the clipboard +clipboard_trim_enabled=yes + +# Add media to fields before or after existing data +append_media=yes + +# Remove text in brackets before substituting %n into tag +tag_nuke_brackets=yes + +# Remove text in brackets before substituting %n into tag +tag_nuke_parentheses=no + +# Remove the episode number before substituting %n into tag +tag_del_episode_num=yes + +# Remove everything after the episode number before substituting %n into tag +# Does nothing if the previous option tag_del_episode_num is disabled. +tag_del_after_episode_num=yes + +# Convert filename to lowercase for tagging. +tag_filename_lowercase=no + +# Lets you disable anki browser manipulation by mpvacious. +disable_gui_browse=no + +# Play audio clip automatically in background +# after note creation (or note update) to ensure that the audio is correctly cut. +preview_audio=no + +# When selecting subtitle lines, print them on the screen. +show_selected_text=yes + +# For convenience, read config file from disk before a card is made. +# Useful if you change your config often since you won't have to restart mpv every time, +# but reading from disk takes some time. +reload_config_before_card_creation=yes + +## +## Image settings +## + +# Snapshot format. +# Do not switch to `jpg` unless your computer doesn't support `webp`. +snapshot_format=webp +#snapshot_format=jpg + +# Quality of produced image files. 0 = lowest, 100=highest. +snapshot_quality=15 + +# Image dimensions +# If either (but not both) of the width or height parameters is -2, +# the value will be calculated preserving the aspect-ratio. +snapshot_width=-2 +snapshot_height=200 + +# Screenshot (yes, no) +# Usually not required. +# When making Anki cards, create a screenshot (by calling 'screenshot-to-file') instead of a snapshot. +# If set to yes, image dimensions and quality cannot be controlled due to mpv limitations. +# 'snapshot_format' is still respected. +# When using this, a custom sync server is recommended, e.g. https://github.com/ankicommunity/anki-sync-server +screenshot=no + +# The exact image template used when exporting to Anki's image field. +# Adding data-editor-shrink="true" makes the image smaller by default within the Anki viewer +# on versions 2.1.53+ (equivalent of double-clicking on the image). +# You likely would not want to change this unless you know what you are doing. +image_template=snapshot +#image_template=snapshot + +# Similar to image_template but with audio. +# Normally, the user doesn't need to change this setting, +# but it may be needed for audio files to be playable on AnkiWeb. +audio_template=[sound:%s] +#audio_template= + +## +## Animated snapshots +## Animated snapshots will capture the video from the start to the end times selected when using mpvacious. +## + +# If enabled, generates animated snapshots (something like GIFs) instead of static snapshots. +animated_snapshot_enabled=no + +# Number of frame per seconds, a value between 0 and 30 (30 included) +# Higher values will increase both quality and file size, lower values will do the opposite +animated_snapshot_fps=10 + +# Animated snapshot dimensions +# If either (but not both) of the width or height parameters is -2, +# the value will be calculated preserving the aspect-ratio. +animated_snapshot_width=-2 +animated_snapshot_height=200 + +# Quality of the produced animation, 0 = lowest, 100 = highest +animated_snapshot_quality=5 + +## +## Audio settings +## + +# Audio format. +# Do not switch to `mp3` unless your computer doesn't support `opus`. +audio_format=opus +#audio_format=mp3 + +# Sane values are 16k-32k for opus, 64k-128k for mp3. +audio_bitrate=24k + +# Set a pad to the dialog timings. 0.5 = half a second. +# Pads are never applied to manually set timings. +audio_padding=0.0 +#audio_padding=0.5 + +## +## Forvo support (Yomichan users only) +## + +# yes - fetch audio from Forvo if Yomichan couldn't find the audio (default) +# always - always fetch audio from Forvo and replace the audio added by Yomichan +# no - never use Forvo +use_forvo=yes + +# Vocab field should be equal to {expression} field in Yomichan +vocab_field=VocabKanji + +# Vocab Audio field should be equal to {audio} field in Yomichan +vocab_audio_field=VocabAudio + +## +## Misc info +## Various context information that can be written on your cards in a specified field. +## + +# yes to enable or no to disable. +miscinfo_enable=yes + +# Field name +miscinfo_field=Notes + +# Format string used to fill the misc info field. +# It supports the same substitutions as `note_tag`. HTML is supported. +miscinfo_format=%n EP%d (%t) +#miscinfo_format=From mpvacious %n at %t. + +## +## Secondary subtitles +## Mpvacious can try automatically loading secondary subtitles that will appear at the top. +## For example, you may want to load English subs alongside Japanese subs. +## +## Secondary subtitles should be present in the container. +## But if you manually set secondary sid from the command line, mpvacious won't change it. +## + +# Language of secondary subs. +# If you leave this parameter empty, no secondary subs will be automatically loaded. +secondary_sub_lang=eng,en,rus,ru,bel,be +#secondary_sub_lang= + +# Hover area. +# Proportion of the top part of the mpv window where the secondary subtitles are visible when hovered over. +# Possible values: from 0.0 to 1.0 +secondary_sub_area=0.15 + +# Visibility state +# Can be set to: 'auto', 'never', 'always'. +# If set to 'never' or 'always', secondary_sub_area has no effect. +# If set to 'auto', visibility behaves according to the value of secondary_sub_area. +# Default binding to cycle this value: Ctrl+v. +secondary_sub_visibility=auto + +## +## Custom audio encoding arguments +## These arguments are added to the command line. +## `mpv` and `ffmpeg` accept slightly different parameters. +## Feel free to experiment for yourself, but be careful or media creation might stop working. +## + +# Ffmpeg +ffmpeg_audio_args=-af loudnorm=I=-16:TP=-1.5:LRA=11 +#ffmpeg_audio_args=-af silenceremove=1:0:-50dB + +# mpv +# mpv accepts each filter as a separate argument, e.g. --af-append=1 --af-append=2 +mpv_audio_args=--af-append=loudnorm=I=-16:TP=-1.5:LRA=11 +#mpv_audio_args=--af-append=silenceremove=1:0:-50dB diff --git a/.config/mpv/script-opts/subs2srs.conf~ b/.config/mpv/script-opts/subs2srs.conf~ new file mode 100644 index 0000000..8c85444 --- /dev/null +++ b/.config/mpv/script-opts/subs2srs.conf~ @@ -0,0 +1,271 @@ +### +### Main mpvacious configuration file. +### Save this file to ~/.config/mpv/script-opts/subs2srs.conf +### + +## +## General settings +## + +# Anki deck for new cards. Subdecks are supported. +deck_name=Mining + +# Model names are listed in `Tools -> Manage note types` menu in Anki. +# If you don't have a model for Japanese, get it from +# https://tatsumoto.neocities.org/blog/setting-up-anki.html#import-an-example-mining-deck +model_name=Japanese sentences + +# Field names as they appear in the selected note type. +# If you set `audio_field` or `image_field` empty, +# the corresponding media file will not be created. +sentence_field=SentKanji +secondary_field=SentEng +audio_field=SentAudio +image_field=Image + +# The tag(s) added to new notes. Spaces separate multiple tags. +# Leave nothing after `=` to disable tagging completely. +# The following substitutions are supported: +# %n - the name of the video +# %t - timestamp +# %d - episode number (if none, returns nothing) +# %e - SUBS2SRS_TAGS environment variable (if you have it set) +note_tag=subs2srs +#note_tag=%n %t %e +#note_tag= + +# Size and name of the font used in the menu +menu_font_size=24 +menu_font_name=Noto Serif CJK JP + +## +## Toggleables. +## Possible values: `yes` or `no`. +## + +# Use FFmpeg encoder instead of mpv encoder +# If mpvacious encounters problems creating audio and images for Anki cards, +# setting this to `yes` should fix them. +# +# You need to install ffmpeg and add it to the PATH first. +# https://wiki.archlinux.org/title/FFmpeg +# https://www.ffmpeg.org/download.html +# +# FFmpeg encoder is unable to create audio and images from remote content (like YouTube videos). +use_ffmpeg=no + +# Automatically create the deck for new cards (see deck_name option) +create_deck=yes + +# Allow making notes with the same sentence field. +allow_duplicates=no + +# When mpv starts, automatically copy subs to the clipboard as they appear on screen. +# This option can be also toggled in the addon's OSD menu. +autoclip=yes + +# Command to run when autoclip is triggered. +# If empty, just copies text to the clipboard. +# If set, calls the external program. +# E.g., even though GoldenDict can watch the system clipboard, +# if you send subtitles directly to GoldenDict, you don't pollute the clipboard as much. +autoclip_command= +#autoclip_command=goldendict + +# Remove all spaces from the primary subtitle text. +# Set this to "yes" for languages without spaces like Japanese. +# However, if mpvacious detects any latin characters in the string, spaces will not be removed. +nuke_spaces=yes + +# if set to `yes`, the volume of the outputted audio file +# depends on the volume of the player at the time of export +tie_volumes=no + +# Remove text in parentheses and leading/trailing spaces or +# newlines that may interfere with Yomichan before copying +# subtitles to the clipboard +clipboard_trim_enabled=yes + +# Add media to fields before or after existing data +append_media=yes + +# Remove text in brackets before substituting %n into tag +tag_nuke_brackets=yes + +# Remove text in brackets before substituting %n into tag +tag_nuke_parentheses=no + +# Remove the episode number before substituting %n into tag +tag_del_episode_num=yes + +# Remove everything after the episode number before substituting %n into tag +# Does nothing if the previous option tag_del_episode_num is disabled. +tag_del_after_episode_num=yes + +# Convert filename to lowercase for tagging. +tag_filename_lowercase=no + +# Lets you disable anki browser manipulation by mpvacious. +disable_gui_browse=no + +# Play audio clip automatically in background +# after note creation (or note update) to ensure that the audio is correctly cut. +preview_audio=no + +# When selecting subtitle lines, print them on the screen. +show_selected_text=yes + +# For convenience, read config file from disk before a card is made. +# Useful if you change your config often since you won't have to restart mpv every time, +# but reading from disk takes some time. +reload_config_before_card_creation=yes + +## +## Image settings +## + +# Snapshot format. +# Do not switch to `jpg` unless your computer doesn't support `webp`. +snapshot_format=webp +#snapshot_format=jpg + +# Quality of produced image files. 0 = lowest, 100=highest. +snapshot_quality=15 + +# Image dimensions +# If either (but not both) of the width or height parameters is -2, +# the value will be calculated preserving the aspect-ratio. +snapshot_width=-2 +snapshot_height=200 + +# Screenshot (yes, no) +# Usually not required. +# When making Anki cards, create a screenshot (by calling 'screenshot-to-file') instead of a snapshot. +# If set to yes, image dimensions and quality cannot be controlled due to mpv limitations. +# 'snapshot_format' is still respected. +# When using this, a custom sync server is recommended, e.g. https://github.com/ankicommunity/anki-sync-server +screenshot=no + +# The exact image template used when exporting to Anki's image field. +# Adding data-editor-shrink="true" makes the image smaller by default within the Anki viewer +# on versions 2.1.53+ (equivalent of double-clicking on the image). +# You likely would not want to change this unless you know what you are doing. +image_template=snapshot +#image_template=snapshot + +# Similar to image_template but with audio. +# Normally, the user doesn't need to change this setting, +# but it may be needed for audio files to be playable on AnkiWeb. +audio_template=[sound:%s] +#audio_template= + +## +## Animated snapshots +## Animated snapshots will capture the video from the start to the end times selected when using mpvacious. +## + +# If enabled, generates animated snapshots (something like GIFs) instead of static snapshots. +animated_snapshot_enabled=no + +# Number of frame per seconds, a value between 0 and 30 (30 included) +# Higher values will increase both quality and file size, lower values will do the opposite +animated_snapshot_fps=10 + +# Animated snapshot dimensions +# If either (but not both) of the width or height parameters is -2, +# the value will be calculated preserving the aspect-ratio. +animated_snapshot_width=-2 +animated_snapshot_height=200 + +# Quality of the produced animation, 0 = lowest, 100 = highest +animated_snapshot_quality=5 + +## +## Audio settings +## + +# Audio format. +# Do not switch to `mp3` unless your computer doesn't support `opus`. +audio_format=opus +#audio_format=mp3 + +# Sane values are 16k-32k for opus, 64k-128k for mp3. +audio_bitrate=24k + +# Set a pad to the dialog timings. 0.5 = half a second. +# Pads are never applied to manually set timings. +audio_padding=0.0 +#audio_padding=0.5 + +## +## Forvo support (Yomichan users only) +## + +# yes - fetch audio from Forvo if Yomichan couldn't find the audio (default) +# always - always fetch audio from Forvo and replace the audio added by Yomichan +# no - never use Forvo +use_forvo=yes + +# Vocab field should be equal to {expression} field in Yomichan +vocab_field=VocabKanji + +# Vocab Audio field should be equal to {audio} field in Yomichan +vocab_audio_field=VocabAudio + +## +## Misc info +## Various context information that can be written on your cards in a specified field. +## + +# yes to enable or no to disable. +miscinfo_enable=yes + +# Field name +miscinfo_field=Notes + +# Format string used to fill the misc info field. +# It supports the same substitutions as `note_tag`. HTML is supported. +miscinfo_format=%n EP%d (%t) +#miscinfo_format=From mpvacious %n at %t. + +## +## Secondary subtitles +## Mpvacious can try automatically loading secondary subtitles that will appear at the top. +## For example, you may want to load English subs alongside Japanese subs. +## +## Secondary subtitles should be present in the container. +## But if you manually set secondary sid from the command line, mpvacious won't change it. +## + +# Language of secondary subs. +# If you leave this parameter empty, no secondary subs will be automatically loaded. +secondary_sub_lang=eng,en,rus,ru,bel,be +#secondary_sub_lang= + +# Hover area. +# Proportion of the top part of the mpv window where the secondary subtitles are visible when hovered over. +# Possible values: from 0.0 to 1.0 +secondary_sub_area=0.15 + +# Visibility state +# Can be set to: 'auto', 'never', 'always'. +# If set to 'never' or 'always', secondary_sub_area has no effect. +# If set to 'auto', visibility behaves according to the value of secondary_sub_area. +# Default binding to cycle this value: Ctrl+v. +secondary_sub_visibility=auto + +## +## Custom audio encoding arguments +## These arguments are added to the command line. +## `mpv` and `ffmpeg` accept slightly different parameters. +## Feel free to experiment for yourself, but be careful or media creation might stop working. +## + +# Ffmpeg +ffmpeg_audio_args=-af loudnorm=I=-16:TP=-1.5:LRA=11 +#ffmpeg_audio_args=-af silenceremove=1:0:-50dB + +# mpv +# mpv accepts each filter as a separate argument, e.g. --af-append=1 --af-append=2 +mpv_audio_args=--af-append=loudnorm=I=-16:TP=-1.5:LRA=11 +#mpv_audio_args=--af-append=silenceremove=1:0:-50dB diff --git a/.config/mpv/scripts/blur_mpv b/.config/mpv/scripts/blur_mpv new file mode 160000 index 0000000..5593c50 --- /dev/null +++ b/.config/mpv/scripts/blur_mpv @@ -0,0 +1 @@ +Subproject commit 5593c50faaff2e3a4e1ce46648c14b872dc9c766 diff --git a/.config/mpv/scripts/force-fps.lua b/.config/mpv/scripts/force-fps.lua new file mode 100644 index 0000000..5fae7ed --- /dev/null +++ b/.config/mpv/scripts/force-fps.lua @@ -0,0 +1,10 @@ +local target_fps = 23 + +mp.add_periodic_timer(1, function() + local fps = mp.get_property_native("estimated-vf-fps") + if fps and math.abs(fps - target_fps) > 0.1 then + mp.set_property_native("speed", fps / target_fps) + else + mp.set_property_native("speed", 1) + end +end) diff --git a/.config/mpv/scripts/next-episode.lua b/.config/mpv/scripts/next-episode.lua new file mode 100644 index 0000000..3c18b9e --- /dev/null +++ b/.config/mpv/scripts/next-episode.lua @@ -0,0 +1,154 @@ +local utils = require 'mp.utils' +local msg = require 'mp.msg' +local settings = { + + filetypes = { + 'jpg', 'jpeg', 'png', 'tif', 'tiff', 'gif', 'webp', 'svg', 'bmp', + 'mp3', 'wav', 'ogm', 'flac', 'm4a', 'wma', 'ogg', 'opus', + 'mkv', 'avi', 'mp4', 'ogv', 'webm', 'rmvb', 'flv', 'wmv', 'mpeg', 'mpg', 'm4v', '3gp' + }, + + --linux(true)/windows(false)/auto(nil) + linux_over_windows = nil, + + --at end of directory jump to start and vice versa + allow_looping = true, + + --order by natural (version) numbers, thus behaving case-insensitively and treating multi-digit numbers atomically + --e.x.: true will result in the following order: 09A 9A 09a 9a 10A 10a + -- while false will result in: 09a 09A 10a 10A 9a 9A + version_flag = true, +} + +local filetype_lookup = {} +for _, ext in ipairs(settings.filetypes) do + filetype_lookup[ext] = true +end + +--check os +if settings.linux_over_windows==nil then + local o = {} + if mp.get_property_native('options/vo-mmcss-profile', o) ~= o then + settings.linux_over_windows = false + else + settings.linux_over_windows = true + end +end + +function show_osd_message(file) + mp.osd_message("Now playing: " .. file, 3) -- Adjust OSD display time as needed +end + +function nexthandler() + movetofile(true) +end + +function prevhandler() + movetofile(false) +end + +function get_files_windows(dir) + local args = { + 'powershell', '-NoProfile', '-Command', [[& { + Trap { + Write-Error -ErrorRecord $_ + Exit 1 + } + $path = "]]..dir..[[" + $escapedPath = [WildcardPattern]::Escape($path) + cd $escapedPath + + $list = (Get-ChildItem -File | Sort-Object { [regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(20) }) }).Name + $string = ($list -join "/") + $u8list = [System.Text.Encoding]::UTF8.GetBytes($string) + [Console]::OpenStandardOutput().Write($u8list, 0, $u8list.Length) + }]] + } + local process = utils.subprocess({ args = args, cancellable = false }) + return parse_files(process, '%/') +end + +function get_files_linux(dir) + local flags = ('-1p' .. (settings.version_flag and 'v' or '')) + local args = { 'ls', flags, dir } + local process = utils.subprocess({ args = args, cancellable = false }) + return parse_files(process, '\n') +end + +function parse_files(res, delimiter) + if not res.error and res.status == 0 then + local valid_files = {} + for line in res.stdout:gmatch("[^"..delimiter.."]+") do + local ext = line:match("^.+%.(.+)$") + if ext and filetype_lookup[ext:lower()] then + table.insert(valid_files, line) + end + end + return valid_files, nil + else + return nil, res.error + end +end + +function movetofile(forward) + if mp.get_property('filename'):match("^%a%a+:%/%/") then return end + local pwd = mp.get_property('working-directory') + local relpath = mp.get_property('path') + if not pwd or not relpath then return end + + local path = utils.join_path(pwd, relpath) + local filename = mp.get_property("filename") + local dir = utils.split_path(path) + + local files, error + if settings.linux_over_windows then + files, error = get_files_linux(dir) + else + files, error = get_files_windows(dir) + end + + if not files then + msg.error("Subprocess failed: "..(error or '')) + return + end + + local found = false + local memory = nil + local lastfile = true + local firstfile = nil + for _, file in ipairs(files) do + if found == true then + mp.commandv("loadfile", utils.join_path(dir, file), "replace") + lastfile = false + show_osd_message(file) + break + end + if file == filename then + found = true + if not forward then + lastfile = false + if settings.allow_looping and firstfile == nil then + found = false + else + if firstfile == nil then break end + mp.commandv("loadfile", utils.join_path(dir, memory), "replace") + show_osd_message(memory) + break + end + end + end + memory = file + if firstfile == nil then firstfile = file end + end + if lastfile and firstfile and settings.allow_looping then + mp.commandv("loadfile", utils.join_path(dir, firstfile), "replace") + show_osd_message(firstfile) + end + if not found and memory then + mp.commandv("loadfile", utils.join_path(dir, memory), "replace") + show_osd_message(memory) + end +end + +mp.add_key_binding('Shift+RIGHT', 'nextfile', nexthandler) +mp.add_key_binding('Shift+LEFT', 'previousfile', prevhandler) diff --git a/.config/mpv/scripts/subs2srs b/.config/mpv/scripts/subs2srs new file mode 160000 index 0000000..551a817 --- /dev/null +++ b/.config/mpv/scripts/subs2srs @@ -0,0 +1 @@ +Subproject commit 551a817a3ac815e5769214f8595b9a2e7767d7c5 diff --git a/.config/mpv/scripts/videoclip b/.config/mpv/scripts/videoclip new file mode 160000 index 0000000..509b6b6 --- /dev/null +++ b/.config/mpv/scripts/videoclip @@ -0,0 +1 @@ +Subproject commit 509b6b624592dbac6f2d7e0c4bc92a76460e7129 diff --git a/.config/mpv/shaders/Anime4K_Deblur_Original.glsl b/.config/mpv/shaders/Anime4K_Deblur_Original.glsl new file mode 100644 index 0000000..ff8f70f --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Deblur_Original.glsl @@ -0,0 +1,287 @@ +// MIT License + +// Copyright (c) 2019-2021 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.2-Deblur-Original-Luma +//!HOOK MAIN +//!BIND HOOKED +//!SAVE LINELUMA +//!COMPONENTS 1 + +float get_luma(vec4 rgba) { + return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba); +} + +vec4 hook() { + return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0); +} + +//!DESC Anime4K-v3.2-Deblur-Original-Kernel-X +//!HOOK MAIN +//!BIND HOOKED +//!BIND LINELUMA +//!SAVE LUMAD +//!WIDTH MAIN.w 2 * +//!HEIGHT MAIN.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = LINELUMA_tex(HOOKED_pos + vec2(-d.x, 0.0)).x; + float c = LINELUMA_tex(HOOKED_pos).x; + float r = LINELUMA_tex(HOOKED_pos + vec2(d.x, 0.0)).x; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + //Computes the luminance's gradient + return vec4(xgrad, ygrad, 0.0, 0.0); +} + + +//!DESC Anime4K-v3.2-Deblur-Original-Kernel-Y +//!HOOK MAIN +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAD +//!WIDTH MAIN.w 2 * +//!HEIGHT MAIN.h 2 * +//!COMPONENTS 2 + + +/* --------------------- SETTINGS --------------------- */ + +//Strength of edge refinement, good values are between 0.2 and 4 +#define REFINE_STRENGTH 1.0 + + +/* --- MODIFY THESE SETTINGS BELOW AT YOUR OWN RISK --- */ + +//Bias of the refinement function, good values are between 0 and 1 +#define REFINE_BIAS 0.0 + +//Polynomial fit obtained by minimizing MSE error on image +#define P5 ( 11.68129591) +#define P4 (-42.46906057) +#define P3 ( 60.28286266) +#define P2 (-41.84451327) +#define P1 ( 14.05517353) +#define P0 (-1.081521930) + +/* ----------------- END OF SETTINGS ----------------- */ + +float power_function(float x) { + float x2 = x * x; + float x3 = x2 * x; + float x4 = x2 * x2; + float x5 = x2 * x3; + + return P5*x5 + P4*x4 + P3*x3 + P2*x2 + P1*x + P0; +} + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAD_tex(HOOKED_pos + vec2(0.0, -d.y)).x; + float cx = LUMAD_tex(HOOKED_pos).x; + float bx = LUMAD_tex(HOOKED_pos + vec2(0.0, d.y)).x; + + + float ty = LUMAD_tex(HOOKED_pos + vec2(0.0, -d.y)).y; + //float cy = LUMAD_tex(HOOKED_pos).y; + float by = LUMAD_tex(HOOKED_pos + vec2(0.0, d.y)).y; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + //Computes the luminance's gradient + float sobel_norm = clamp(sqrt(xgrad * xgrad + ygrad * ygrad), 0.0, 1.0); + + float dval = clamp(power_function(clamp(sobel_norm, 0.0, 1.0)) * REFINE_STRENGTH + REFINE_BIAS, 0.0, 1.0); + + return vec4(sobel_norm, dval, 0.0, 0.0); +} + +//!DESC Anime4K-v3.2-Deblur-Original-Kernel-X +//!HOOK MAIN +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAMM +//!WIDTH MAIN.w 2 * +//!HEIGHT MAIN.h 2 * +//!COMPONENTS 2 + + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0.0); + } + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = LUMAD_tex(HOOKED_pos + vec2(-d.x, 0.0)).x; + float c = LUMAD_tex(HOOKED_pos).x; + float r = LUMAD_tex(HOOKED_pos + vec2(d.x, 0.0)).x; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + + return vec4(xgrad, ygrad, 0.0, 0.0); +} + + +//!DESC Anime4K-v3.2-Deblur-Original-Kernel-Y +//!HOOK MAIN +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!SAVE LUMAMM +//!WIDTH MAIN.w 2 * +//!HEIGHT MAIN.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0.0); + } + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAMM_tex(HOOKED_pos + vec2(0.0, -d.y)).x; + float cx = LUMAMM_tex(HOOKED_pos).x; + float bx = LUMAMM_tex(HOOKED_pos + vec2(0.0, d.y)).x; + + float ty = LUMAMM_tex(HOOKED_pos + vec2(0.0, -d.y)).y; + //float cy = LUMAMM_tex(HOOKED_pos).y; + float by = LUMAMM_tex(HOOKED_pos + vec2(0.0, d.y)).y; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + float norm = sqrt(xgrad * xgrad + ygrad * ygrad); + if (norm <= 0.001) { + xgrad = 0.0; + ygrad = 0.0; + norm = 1.0; + } + + return vec4(xgrad/norm, ygrad/norm, 0.0, 0.0); +} + + +//!DESC Anime4K-v3.2-Deblur-Original-Apply +//!HOOK MAIN +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!WIDTH MAIN.w 2 * +//!HEIGHT MAIN.h 2 * +//!SAVE RESAMPLED + + +vec4 hook() { + vec2 d = HOOKED_pt; + + float dval = LUMAD_tex(HOOKED_pos).y; + if (dval < 0.1) { + return HOOKED_tex(HOOKED_pos); + } + + vec4 dc = LUMAMM_tex(HOOKED_pos); + if (abs(dc.x + dc.y) <= 0.0001) { + return HOOKED_tex(HOOKED_pos); + } + + float xpos = -sign(dc.x); + float ypos = -sign(dc.y); + + vec4 xval = HOOKED_tex(HOOKED_pos + vec2(d.x * xpos, 0.0)); + vec4 yval = HOOKED_tex(HOOKED_pos + vec2(0.0, d.y * ypos)); + + float xyratio = abs(dc.x) / (abs(dc.x) + abs(dc.y)); + + vec4 avg = xyratio * xval + (1.0 - xyratio) * yval; + + return avg * dval + HOOKED_tex(HOOKED_pos) * (1.0 - dval); + +} + +//!DESC Anime4K-v3.2-Deblur-Original-Resample +//!HOOK MAIN +//!BIND HOOKED +//!BIND RESAMPLED + +vec4 hook() { + return RESAMPLED_tex(HOOKED_pos); +} \ No newline at end of file diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_x2_VL.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_x2_VL.glsl new file mode 100644 index 0000000..c562e6e --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_x2_VL.glsl @@ -0,0 +1,969 @@ +// MIT License + +// Copyright (c) 2019-2021 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x3 +//!HOOK MAIN +//!BIND MAIN +//!SAVE conv2d_tf +//!WIDTH MAIN.w +//!HEIGHT MAIN.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off))) +vec4 hook() { + vec4 result = mat4(0.3053028, -0.037464816, 0.113983095, 0.12537485, -0.18630321, 0.084269725, -0.01351514, -0.20190673, -0.12298384, -0.037622184, -0.070214555, -0.19367279, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0); + result += mat4(-0.41849324, 0.099702746, -0.04276645, -0.047299717, 0.20074473, 0.14217933, 0.15571699, 0.19553481, 0.21868695, -0.053848714, 0.016413521, 0.14117444, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0); + result += mat4(0.030540446, -0.052293833, 0.0715466, -0.31160545, 0.07808315, -0.16860045, 0.032828577, -0.2955024, -0.110374965, 0.04043687, -0.014024628, 0.058699366, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0); + result += mat4(-0.10727635, 0.054200135, 0.20853694, 0.21086875, 0.122690216, -0.091823794, 0.310609, -0.01738923, -0.0013488946, 0.10835534, -0.077265196, 0.086751856, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0); + result += mat4(-0.77150255, 0.40530515, -0.41257596, -0.14367618, 0.46888494, 0.2650122, -0.934199, 0.40476102, 0.32293493, 0.20251967, 0.19891106, -0.29698747, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0); + result += mat4(-0.12505147, -0.41904053, -0.065798186, 0.34075752, 0.026240354, -0.2977496, 0.032647505, -0.003566783, 0.10290523, -0.23417123, -0.06014203, 0.094735645, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0); + result += mat4(0.11207838, -0.04062474, 0.023897955, 0.08605987, -0.020888371, 0.045541205, -0.07231824, -0.25884083, -0.11796847, -0.002691391, 0.0050435597, 0.02756291, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0); + result += mat4(0.4615728, 0.041790638, 0.08971143, 0.20213957, -0.38537467, 0.19938901, 0.08594364, -0.08621994, -0.08163473, -0.133266, -0.09561729, -0.014209637, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0); + result += mat4(0.0787417, -0.0483673, 0.07621572, -0.060169693, -0.013465177, -0.17152289, 0.02515561, 0.17675288, -0.05173998, 0.10768042, -0.029858522, -0.013957215, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0); + result += vec4(0.0072128535, -0.05658625, 0.052939568, -0.1760861); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x3 +//!HOOK MAIN +//!BIND MAIN +//!SAVE conv2d_tf1 +//!WIDTH MAIN.w +//!HEIGHT MAIN.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off))) +vec4 hook() { + vec4 result = mat4(-0.112743355, 0.0422517, 0.21350034, -0.0967133, 0.16265953, 0.0022497, 0.015078242, 0.08204187, 0.035236806, -0.0468228, -0.09464228, -0.001864949, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0); + result += mat4(0.25631642, -0.41485596, -0.16662048, 0.13201024, 0.057921384, 0.2240005, -0.30038536, -0.08305622, 0.2228756, 0.32263795, 0.10608189, -0.18616734, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0); + result += mat4(0.08997524, 0.11516871, 0.19212262, -0.035154644, 0.11612274, -0.04056247, 0.14974374, 0.029173585, -0.07629641, -0.14353512, 0.041081246, 0.20230265, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0); + result += mat4(0.2262286, 0.055954933, -0.14499907, 0.17314723, 0.16590612, -0.06688698, -0.11118816, -0.012938116, -0.043101817, 0.026133137, 0.2958395, 0.06543993, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0); + result += mat4(-0.07311521, -0.3041244, -0.47978505, -0.6350967, -0.17432262, 0.34965977, 0.25399777, -0.16590433, -0.49957857, 0.0549526, -0.40869385, -0.08780993, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0); + result += mat4(-0.3014447, -0.00021343959, -0.14953177, 0.028001398, -0.14931908, -0.14910097, -0.13287953, -0.45026535, 0.17378895, 0.024704922, -0.027308129, -0.10292025, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0); + result += mat4(-0.06732655, -0.13119644, 0.066014715, 0.081011154, -0.15154321, 0.2407805, 0.07733481, 0.12312706, 0.1741804, 0.008495716, -0.14125362, -0.043644864, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0); + result += mat4(0.11465958, 0.42001364, 0.011069392, 0.3203028, -0.058801666, -0.37830314, -0.030540617, 0.2245139, -0.11310525, -0.14845212, 0.19957744, 0.25789997, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0); + result += mat4(-0.16037206, 0.21326372, 0.020099448, 0.018666709, 0.122083254, -0.16033986, -0.10725163, 0.2556128, 0.1650688, -0.10475823, 0.048623525, -0.103755645, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0); + result += vec4(0.007717166, -0.027800834, 0.0795002, 0.0053199283); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_tf +//!BIND conv2d_tf1 +//!SAVE conv2d_1_tf +//!WIDTH conv2d_tf.w +//!HEIGHT conv2d_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(-0.0056740534, -0.21186607, -0.18014967, 0.118979976, -0.0015611284, -0.07708486, 0.060131397, 0.11653345, 0.027150517, 0.10837246, 0.08583816, -0.14032431, 0.017552888, 0.0035846964, 0.03980114, 0.064649396) * go_0(-1.0, -1.0); + result += mat4(-0.03289318, -0.12004539, 0.26514888, -0.15079662, 0.04214227, -0.027273783, -0.027950313, 0.19614808, 0.18510003, -0.10346252, -0.029836183, 0.09174428, -0.0088710375, -0.18273513, 0.06601674, 0.009983851) * go_0(-1.0, 0.0); + result += mat4(0.08476211, 0.043996535, 0.056711517, 0.009976895, 0.07039107, -0.024862664, -0.059921104, 0.046850603, 0.04983447, 0.04863198, 0.21777405, -0.0576961, 0.045321796, -0.0060038245, 0.096396215, -0.10842004) * go_0(-1.0, 1.0); + result += mat4(-0.15746164, 0.041757874, 0.035169285, -0.1734288, -0.24219254, -0.13318908, 0.2272079, -0.02902605, 0.07750601, -0.1467191, -0.12296749, -0.07533314, -0.07073083, 0.17909113, 0.04789308, 0.17245363) * go_0(0.0, -1.0); + result += mat4(0.057547905, 0.1464685, -0.33115456, -0.26956198, -0.26298407, -0.059824817, 0.022509675, -0.09251868, 0.36277944, -0.2072429, 0.21095088, -0.45492023, 0.07428653, 0.1593302, -0.2945834, 0.12825087) * go_0(0.0, 0.0); + result += mat4(-0.1318458, 0.27804148, 0.037600737, 0.12047866, 0.0065036337, 0.0017241207, 0.060497303, -0.14786585, -0.15149063, 0.02731698, 0.048886403, -0.0025970868, -0.026979815, 0.07348884, 0.015636757, -0.107966796) * go_0(0.0, 1.0); + result += mat4(-0.079988025, -0.01626299, 0.06517438, 0.086406484, -0.1484504, 0.070595, 0.20620634, 0.09713373, -0.13620836, 0.012067949, -0.00068703433, -0.038030174, 0.22300471, -0.0012400965, -0.014827909, -0.08927486) * go_0(1.0, -1.0); + result += mat4(0.15634936, 0.052028038, 0.038081627, 0.12720168, 0.07342066, -0.04318368, -0.0065998454, 0.12109317, -0.45398173, 0.03666754, -0.17773737, 0.038516667, -0.13009632, -0.007457001, -0.013938809, 0.09776142) * go_0(1.0, 0.0); + result += mat4(0.029636936, 0.12864171, 0.11347291, -0.11812842, -0.0870342, 0.035678383, 0.050338242, 0.045754932, -0.07072752, 0.010447726, 0.039642975, -0.08795004, -0.1191525, 0.00967509, 0.13485421, -0.053204738) * go_0(1.0, 1.0); + result += mat4(-0.011072695, -0.09613245, -0.09094804, 0.028029291, -0.04031162, 0.15690295, 0.25094184, -0.21776834, 0.06524669, 0.06412185, -0.052852992, -0.08097702, -0.039127756, 0.036357917, 0.104585476, 0.25095442) * go_1(-1.0, -1.0); + result += mat4(-0.08328618, -0.006246033, 0.099708706, -0.014916097, 0.17727195, 0.4369228, 0.14760216, 0.06707674, 0.025167737, -0.022487842, -0.038962565, 0.15380669, 0.08125089, 0.09844594, 0.33538374, -0.003161368) * go_1(-1.0, 0.0); + result += mat4(-0.0128195705, -0.05475118, -0.037705053, -0.0012077648, -0.17425515, 0.091487505, -0.12909423, 0.0074876705, 0.13438368, 5.778033e-05, 0.04563314, -0.12185897, -0.053612474, -0.049824294, -0.12851205, 0.12856449) * go_1(-1.0, 1.0); + result += mat4(-0.025741795, 0.01867236, -0.00027440622, 0.10502768, 0.27042285, -0.14947751, 0.11143123, 0.2575913, -0.07414089, -0.33919522, -0.13194235, -0.20088726, 0.23121537, -0.08197353, 0.06693911, 0.015411386) * go_1(0.0, -1.0); + result += mat4(0.09143717, 0.22842278, 0.06501074, -0.20009698, -0.042117566, -0.23452093, -0.074082755, -0.10612558, 0.077631965, 0.08343657, -0.07657599, -0.43297377, 0.7092466, -0.16272525, 0.17222248, -0.056038965) * go_1(0.0, 0.0); + result += mat4(0.081200436, 0.046752565, 0.028254949, 0.18820632, 0.096592255, 0.05896745, 0.14845169, 0.034777895, 0.07195204, -0.1908046, -0.015341971, 0.02606145, -0.010377239, 0.0755547, -0.15285216, 0.047916733) * go_1(0.0, 1.0); + result += mat4(-0.06825636, -0.049540907, -0.024328846, 0.03506251, 0.2060094, 0.054119263, -0.06671269, 0.052428722, 0.055792283, -0.14336903, -0.03180757, 0.013760968, -0.037398104, -0.06880077, -0.023608573, 0.0360965) * go_1(1.0, -1.0); + result += mat4(-0.16937497, -0.30156836, 0.0021435453, 0.025772978, -0.17990975, 0.046133514, -0.32447076, -0.083382785, -0.081322014, -0.022132374, -0.05319431, 0.11794733, 0.08943906, 0.12927428, 0.105764806, -0.051034793) * go_1(1.0, 0.0); + result += mat4(-0.011012306, 0.047636557, 0.050260928, 0.051847618, 0.010985655, -0.13752967, 0.023869954, 0.07011459, -0.18244945, 0.07239806, -0.013638856, -0.026982805, 0.11395993, -0.031304818, -0.08714153, 0.077115685) * go_1(1.0, 1.0); + result += mat4(0.08707592, 0.2265186, 0.13363098, -0.039588258, -0.029561255, 0.019238092, 0.024606103, -0.0019022018, -0.062285982, -0.0629511, -0.03753033, 0.109805316, 0.016018672, -0.08284564, -0.04092752, -0.030386891) * go_2(-1.0, -1.0); + result += mat4(0.0016500859, 0.01616536, -0.099148355, 0.24161765, 0.028064307, -0.028680569, 0.054400917, -0.1978921, -0.08584302, -0.096797146, -0.06546965, -0.09342837, 0.030265866, 0.07057579, -0.02080932, 0.053178705) * go_2(-1.0, 0.0); + result += mat4(-0.030304352, 0.047440585, -0.04248429, 0.08568772, -0.051317703, 0.036739342, 0.00865767, -0.018183297, -0.07335176, 0.025001721, -0.068509035, 0.1814819, -0.09756565, -0.024179723, -0.05959287, 0.0352454) * go_2(-1.0, 1.0); + result += mat4(0.023015196, -0.022870664, -0.12028372, -0.111095205, 0.11065281, -0.19900022, -0.24012049, -0.017028643, -0.13484617, 0.050107025, 0.10741765, 0.037951697, 0.013090438, -0.0010045726, -0.029447839, -0.1859787) * go_2(0.0, -1.0); + result += mat4(0.17922719, -0.24138594, -0.44595388, -0.032014426, 0.06897096, 0.07125395, 0.1944457, -0.035794795, -0.24022278, -0.13230884, -0.1277025, 0.21229011, -0.12249393, 0.06141907, 0.2687936, -0.26896995) * go_2(0.0, 0.0); + result += mat4(0.0397242, -0.30710965, 0.28815824, -0.06642567, -0.07588877, -0.019552408, 0.0057806037, 0.11465521, 0.03560534, -0.10640553, 0.023589289, -0.16667193, 0.02066607, -0.01026633, -0.02655378, 0.082493655) * go_2(0.0, 1.0); + result += mat4(-0.007902949, -0.08501038, -0.029395591, -0.07072227, -0.01800967, -0.14564751, -0.08372804, -0.049974415, 0.1756957, -0.02042449, -0.04413007, -0.016873527, -0.2385717, -0.001741017, 0.08298281, -0.019873247) * go_2(1.0, -1.0); + result += mat4(-0.01803727, 0.0642893, 0.21513617, 0.066888265, -0.042107955, -0.123470366, 0.045296013, -0.11958806, 0.48208967, -0.027188249, 0.12136116, 0.05246265, 0.13522038, -0.016297493, 0.028486907, -0.059840377) * go_2(1.0, 0.0); + result += mat4(-0.1373251, -0.11281026, -0.06418318, 0.08444032, 0.062874556, -0.009133875, -0.049571835, -0.042995855, 0.12483249, -0.025967957, -0.11202483, 0.09862257, 0.099986054, 0.009230306, -0.09042664, 0.046612263) * go_2(1.0, 1.0); + result += mat4(0.03203309, 0.106030256, 0.045741174, -0.020529225, -0.028610658, -0.055219248, -0.21404657, 0.07746393, -0.059359375, 0.0033258004, -0.0054513607, 0.06856653, 0.18043655, -0.119936846, -0.05639265, -0.10240379) * go_3(-1.0, -1.0); + result += mat4(-0.0004331875, 0.10426754, -0.008130048, 0.012795991, -0.14372933, -0.40797862, 0.105197415, -0.0041354536, -0.079792455, 0.0914027, 0.012418237, -0.11449173, 0.020261409, -0.14681602, -0.13355242, 0.18290488) * go_3(-1.0, 0.0); + result += mat4(0.052306626, 0.010864275, -0.072627716, -0.009773121, 0.09484167, -0.09631301, 0.14896165, -0.21220942, -0.11994051, -0.002957136, -0.118194886, 0.08661347, 0.10005298, -0.029620873, 0.101668894, 0.0242806) * go_3(-1.0, 1.0); + result += mat4(-0.055188183, -0.06322889, 0.12994595, 0.03140751, -0.092755616, 0.04239107, 0.18460171, 0.08471877, 0.014203371, 0.13608724, 0.035351243, -0.07883493, -0.10067456, 0.14417742, 0.0054235114, 0.100745104) * go_3(0.0, -1.0); + result += mat4(-0.043811034, -0.16055201, -0.11927185, 0.20517266, 0.16734722, 0.27720267, 0.1205665, 0.045803893, -0.07874647, 0.06764307, -0.11157022, 0.080770165, -0.044105835, -0.03276538, -0.10945451, 0.100562036) * go_3(0.0, 0.0); + result += mat4(-0.044731796, -0.12854387, -0.061937924, -0.21604767, -0.036132332, -0.024353411, -0.16718283, 0.14903957, -0.11620588, 0.14563644, 0.23363836, 0.08400659, 0.15248756, -0.1424437, 0.112882614, -0.04096889) * go_3(0.0, 1.0); + result += mat4(-0.0486021, -0.05714939, 0.042517707, -0.06106919, -0.12970918, -0.071898215, -0.044727243, -0.026308542, 0.05687118, -0.0394057, -0.109454155, -0.0021216893, 0.018588595, 0.08061093, 0.0500373, -0.0034918839) * go_3(1.0, -1.0); + result += mat4(0.11269324, -0.17924047, -0.12965205, -0.07287767, -0.015830642, -0.044497102, 0.20014328, -0.14054494, 0.1232692, 0.2395109, 0.14093149, 0.03518561, -0.14088139, -0.09045081, -0.07283352, 0.053434785) * go_3(1.0, 0.0); + result += mat4(0.020512339, 0.026349569, -0.06666101, 0.05554806, -0.03044066, 0.26656216, 0.019155584, -0.12118906, 0.087923005, -0.1716557, 0.050843164, 0.037432503, -0.030232614, 0.030457936, 0.04232163, -0.066400655) * go_3(1.0, 1.0); + result += vec4(-0.0216415, 0.09015036, -0.030761974, -0.26541537); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_tf +//!BIND conv2d_tf1 +//!SAVE conv2d_1_tf1 +//!WIDTH conv2d_tf.w +//!HEIGHT conv2d_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(0.04688368, 0.13853125, 0.1714716, -0.03034447, -0.08090605, 0.1225867, 0.17535992, 0.012508419, -0.0010665918, -0.07481546, -0.15541986, 0.0671128, -0.029307734, -0.076674186, 0.03925896, -0.07140553) * go_0(-1.0, -1.0); + result += mat4(-0.13273083, 0.062933214, 0.04200143, -0.0080243945, -0.120439716, -0.090192355, -0.022639645, 0.00020024918, -0.11211478, -0.12949537, 0.025783822, 0.009155746, 0.01004339, -0.0661901, 0.10630156, 0.053137038) * go_0(-1.0, 0.0); + result += mat4(0.07113487, -0.16011865, -0.10838903, -0.0034704183, 0.110606894, -0.14915739, 0.036511585, -0.003103608, -0.0551775, -0.13140677, 0.05270299, 0.12139221, 0.02226174, 0.008415268, -0.06647426, 0.118130066) * go_0(-1.0, 1.0); + result += mat4(-0.045172617, -0.0020388453, -0.27287582, 0.002428232, -0.2833772, 0.13788106, 0.073339015, 0.10666715, 0.08455194, 0.16499293, 0.089058325, 0.008815447, 0.034657538, -0.109856166, -0.11499077, -0.02918854) * go_0(0.0, -1.0); + result += mat4(0.07910854, -0.26334837, -0.3246593, -0.08246522, 0.09211476, 0.40793833, -0.09658794, -0.14430091, -0.50632644, 0.087234974, 0.26298127, 0.3687086, 0.06492316, 0.23082961, 0.18233871, -0.09283792) * go_0(0.0, 0.0); + result += mat4(-0.022744032, 0.21690565, 0.2694824, -0.12230013, -0.07969618, 0.21595429, -0.034979805, 0.008938489, 0.21289209, -0.446482, -0.042927746, -0.13587558, -0.032581557, -0.07182814, -0.054092336, -0.009542036) * go_0(0.0, 1.0); + result += mat4(-0.0034912943, -0.080354184, -0.08577375, -0.1521193, 0.09809233, 0.034529503, -0.100664355, 0.008191219, -0.014303411, -0.02862216, -0.18669915, -0.12384598, 0.046499267, 0.093707144, 0.10661308, 0.15079576) * go_0(1.0, -1.0); + result += mat4(-0.031025652, -0.0384342, 0.14258307, 0.25531343, 0.0075049917, -0.03966595, 0.062381975, 0.19593526, -0.2868182, 0.03162008, -0.4391041, -0.524017, -0.034463473, -0.0066741486, -0.24586639, 0.10521736) * go_0(1.0, 0.0); + result += mat4(-0.07452321, -0.0227877, -0.025402244, 0.115727395, -0.039511252, -0.07785703, -0.013689458, 0.0066024344, -0.052957747, 0.011206241, -0.0021671024, 0.077190824, -0.11709912, 0.046635598, 0.123751156, -0.03712064) * go_0(1.0, 1.0); + result += mat4(0.055411004, -0.0020031065, 0.06685547, -0.018829947, -0.06378933, -0.18389674, -0.0023551763, 0.0670314, 0.13038594, 0.0601923, -0.03035789, -0.019537423, -0.014483204, -0.056800704, 0.08663347, -0.106859975) * go_1(-1.0, -1.0); + result += mat4(-0.06603686, 0.07360526, -0.0072026253, -0.06778907, -0.039178446, 0.012397263, -0.13482279, 0.05745685, -0.055182382, -0.10545766, 0.003857615, 0.041947857, -0.15239377, 0.041826613, 0.058879383, -0.0042669442) * go_1(-1.0, 0.0); + result += mat4(-0.0697229, -0.010702144, -0.032265816, 0.013317131, 0.105028264, 0.21032134, 0.06845646, -0.018358687, 0.064568676, 0.08437135, -0.000723181, 0.1324007, 0.05527932, -0.049871888, -0.10125047, -0.005040889) * go_1(-1.0, 1.0); + result += mat4(-0.006467578, -0.05120533, -0.011780779, -0.011742203, -0.34242442, -0.020819988, 0.17381702, -0.059836414, -0.028882682, 0.23210457, 0.16579404, -0.03708216, -0.23541835, -0.03290251, 0.029319672, 0.26189178) * go_1(0.0, -1.0); + result += mat4(-0.30955994, -0.06408282, -0.16872866, 0.10767772, -0.041430887, 0.051697977, 0.12523535, -0.060389146, 0.026289431, 0.06359533, 0.13526368, 0.2479901, -0.3263977, 0.10216362, -0.0030894123, 0.046437826) * go_1(0.0, 0.0); + result += mat4(0.10061438, -0.17047118, -0.21593021, -0.023389054, -0.17507865, -0.30822313, -0.22044766, 0.16078933, 0.07099252, -0.11573018, 0.24712858, -0.0659458, -0.037504572, -0.12297423, 0.03342632, -0.058119852) * go_1(0.0, 1.0); + result += mat4(-0.020957774, -0.0224927, 0.04069268, -0.07911167, 0.074009344, 0.065916434, 0.008222278, 0.11625076, -0.25299504, 0.03357169, -0.021988, 0.015821831, -0.0021187372, -0.030700417, -0.004374924, 0.027358979) * go_1(1.0, -1.0); + result += mat4(0.06549052, -0.048067164, 0.05489091, -0.28851983, 0.13378961, 0.026875904, -0.09877994, -0.19947459, -0.1274035, -0.022928834, -0.26344195, -0.025870804, 0.022505255, 0.0070861108, 0.121051334, -0.025964163) * go_1(1.0, 0.0); + result += mat4(0.059426542, -0.0327433, 0.2313695, -0.07046268, 0.20479666, 0.027021704, 0.2564928, -0.11689885, -0.07407976, -0.019611249, 0.093463086, -0.121553615, 0.035009407, -0.008135333, -0.075931996, 0.047803063) * go_1(1.0, 1.0); + result += mat4(-0.059434246, -0.1652242, -0.124611154, 0.04743711, 0.10530296, -0.13869187, -0.036534663, -0.035206333, 0.06067593, 0.06126907, 0.120151915, -0.06722673, 0.008103894, 0.037225723, -0.007520425, 0.065720856) * go_2(-1.0, -1.0); + result += mat4(-3.6759695e-05, -0.036789574, 0.013370567, -0.037871476, -0.013454664, 0.15086569, 0.10164699, 0.057703357, -0.12871023, 0.12827681, -0.055057358, -0.040753044, -0.0142621, 0.08563361, -0.04615499, -0.03130452) * go_2(-1.0, 0.0); + result += mat4(-0.117965914, 0.09056485, 0.07272314, 0.009695964, -0.11331058, 0.07467256, -0.08291521, 0.00937355, -0.04097737, 0.07752905, -0.017335521, -0.12539999, 0.039462104, -0.0007037007, 0.06034812, -0.09497377) * go_2(-1.0, 1.0); + result += mat4(0.20828065, 0.0400099, 0.047638226, -0.046423353, -0.026133502, 0.098207295, 0.056742374, 0.017029466, -0.058164768, -0.046973787, -0.17328712, -0.0012984811, 0.050085854, 0.11296557, 0.12639083, 0.058543045) * go_2(0.0, -1.0); + result += mat4(-0.098907426, 0.22031747, 0.101559944, 0.06616554, 0.026110496, 0.56487054, 0.23754556, -0.07540935, 0.31768414, -0.47653618, 0.015073956, -0.33731326, 0.087285936, -0.24593173, -0.26141426, 0.15003823) * go_2(0.0, 0.0); + result += mat4(0.046026446, -0.13767281, 0.064847544, 0.07717139, 0.08544123, -0.11092969, 0.072325274, 0.010849038, -0.3055905, 0.66436774, 0.1434729, 0.0494463, 0.07115603, 0.083811216, 0.020431712, 0.06537088) * go_2(0.0, 1.0); + result += mat4(-0.15532711, 0.030139687, 0.040853374, 0.11089222, -0.08150315, -0.015851755, -0.06787692, 0.096075505, -0.011956207, -0.0017758606, 0.1277494, 0.16156575, -0.038588695, -0.0626418, -0.041797023, -0.19467135) * go_2(1.0, -1.0); + result += mat4(0.12917455, 0.017410474, -0.20125067, -0.08040003, -0.13494664, 0.17789102, -0.19909395, 0.08441434, 0.078570575, -0.06330619, 0.23767303, 0.5442659, -0.009227878, -0.021818208, 0.14318731, -0.09042824) * go_2(1.0, 0.0); + result += mat4(0.097801, 0.09345441, 0.17846581, -0.14773296, 0.06536365, 0.07642184, -0.011880635, 0.02086135, 0.013336972, -0.053295113, -0.13410404, 0.027241753, 0.087728985, -0.044033397, -0.13098569, 0.009423933) * go_2(1.0, 1.0); + result += mat4(-0.02488427, 0.0134966355, -0.0075000813, 0.07272353, 0.015842725, 0.13765687, 0.028079558, -0.08384948, -0.06666623, -0.023220664, 0.025091043, -0.055167805, -0.18826278, 0.04423603, 0.13499942, 0.059128854) * go_3(-1.0, -1.0); + result += mat4(0.01935146, -0.030980906, -0.031569187, -0.0036869382, 0.036753897, 0.118464164, 0.15871695, -0.09842428, 0.023324292, 0.071796335, -0.07869346, -0.10751301, -0.2588698, 0.064011686, 0.17386378, -0.039197855) * go_3(-1.0, 0.0); + result += mat4(0.08590827, 0.005497696, -0.026512025, 0.015661815, 0.1102415, -0.08268483, -0.0032903247, 0.10049029, -0.008157236, -0.035823178, -0.017570151, -0.081716835, -0.3531045, 0.010005245, 0.017141227, -0.016376914) * go_3(-1.0, 1.0); + result += mat4(-0.16617337, -0.007689783, 0.00954665, 0.07117733, -0.001669262, -0.012331606, 0.051613946, 0.062780835, 0.06123557, -0.20243123, -0.19181818, 0.032895602, 0.19760677, 0.004464939, 0.12754539, -0.27360034) * go_3(0.0, -1.0); + result += mat4(0.15006685, -0.083587274, -0.03215495, -0.16992462, -0.011944293, 0.058361508, -0.088097006, 0.023880545, -0.04168166, -0.06960282, -0.092672385, -0.057278465, 0.23540072, -0.1721208, -0.018213503, -0.23494521) * go_3(0.0, 0.0); + result += mat4(-0.124885194, 0.1905868, 0.11108704, 0.03163991, 0.11383064, 0.101223364, 0.069428995, -0.14298953, -0.07609092, 0.13704266, -0.07749446, -0.0005389336, -0.04617235, 0.18011934, 0.08350316, 0.09416366) * go_3(0.0, 1.0); + result += mat4(0.073356606, 0.067966126, -0.21285574, 0.0782625, -0.0034364646, -0.032581426, -0.05538558, -0.1317288, 0.14552782, -0.1132393, 0.13063973, -0.00833602, 0.0026844777, 0.028135289, -0.02536825, -0.028372496) * go_3(1.0, -1.0); + result += mat4(-0.318728, 0.07862527, -0.12176221, 0.35010242, -0.029198067, 0.016302662, 0.17667587, 0.12605923, 0.1556697, -0.06061443, 0.05843511, 0.10891248, 0.01267106, -0.018492714, -0.15945031, -0.050723754) * go_3(1.0, 0.0); + result += mat4(-0.21555941, -0.016813517, -0.084676236, -0.07545412, -0.14518794, -0.014592766, -0.2446481, 0.0530632, 0.0847341, 0.12342537, -0.028644923, 0.083479315, -0.04179012, 0.0025225023, 0.16006976, -0.026940256) * go_3(1.0, 1.0); + result += vec4(-0.060742114, -0.037577342, 0.055704296, 0.03134311); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_1_tf +//!BIND conv2d_1_tf1 +//!SAVE conv2d_2_tf +//!WIDTH conv2d_1_tf.w +//!HEIGHT conv2d_1_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(0.13129333, -0.022117995, -0.009753253, 0.020439912, 0.044090994, -0.0916335, 0.0036765633, -0.11719207, -0.06413809, 0.04079378, -0.00085516454, -0.06306388, -0.12660664, -0.054126263, -0.005513979, 0.06364538) * go_0(-1.0, -1.0); + result += mat4(-0.028422508, 0.23270117, -0.28674677, -0.10820166, 0.024321957, -0.0811145, -0.07290707, -0.02125165, -0.064260505, 0.052076746, -0.009654081, 0.08363882, -0.02037171, 0.15006389, 0.121593125, -0.011237004) * go_0(-1.0, 0.0); + result += mat4(-0.14672333, 0.015381624, 0.1028172, -0.041823238, 0.0072677187, -0.042953942, 0.06426537, -0.0938381, -0.05990813, -0.04599802, -0.11264726, -0.027826328, -0.058160868, 0.10747306, -0.07327458, 0.07998872) * go_0(-1.0, 1.0); + result += mat4(-0.08702181, -0.03750975, -0.045659006, 0.04488332, 0.09102003, 0.066556975, -0.04353586, 0.08994567, -0.13561495, -0.10653702, 0.006989605, 0.028230097, 0.07177144, 0.2938447, -0.00943923, 0.022120917) * go_0(0.0, -1.0); + result += mat4(-0.1801194, -0.11119162, 0.1977298, -0.247902, -0.16654298, -0.07423158, 0.114130594, 0.0014401592, 0.006954727, -0.09810646, -0.051310766, 0.19487657, 0.2545855, -0.06328558, -0.04617056, 0.09444692) * go_0(0.0, 0.0); + result += mat4(0.011378825, 0.16044368, 0.017211074, 0.14472178, 0.032992378, -0.008925819, 0.035120245, -0.012409223, 0.074333005, 0.1178002, -0.128956, -0.13624239, -0.2791275, 0.21457297, -0.1476131, 0.04874687) * go_0(0.0, 1.0); + result += mat4(-0.03491764, -0.061763793, 0.05779039, 0.0054837577, -0.023937583, 0.08281698, 0.032306053, -0.014566218, 0.12738499, -0.0132100545, -0.051833414, 0.0057818824, 0.012158851, -0.20231532, -0.0043795826, 0.10285843) * go_0(1.0, -1.0); + result += mat4(-0.22269921, -0.15135509, -0.039143335, 0.033390045, 0.06770212, -0.14538582, -0.08011057, 0.03796648, -0.025913516, 0.13925864, 0.18309896, 0.012709204, -0.24912506, 0.3217706, 0.0394195, 0.017977878) * go_0(1.0, 0.0); + result += mat4(0.00080196525, 0.059145816, 0.05720508, 0.0056548906, 0.005168018, 0.09938438, 0.0200503, -0.05516137, 0.061309986, -0.019621318, -0.1541441, 0.019540716, 0.030571707, -0.09054893, 0.032851614, -0.27210873) * go_0(1.0, 1.0); + result += mat4(0.27061436, -0.114008114, -0.0020118617, -0.1656827, 0.09770587, 0.029897455, -0.03307522, -0.04661818, 0.033011347, 0.18498488, -0.05162084, 0.087471776, -0.24665618, -0.12538423, -0.08123797, -0.010210389) * go_1(-1.0, -1.0); + result += mat4(0.075188264, 0.0020608555, 0.18558815, 0.041179713, 0.11232638, 0.05507779, -0.19599183, 0.027942855, 0.06199144, 0.22141005, -0.06121163, 0.014993597, 0.24105869, -0.019737717, -0.112485714, 0.0157406) * go_1(-1.0, 0.0); + result += mat4(0.09425698, 0.0207658, 0.12074599, 0.009430481, 0.11889248, -0.025782838, 0.0034711843, 0.05113582, 0.012531833, -0.0018606635, -0.09137569, 0.018120576, 0.4051155, 0.02222076, -0.16001017, 0.10981527) * go_1(-1.0, 1.0); + result += mat4(-0.03582557, 0.014994796, -6.4688604e-05, 0.24618183, -0.11697727, 0.24388117, 0.038502026, -0.3511993, 0.101741396, -0.10748137, 0.035059888, -0.017535849, 0.09450039, 0.06541661, 0.12149035, 0.28798738) * go_1(0.0, -1.0); + result += mat4(-0.27143848, 0.017990451, -0.69144464, 0.037944376, -0.04551905, 0.09263134, 0.4259611, -0.14107811, -0.10641847, 0.23065196, 0.040813655, -0.07789163, 0.3087666, 0.08190437, 0.16409059, -0.06455426) * go_1(0.0, 0.0); + result += mat4(-0.08290655, -0.35286915, -0.18082355, -0.32229406, 0.1608227, 0.030915622, 0.09207708, 0.02655054, 0.039464593, 0.026095424, 0.052584656, 0.033881903, -0.01751319, -0.0011676399, 0.04002607, 0.1630013) * go_1(0.0, 1.0); + result += mat4(-0.012021132, 0.12163766, -0.07410629, -0.06879096, 0.017859738, -0.039261997, -0.028677614, -0.23610398, -0.15963873, -0.0006119958, 0.11275506, 0.0082659265, 0.05677582, 0.08676638, -0.08669759, -0.10475464) * go_1(1.0, -1.0); + result += mat4(0.12792721, 0.06888765, 0.31803077, 0.26002547, -0.067599155, -0.011822328, -0.2589909, -0.30024147, 0.11076704, 0.15200609, -0.018180368, -0.19146141, 0.22298847, 0.059484895, 0.034478076, 0.15610938) * go_1(1.0, 0.0); + result += mat4(0.0870121, -0.016420847, -0.011579898, 0.097182855, -0.120095566, -0.06843338, -0.043460473, -0.060684606, -0.027540063, -0.008499213, 0.033570655, -0.06866259, 0.01429712, -0.07424434, 0.0009466247, 0.09142678) * go_1(1.0, 1.0); + result += mat4(-0.03781424, 0.04587032, 0.03744051, 0.02712279, -0.051038064, 0.0669144, -0.02640278, 0.12384894, -0.0022533627, -0.010022036, 0.07536463, -0.030489929, 0.09418577, 0.155089, -0.011290433, -0.02102941) * go_2(-1.0, -1.0); + result += mat4(-0.0053278613, -0.07160643, 0.039028414, 0.04123311, -0.10693177, -0.1170874, 0.07230816, -0.033255517, -0.119176835, 0.0786526, -0.11880206, -0.11354601, -0.037539184, 0.14404313, 0.069760695, 0.024738638) * go_2(-1.0, 0.0); + result += mat4(0.03413808, -0.006487654, 0.10006853, 0.22228058, -0.13796462, -0.14042488, 0.04017443, -0.031790894, -0.06673143, 0.009888688, 0.08831443, -0.0045771743, -0.028375361, -0.04704813, 0.07128581, -0.07012518) * go_2(-1.0, 1.0); + result += mat4(-0.06954315, -0.23728988, -0.14192343, -0.08236467, -0.2552115, 0.04102959, -0.06355397, -0.08340241, 0.17617856, 0.20281969, -0.16249381, 0.10843737, -0.04392261, -0.08587206, 0.053069845, -0.15482199) * go_2(0.0, -1.0); + result += mat4(0.124981806, 0.12828638, -0.061472785, -0.20108232, -0.14905351, -0.40766275, -0.35427195, -0.13183996, 0.09307428, -0.07697028, 0.06702549, -0.22656697, 0.019868268, -0.19361132, 0.08784669, 0.20249842) * go_2(0.0, 0.0); + result += mat4(-0.004661343, -0.09333453, -0.24876262, -0.07906779, 0.110697776, -0.37069768, -0.042212646, -0.0046135853, -0.2254257, -0.023392014, 0.031476703, -0.045574382, -0.12675518, -0.076056994, -0.08228006, -0.040303517) * go_2(0.0, 1.0); + result += mat4(0.16182694, 0.0512523, 0.051189836, 0.048962783, -0.05156489, -0.17987493, -0.012037288, 0.06953726, -0.09458492, 0.1610021, -0.004063283, -0.032922342, 0.08995396, 0.1939926, -0.018710036, -0.08153231) * go_2(1.0, -1.0); + result += mat4(-0.064830944, 0.06121252, -0.18886387, -0.12976822, -0.031117212, 0.12219633, 0.19070715, 0.12495262, -0.11994464, -0.24687837, -0.08425294, -0.016920334, -0.13286817, -0.3260188, -0.11776061, 0.1651019) * go_2(1.0, 0.0); + result += mat4(-0.17652592, 0.002499805, -0.030541016, -0.01393431, 0.031418208, 0.08209422, 0.12430871, 0.4387016, -0.108871914, -0.09041422, 0.031226631, -0.1638517, 0.20756467, 0.014476537, -0.012701195, -0.03440563) * go_2(1.0, 1.0); + result += mat4(0.005320072, -0.0032291536, -0.017209187, 0.031944863, -0.2479921, -0.24433962, -0.13832912, 0.07835928, -0.17707248, 0.028202811, -0.19121435, 0.164587, 0.123152815, 0.0050288937, 0.084104605, -0.0380019) * go_3(-1.0, -1.0); + result += mat4(0.16008669, -0.018608516, -0.013778938, 0.033447385, -0.01242472, -0.070916265, 0.026909694, -0.07318777, 0.15158044, 0.12047607, -0.1709358, 0.2031767, 0.0025611701, -0.21457459, 0.2791286, 0.10159932) * go_3(-1.0, 0.0); + result += mat4(0.14320926, 0.020023825, -0.0484187, 0.011563084, -0.2640472, -0.013056275, 0.004234292, -0.095376395, 0.28363484, -0.0058227647, -0.0777649, 0.05238444, 0.41757923, -0.07081097, 0.012567031, -0.13029522) * go_3(-1.0, 1.0); + result += mat4(0.07266207, 0.042793367, -0.08212271, -0.23401663, -0.19457819, 0.4191269, -0.03095442, 0.15339781, -0.28451788, 0.09316364, 0.10231693, -0.22844811, 0.111623526, 0.120017685, 0.18777381, 0.014420896) * go_3(0.0, -1.0); + result += mat4(0.15037206, -0.29763284, 0.2601235, 0.0193363, 0.13686465, 0.009907918, -0.37781665, 0.04916627, 0.14114739, 0.5043813, 0.0447959, -0.029427614, 0.041768756, 0.27211213, 0.14163221, 0.086162075) * go_3(0.0, 0.0); + result += mat4(0.19159287, 0.21363218, 0.15053211, 0.08992885, 0.100828275, 0.09379921, 0.030783929, 0.11664482, -0.059145752, -0.19400764, -0.09351283, -0.016430443, -0.12910964, -0.067078374, 0.11760082, 0.121194765) * go_3(0.0, 1.0); + result += mat4(-0.055059325, 0.09299572, 0.06848913, 0.06334532, -0.1476285, 0.111801244, -0.033960916, 0.06474366, -0.04952303, 0.27885208, -0.052447475, 0.09226763, -0.15024844, -0.0033919013, 0.013498364, 0.09135676) * go_3(1.0, -1.0); + result += mat4(-0.017010042, -0.122343406, -0.19097193, -0.27957183, -0.18206005, 0.102321096, 0.22794476, 0.0439245, -0.23710132, -0.08070259, 0.17377135, 0.23811814, 0.17799385, 0.049567625, 0.1470908, 0.07329385) * go_3(1.0, 0.0); + result += mat4(0.0038071256, 0.19454515, -0.01222965, -0.07390379, -0.0532754, 0.03942833, 0.123840906, 0.023459576, -0.0658742, -0.023957543, -0.14682837, 0.1221027, -0.010986398, -0.066184506, 0.03026491, -0.0638446) * go_3(1.0, 1.0); + result += vec4(-0.06427697, -0.00039365015, 0.011889719, 0.060232002); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_1_tf +//!BIND conv2d_1_tf1 +//!SAVE conv2d_2_tf1 +//!WIDTH conv2d_1_tf.w +//!HEIGHT conv2d_1_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(-0.012110923, 0.07818654, 0.07964548, 0.11885079, -0.07694473, -0.01378252, 0.006632789, -0.12876098, 0.0069211307, 0.022278586, 0.069553085, 0.16569804, -0.11123615, 0.06125189, -0.11232848, 0.1559266) * go_0(-1.0, -1.0); + result += mat4(-0.3261174, -0.25586754, 0.21129315, 0.3135101, 0.1509055, 0.0044283345, 0.024674175, -0.08000473, 0.01213029, 0.09093019, 0.04942677, 0.09806723, -0.16454464, -0.14433062, -0.058094524, -0.060819894) * go_0(-1.0, 0.0); + result += mat4(0.023174008, 0.02858724, 0.07685972, 0.036857616, -0.10415571, 0.10241035, -0.01893166, 0.02065923, 0.058356714, 0.096426114, -0.03772327, -0.1529002, 0.13740575, -0.048291504, -0.06152548, -0.15199897) * go_0(-1.0, 1.0); + result += mat4(0.029300174, -0.13222043, 0.0139825605, -0.02274408, 0.062944874, 0.028447356, 0.05960515, 0.034447193, 0.03133432, -0.019283533, -0.024591971, -0.0043914663, 0.15245225, 0.006851478, -0.051783554, 0.17453748) * go_0(0.0, -1.0); + result += mat4(-0.09125915, 0.081739366, 0.01196335, 0.23130219, -0.22557035, -0.13537665, 0.0022028848, -0.043430023, 0.22759882, 0.07920754, -0.027986467, -0.14051494, -0.19557038, -0.03585936, -0.4258294, -0.03856216) * go_0(0.0, 0.0); + result += mat4(0.18511422, -0.09368415, 0.1551229, 0.04322566, -0.023400841, -0.02261204, 0.15129441, -0.007954805, -0.10739125, 0.019459398, 0.013128325, 0.018073296, 0.20886365, -0.20662378, -0.03814699, -0.09272838) * go_0(0.0, 1.0); + result += mat4(-0.027352437, -0.039882626, 0.12598103, -0.093930446, 0.030846786, -0.09325075, -0.009084744, -0.024584265, 0.07159868, 0.14162529, 0.19019091, 0.058855128, -0.09880401, -0.01843218, 0.14753596, -0.2449532) * go_0(1.0, -1.0); + result += mat4(0.06565521, 0.09150168, -0.08654865, 0.0829788, -0.07596146, -0.01815166, -0.08786775, -0.03477514, 0.20538878, -0.012766377, 0.020719538, 0.088188395, -0.034300096, 0.29972988, -0.20005241, 0.018425167) * go_0(1.0, 0.0); + result += mat4(0.11713916, 0.024167519, 0.05167596, -0.0027117804, -0.016994188, 0.048177514, -0.012556207, 0.010979094, 0.09098878, 0.028514355, 0.06063336, -0.06624107, 0.012754856, 0.013208708, -0.061374772, -0.0025992664) * go_0(1.0, 1.0); + result += mat4(-0.09053513, 0.03183455, 0.017340872, 0.12934409, -0.022161964, -0.0015361432, -0.049972344, -0.12763855, 0.12779881, -0.04697911, 0.018968226, -0.119873665, 0.05462772, -0.13919477, -0.10226718, -0.2540179) * go_1(-1.0, -1.0); + result += mat4(-0.29912186, -0.09291771, 0.050926663, 0.49361777, 0.21372582, 0.076717265, -0.058968987, -0.1572678, 0.3194591, -0.120582424, 0.03942037, 0.023128232, 0.24321598, 0.07046334, -0.21204855, -0.648296) * go_1(-1.0, 0.0); + result += mat4(0.05366883, -0.020366706, 0.020979457, -0.06893884, 0.04837168, 0.017253762, 0.008874203, -0.020785445, -0.20425391, 0.060179923, 0.046167206, 0.09863377, -0.14381303, 0.038928367, -0.06590863, -0.18408588) * go_1(-1.0, 1.0); + result += mat4(0.07099762, 0.2029403, -0.033945918, 0.15202214, 0.0901113, -0.27336198, -0.17693861, -0.16206753, -0.17642029, 0.09400492, -0.11165698, -0.07863893, -0.16306102, -0.056210615, 0.22173557, 0.013508989) * go_1(0.0, -1.0); + result += mat4(0.08541511, -0.27093616, -0.35273993, -0.48919773, 0.038383547, -0.16013749, 0.012996215, -0.03434873, 0.07024113, -0.28971404, 0.10623425, -0.0019642068, -0.062374946, 0.3291145, 0.22468035, -0.42971882) * go_1(0.0, 0.0); + result += mat4(0.020427933, 0.15062793, 0.08308975, -0.025095072, 0.030093266, -0.09649862, -0.03382388, -0.0016017791, 0.105402954, 0.020693144, -0.051065, 0.07704679, 0.02864139, -0.00135146, 0.03762216, 0.029277142) * go_1(0.0, 1.0); + result += mat4(0.01700994, 0.12214317, 0.06749582, 0.07354159, -0.093085855, -0.065021954, 0.010773045, -0.00095128635, -0.045384295, -0.072611265, -0.043900184, 0.049471326, 0.029131187, 0.03180158, -0.13313527, 0.05280797) * go_1(1.0, -1.0); + result += mat4(0.14751251, -0.15087761, 0.09932281, -0.099232934, -0.062390897, 0.112391844, -0.09159478, 0.15856399, 0.034708973, 0.01819943, -0.02730164, -0.13562973, -0.05687333, -0.0114601655, 0.07025971, 0.02496533) * go_1(1.0, 0.0); + result += mat4(-0.0117268525, -0.026162883, 0.07481553, 0.13420302, 0.029870516, 0.07405776, -0.06379041, 0.09631234, -0.07754842, 0.035888605, 0.0034764851, -0.040771756, -0.092022054, -0.034230903, -0.02281844, -0.0028173258) * go_1(1.0, 1.0); + result += mat4(-0.059846643, 0.016772347, -0.02287152, 0.07036337, -0.024946844, 0.09826078, -0.068491876, 0.20852126, 0.073890835, -0.058288682, 0.013093785, -0.05776076, 0.0516503, 0.052794468, 0.10837015, 0.038539834) * go_2(-1.0, -1.0); + result += mat4(-0.16391893, -0.008062687, -0.35022175, 0.2510062, -0.15820411, 0.048403125, 0.024878092, 0.037888516, -0.035924178, -0.068953894, -0.025386479, 0.24405715, -0.018495679, -0.051277515, 0.14754932, -0.031538483) * go_2(-1.0, 0.0); + result += mat4(-0.038429607, -0.047140498, -0.018157095, -0.029318782, -0.04094171, -0.11870087, 0.11214255, 0.07142628, 0.021007229, -0.005681072, 0.1662777, 0.10829575, 0.112268396, 0.03567479, -0.06738845, 0.0032037434) * go_2(-1.0, 1.0); + result += mat4(-0.032217573, 0.2102397, -0.20617546, -0.07920811, 0.12918773, 0.054486286, -0.13656865, 0.05806265, 0.01963165, 0.049910642, 0.15538268, 0.10724465, -0.09697837, -0.03070673, -0.0071386313, -0.11899626) * go_2(0.0, -1.0); + result += mat4(0.130827, 0.0051715383, -0.07212691, 0.45726067, 0.2773031, 0.2973666, 0.3951691, 0.01333662, -0.14561643, 0.04508669, 0.121690124, 0.13326228, -0.22579186, 0.058161184, 0.09281702, -0.00079749606) * go_2(0.0, 0.0); + result += mat4(-0.00771113, 0.09912341, -0.41895548, -0.06705759, 0.029148718, 0.052991726, 0.18665347, -0.031787418, 0.23053595, 0.09444956, 0.10691037, -0.06325714, -0.05335701, 0.1917427, -0.0065284846, 0.032622546) * go_2(0.0, 1.0); + result += mat4(-0.056801565, -0.019131258, -0.0939022, -0.08130343, -0.11051993, 0.0035269214, -0.047361933, -0.0543875, 0.10854369, 0.06445185, 0.016828364, -0.022595318, 0.1450623, 0.033027507, -0.020425137, 0.16169788) * go_2(1.0, -1.0); + result += mat4(-0.08747717, 0.07770065, 0.018155783, 0.07160794, 0.09860347, -0.04329888, -0.0043579484, -0.2014418, -0.060260013, 0.0036374568, -0.17566042, -0.2268221, 0.001273691, -0.2609373, -0.19417606, -0.04102927) * go_2(1.0, 0.0); + result += mat4(-0.086845055, -0.114253804, -0.13433142, -0.025941795, -0.0155711295, -0.13578776, 0.12059696, -0.08760523, -0.0057348222, 0.12164273, 0.07270617, -0.06352636, 0.08894258, 0.04140841, 0.1230304, -0.030357126) * go_2(1.0, 1.0); + result += mat4(0.03320213, 0.015911903, -0.06288296, -0.121976145, 0.2713457, 0.13913193, -0.092420585, 0.105714336, 0.10294281, -0.04591945, -0.11767934, 0.032249406, -0.06506192, -0.04639334, 0.08137017, -0.031746846) * go_3(-1.0, -1.0); + result += mat4(0.13717805, 0.0071242675, -0.077256985, -0.14974317, -0.08467893, -0.20126395, -0.06240603, 0.09554399, -0.075844854, 0.28380412, 0.046030026, 0.053188596, 0.50943077, 0.1179795, 0.32203588, -0.06712207) * go_3(-1.0, 0.0); + result += mat4(-0.18528835, 0.0016975187, -0.0041140947, 0.11234392, -0.34049067, -0.056880493, -0.04325441, 0.09905571, 0.10978758, 0.009608353, -0.10801905, -0.04071131, -0.09096832, -0.12350487, 0.011801418, 0.22521795) * go_3(-1.0, 1.0); + result += mat4(0.040283076, -0.034117915, -0.026142653, -0.06058959, 0.12511659, 0.4131219, 0.59190845, 0.39758852, 0.16032091, -0.5975032, -0.14516282, 0.115154505, 0.03874097, 0.18462797, 0.22934213, 0.05285643) * go_3(0.0, -1.0); + result += mat4(-0.17804009, 0.33769128, -0.14572927, -0.029545018, 0.3897, -0.055615567, 0.15232995, 0.48788264, -0.21422523, 0.03397293, 0.0337794, -0.19830915, -0.022457365, -0.35096076, 0.42616987, -0.19268763) * go_3(0.0, 0.0); + result += mat4(-0.13191561, -0.18337126, 0.017879983, -0.070472844, -0.09409196, -0.025770849, -0.060219247, 0.10869267, -0.17341033, -0.09199785, -0.0667796, -0.093538545, -0.21300837, 0.030474098, -0.04540468, 0.041321553) * go_3(0.0, 1.0); + result += mat4(-0.0998177, -0.08669185, -0.0090886615, 0.0021083376, 0.08900095, 0.5062186, 0.45537788, 0.029077586, -0.1001008, -0.0077697043, -0.0096318, 0.11706454, 0.07401959, -0.00650215, 0.06092762, 0.037442297) * go_3(1.0, -1.0); + result += mat4(-0.18500404, 0.0024998419, -0.11761331, -0.026825588, 0.27255726, 0.093010515, 0.3281413, -0.051473666, -0.050259475, -0.17258662, -0.23394547, 0.104795866, 0.035074063, -0.061560635, 0.05975411, -0.094255395) * go_3(1.0, 0.0); + result += mat4(-0.023440497, -0.021479638, 0.0036277648, 0.004972212, 0.02416659, -0.09856867, -0.03971455, -0.27094853, 0.026615402, -0.0047890246, -0.13755885, 0.16591635, -0.0016293586, 0.133207, 0.047790572, 0.029041538) * go_3(1.0, 1.0); + result += vec4(-0.0063728676, -0.029053684, -0.052831043, 0.006475641); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_2_tf +//!BIND conv2d_2_tf1 +//!SAVE conv2d_3_tf +//!WIDTH conv2d_2_tf.w +//!HEIGHT conv2d_2_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(-0.0431447, 0.047972627, 0.09522898, 0.19048582, 0.0015511789, 0.1182684, -0.065335006, 0.061233886, -0.02451869, 0.065670215, -0.015341636, 0.06836347, 0.10215459, 0.17516296, 0.0857072, 0.072732896) * go_0(-1.0, -1.0); + result += mat4(0.10117189, 0.049022958, -0.016017418, -0.12119866, 0.089112304, 0.016286526, -0.025251161, 0.03239003, -0.0783818, -0.086096615, -0.13673106, -0.15934734, -0.51308054, -0.061430074, -0.16208844, 0.2227776) * go_0(-1.0, 0.0); + result += mat4(-0.011567444, 0.025550444, -0.018439503, -0.015003767, 0.11606929, -0.11613111, -0.040906087, -0.015202219, 0.03932618, -0.1106059, 0.03703376, 0.018548314, -0.12761284, -0.038109995, -0.23577367, 0.20272344) * go_0(-1.0, 1.0); + result += mat4(0.025444161, -0.075270735, 0.10999789, 0.16305386, 0.016178958, -0.074034974, 0.1177035, -0.077481024, -0.047774278, -0.029782977, 0.23137823, -0.2389453, 0.033015423, -0.10381626, -0.16437943, 0.20906886) * go_0(0.0, -1.0); + result += mat4(-0.098473966, 0.11013442, -0.18486807, 0.1907086, -0.17564997, -0.08509439, -0.42472756, -0.17446618, 0.3440862, 0.12719585, -0.12213955, -0.02246555, 0.18982963, 0.20809166, -0.36067408, 0.51116616) * go_0(0.0, 0.0); + result += mat4(-0.019805575, 0.07812505, 0.061653323, -0.08379226, 0.026396899, 0.009063019, -0.10845824, 0.0827647, 0.045301896, -0.07748021, -0.07435832, 0.14860612, -0.077515624, 0.010588131, -0.22704287, 0.26849246) * go_0(0.0, 1.0); + result += mat4(-0.02884339, -0.09512523, -0.038564682, 0.08862835, 0.041666254, -0.10532901, 0.040582962, -0.10063983, -0.15736029, -0.03644334, -0.005061672, 0.04302295, -0.046482194, -0.05262547, 0.05110866, 0.03204655) * go_0(1.0, -1.0); + result += mat4(-0.005932702, 0.033263832, 0.0044865874, -0.02328917, 0.056534443, -0.14084046, 0.022353357, 0.015087431, -0.2734596, -0.026544483, 0.06297078, 0.11277746, 0.06127936, 0.02466357, -0.04970561, 0.02098484) * go_0(1.0, 0.0); + result += mat4(0.013603583, 0.036264602, 0.10985147, 0.01532773, -0.09012781, 0.1132652, -0.17016481, 0.025332611, -0.077462606, 0.02990799, -0.10627784, -0.006231141, -0.089164406, -0.051507175, -0.043900985, 0.09049239) * go_0(1.0, 1.0); + result += mat4(-0.15391691, 0.1915742, 0.014101639, -0.022153432, 0.06291936, -0.017871676, -0.016763045, -0.14741553, -0.011252563, -0.20720159, -0.030648025, -0.0142307645, 0.010291614, -0.09243969, -0.052940153, 0.0061574522) * go_1(-1.0, -1.0); + result += mat4(0.032283742, 0.030768922, 0.1070225, -0.027818602, 0.10032608, 0.0061178426, -0.03561339, -0.26687133, 0.14369439, -0.11362691, -0.08980895, 0.066520914, 0.33414948, 0.006998835, 0.09193012, -0.2857383) * go_1(-1.0, 0.0); + result += mat4(-0.059588976, -0.02046844, -0.042585023, 0.031939838, 0.12796514, -0.06155685, 0.03540324, 0.009929082, -0.0039611827, 0.10790477, 0.049435645, -0.083034374, 0.23874004, -0.07460337, -0.020173345, -0.2006587) * go_1(-1.0, 1.0); + result += mat4(-0.13217632, 0.052319963, -0.026713084, -0.0051368694, -0.10380872, -0.28659084, 0.0044393227, 0.005174543, -0.05092618, -0.07092548, -0.027397033, -0.01609789, 0.13699281, -0.14706929, 0.17737861, -0.23746766) * go_1(0.0, -1.0); + result += mat4(0.19268502, 0.14133929, -0.1305119, -0.4034132, 0.057504695, -0.24550998, -0.081932545, 0.45489246, -0.29331785, 0.19625074, 0.063166246, 0.15158689, 0.6715147, -0.4610189, 0.08921431, 0.17761138) * go_1(0.0, 0.0); + result += mat4(0.044718128, -0.011809122, 0.024131307, -0.30093196, -0.05607289, 0.047759805, 0.004210022, 0.098192796, 0.030430846, 0.008207501, 0.12266905, -0.10549182, 0.11584339, -0.091016166, -0.08635591, -0.13889709) * go_1(0.0, 1.0); + result += mat4(-0.19226642, 0.07147627, -0.14759602, 0.4041079, 0.0744628, -0.19612685, 0.1498252, -0.06273549, 0.017959936, 0.10858338, -0.14985329, 0.062042814, -0.13240446, -0.24362786, 0.113626175, -0.15332204) * go_1(1.0, -1.0); + result += mat4(0.08383099, -0.13935047, -0.25981048, 0.16491203, 0.07513876, -0.28346774, 0.19722275, -0.044425573, 0.020889329, -0.22140723, 0.025403097, -0.09183192, 0.014202567, -0.18666178, 0.062913105, -0.047674105) * go_1(1.0, 0.0); + result += mat4(-0.1862771, 0.25878942, -0.043018065, 0.22144824, 0.016088247, 0.12113542, -0.11965952, -0.01587184, 0.07830932, -0.16069177, 0.13421321, 0.018718706, 0.09548377, 0.018543294, 0.013614677, -0.1054485) * go_1(1.0, 1.0); + result += mat4(-0.2121733, -0.015635416, 0.027564054, -0.085904464, 0.064805664, -0.070543915, 0.08966146, -0.06359783, 0.01131311, 0.046913184, -0.09809833, -0.092063695, -0.087217696, 0.012411829, 0.0045399712, 0.027389864) * go_2(-1.0, -1.0); + result += mat4(-0.19307798, 0.09449126, 0.084036835, 0.30262446, 0.011706106, 0.029800637, 0.04612629, 0.006186647, 0.11228541, 0.055147965, 0.17659879, -0.023410015, 0.19965266, -0.06684007, -0.081968054, -0.052410994) * go_2(-1.0, 0.0); + result += mat4(-0.058564443, 0.08252549, 0.058217794, 0.0864448, -0.25663558, 0.080260284, -0.0010294432, 0.05830051, -0.07684524, 0.1820709, 0.04438993, 0.019178499, -0.12425012, -0.04596089, -0.010032888, -0.0012803525) * go_2(-1.0, 1.0); + result += mat4(-0.43352658, 0.15262963, 0.25620222, 0.22428556, 0.09667152, 0.0037820593, -0.07951691, -0.11553085, 0.12982155, 0.17988266, -0.14283511, 0.074744284, 0.03604327, 0.00452661, -0.12865154, -0.020020623) * go_2(0.0, -1.0); + result += mat4(0.06850602, -0.18057181, 0.2093389, -0.07333886, 0.28406742, -0.048766967, 0.18114483, 0.47292945, -0.2340266, -0.06862712, 0.28263155, 0.3150323, -0.054724697, -0.16958356, 0.27928987, -0.19666018) * go_2(0.0, 0.0); + result += mat4(0.03281329, 0.0038649621, -0.07108877, 0.10791149, 0.15235375, -0.3083721, 0.168294, 0.10379698, 0.029038485, 0.16282903, 0.04483725, -0.018684763, 0.108186625, 0.027885616, -0.019351846, 0.1623065) * go_2(0.0, 1.0); + result += mat4(-0.110499054, 0.31347123, 0.030852, 0.01631416, -0.1466389, 0.080429435, -0.18689284, 0.10667815, 0.20645237, -0.18004708, -0.10570413, -0.15435064, -0.019000605, -3.126077e-06, 0.037761535, -0.015040956) * go_2(1.0, -1.0); + result += mat4(-0.023364332, -0.023399066, 0.2712722, 0.049637552, -0.10222765, -0.2698945, 0.20991959, 0.04921932, 0.21510898, -0.0751939, -0.19781734, -0.28162366, -0.041881047, 0.0065111094, -0.04102195, 0.0982682) * go_2(1.0, 0.0); + result += mat4(-0.032176614, 0.019144032, -0.08985387, 0.091637276, 0.1012352, 0.0003583357, 0.07897295, -0.09531175, -0.001155058, 0.074372366, -0.026186578, 0.07283374, 0.06052053, 0.009307753, -0.03874333, -0.06228009) * go_2(1.0, 1.0); + result += mat4(-0.022224072, -0.15717922, -0.1406057, -0.05941157, -0.028769474, -0.21226564, -0.036570027, 0.22266355, 0.14120889, 0.014577123, 0.10216447, 0.018429281, 0.056729726, -0.055834044, 0.058146577, -0.11999068) * go_3(-1.0, -1.0); + result += mat4(0.009995364, -0.020045493, -0.0057422677, 0.0643022, 0.016475432, -0.030856136, 0.042140726, 0.15077904, -0.32955253, 0.0694449, 0.17931722, 0.3439302, -0.12484157, -0.10958869, -0.15755124, -0.09755644) * go_3(-1.0, 0.0); + result += mat4(-0.008314924, 0.07704758, 0.043228816, -0.08110893, 0.099286236, -0.053224478, 0.22877018, -0.189486, -0.00798416, 0.018341504, 0.10734141, 0.0752633, -0.042524844, -0.086395286, 0.14299925, 0.026488977) * go_3(-1.0, 1.0); + result += mat4(-0.052531082, 0.19139186, 0.12205995, -0.2573172, 0.15157184, 0.0073150825, 0.089774385, 0.06604469, -0.16528498, -0.002511137, 0.14287429, -0.07819732, 0.025014274, 0.15338829, 0.0761692, -0.02803716) * go_3(0.0, -1.0); + result += mat4(-0.21000335, 0.15277153, 0.08546171, 0.2816124, -0.16559112, -0.11068559, 0.47053605, -0.009787771, -0.0013089112, -0.06985127, 0.44743782, 0.25142467, -0.32670796, 0.044035822, -0.12545367, -0.2996084) * go_3(0.0, 0.0); + result += mat4(-0.11526387, 0.15654811, 0.099616654, 0.15473685, 0.21278231, 0.046207245, 0.117993094, -0.26825273, -0.12539764, 0.14013724, 0.17357737, -0.05387817, 0.076738276, -0.13339446, 0.15005626, -0.2108176) * go_3(0.0, 1.0); + result += mat4(-0.0008846504, -0.05998622, -0.028892396, 0.04784136, 0.0104263965, 0.10899508, -0.073364735, 0.077516064, -0.074248806, -0.21749993, -0.26203, 0.041161157, 0.09366407, -0.026498007, 0.0122177545, 0.03892727) * go_3(1.0, -1.0); + result += mat4(0.04349908, 0.13671173, 0.2242545, -0.028021423, -0.03802222, 0.0052366396, -0.010709643, 0.031290106, 0.06291333, -0.024909683, -0.15439379, -0.04502091, 0.2062182, -0.5983536, -0.09670497, -0.38446042) * go_3(1.0, 0.0); + result += mat4(-0.008962513, 0.13044207, 0.04964221, 0.012250417, 0.012129821, 0.019985713, -0.06421885, 0.009168735, -0.044516414, 0.071368866, -0.006634213, 0.06497366, 0.08578495, -0.10586125, 0.06628038, -0.14006054) * go_3(1.0, 1.0); + result += vec4(0.056541316, 0.041788545, -0.036094554, -0.021763096); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_2_tf +//!BIND conv2d_2_tf1 +//!SAVE conv2d_3_tf1 +//!WIDTH conv2d_2_tf.w +//!HEIGHT conv2d_2_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(0.0647927, 0.053666476, -0.14723225, 0.027874574, -0.0003166473, 0.07337155, -0.061972085, -0.012667777, -0.17071614, 0.091927536, -0.051160213, 0.21336353, 0.13854574, 0.09582817, 0.032316446, 0.13838023) * go_0(-1.0, -1.0); + result += mat4(-0.0398984, 0.108049214, 0.093780346, -0.022015186, -0.15188989, -0.1381083, 0.2998843, 0.21623154, -0.08862326, 0.025862623, 0.06895634, 0.13529755, 0.06957801, -0.0011681129, 0.105972745, -0.04722446) * go_0(-1.0, 0.0); + result += mat4(-0.026321493, -0.04828038, -0.012545767, -0.005490858, -0.054038163, 0.075943105, -0.11526662, 0.022242405, -0.03543104, -0.12451852, -0.14911178, 0.013503498, 0.08773292, 0.09695139, -0.013498657, -0.27424073) * go_0(-1.0, 1.0); + result += mat4(0.018575635, -0.11321618, -0.07853153, 0.04104883, 0.0018416744, 0.11579002, 0.03685964, -0.031546146, -0.1755398, 0.23517849, -0.08095411, 0.031999595, -0.18542038, -0.26171613, -0.20567231, -0.05683613) * go_0(0.0, -1.0); + result += mat4(0.1538556, 0.21723682, 0.12131733, -0.15308167, 0.103326, -0.006956118, 0.043583486, -0.23811384, -0.103285454, 0.05543916, -0.37894246, 0.32072112, 0.22651967, 0.03516268, 0.34612176, 0.23688535) * go_0(0.0, 0.0); + result += mat4(0.040021293, 0.0029912095, 0.04885362, 0.061496444, 0.016926387, -0.118446946, 0.038948335, -0.0934512, -0.25194243, -0.054018084, -0.07149527, 0.017903058, 0.0845516, 0.33802906, 0.11953944, -0.081294954) * go_0(0.0, 1.0); + result += mat4(-0.09558082, -0.36974236, -0.07524102, 0.11131445, 0.047626104, 0.12854609, -0.10264962, -0.044669047, -0.05572307, 0.34475142, -0.16806377, -0.0037204176, 0.03400533, -0.04047774, 0.024379745, 0.09056291) * go_0(1.0, -1.0); + result += mat4(-0.039392482, 0.2553437, 0.11705501, 0.03219211, 0.073977776, -0.16610906, -0.032796364, -0.054669864, -0.07123178, 0.00079619256, -0.36920992, -0.029054813, 0.12830003, 0.004987549, 0.08724278, -0.029499404) * go_0(1.0, 0.0); + result += mat4(0.021272454, -0.063295126, 0.011779576, 0.103093, -0.011095461, 0.027948728, -0.014605259, -0.04723974, -0.05334346, -0.044831257, -0.07296399, -0.03314197, -0.01687865, -0.09261895, -0.06128567, 0.092708185) * go_0(1.0, 1.0); + result += mat4(0.0077418387, 0.00871427, 0.060824487, 0.1093608, -0.021077013, -0.057341542, -0.04769576, -0.08144089, 0.0212823, -0.06731425, -0.04134463, -0.0016761447, -0.03402026, 0.036424547, 0.11689576, -0.14946719) * go_1(-1.0, -1.0); + result += mat4(0.18536687, 0.020073935, 0.17041959, 0.024790209, 0.08397728, -0.13884324, 0.013950321, -0.055075396, -0.09317963, -0.05723721, -0.060491834, 0.0017911601, -0.109154835, 0.010338362, -0.1982491, -0.21752335) * go_1(-1.0, 0.0); + result += mat4(0.031852514, 0.031424347, 0.07817056, 0.07770759, 0.019805199, -0.091223724, 0.11914662, 0.1673029, -0.018734453, 0.16275099, 0.23245652, 0.36139074, -0.1396047, -0.14774057, 0.13756078, -0.123794965) * go_1(-1.0, 1.0); + result += mat4(-0.034937833, 0.20777488, 0.10104809, -0.035140667, 0.2536575, 0.010970045, 0.16896339, -0.081219964, -0.062478427, -0.0010431948, -0.027980985, 0.11446318, -0.127309, 0.21002083, 0.044436257, -0.16986957) * go_1(0.0, -1.0); + result += mat4(0.06309646, -0.042341243, 0.36642808, 0.18653205, 0.06973023, 0.06315932, -0.323688, 0.25672218, 0.042820994, 0.13792914, -0.12892757, -0.09220378, -0.18939693, 0.03862022, -0.17376114, -0.24673308) * go_1(0.0, 0.0); + result += mat4(-0.02130602, -0.35428852, -0.011634983, -3.9823462e-05, 0.110818714, -0.2981158, 0.060209107, 0.012538829, -0.0744833, -0.050204318, -0.12676497, -0.031484153, -0.28799182, 0.22338839, -0.070876874, -0.02102363) * go_1(0.0, 1.0); + result += mat4(-0.07929991, 0.014598492, 0.23034762, 0.024872296, 0.07480494, -0.17139243, -0.014421178, 0.056448363, -0.028626937, -0.022152562, 0.044871796, -0.048653606, 0.009350802, 0.019022083, -0.08554845, -0.0922645) * go_1(1.0, -1.0); + result += mat4(-0.027405115, 0.1831188, 0.28516722, 0.19882526, 0.27299204, -0.06910511, 0.03244419, -0.0031333128, 0.061055277, -0.114398144, 0.03729459, -0.07840815, -0.37776002, -0.24129418, -0.54815483, -0.2702045) * go_1(1.0, 0.0); + result += mat4(0.053723935, 0.13472083, 0.09563273, 0.19009806, -0.18722993, -0.25939655, -0.016197463, -0.067061596, 0.1647598, 0.061905228, 0.06191816, -0.018582113, -0.07218153, 0.11278394, 0.05478068, -0.104871586) * go_1(1.0, 1.0); + result += mat4(0.0036616288, -0.045782693, -0.226954, -0.05043515, -0.078096785, -0.036197383, 0.09269631, 0.016823346, -0.0060579977, -0.041455746, 0.09032774, -0.09217121, 0.058089796, 0.060311552, 0.033079024, 0.022586476) * go_2(-1.0, -1.0); + result += mat4(0.0436363, -0.079482526, 0.0027447809, 0.039558932, 0.13275702, 6.898711e-05, -0.21961488, -0.11315821, 0.0076181027, -0.025279062, -0.15829584, -0.063141204, 0.062049046, 0.13117202, -0.02435016, 0.109555416) * go_2(-1.0, 0.0); + result += mat4(-0.010148116, 0.056620967, -0.015910713, -0.07370375, 0.1529919, 0.005792597, 0.02771225, -0.17027487, 0.096740395, 0.063347995, 0.17823112, 0.054105148, 0.04995114, -0.28613812, 0.06369567, 0.15978208) * go_2(-1.0, 1.0); + result += mat4(-0.13688345, 0.16967694, -0.061759472, 0.013682004, -0.1290496, 0.07167547, -0.065592445, -0.17897636, 0.057080988, 0.035630587, 0.09140394, -0.08695068, 0.16807681, 0.014749346, 0.07875138, 0.034913708) * go_2(0.0, -1.0); + result += mat4(-0.098915346, -0.31459075, -0.10892429, 0.1557498, -0.19764107, -0.26881596, -0.03589311, 0.45288458, -0.34171388, 0.12675741, 0.18415868, -0.19770056, 0.29025507, -0.15812592, 0.09685835, 0.0027761247) * go_2(0.0, 0.0); + result += mat4(0.06425249, -0.01169722, 0.06379363, 0.053835012, -0.07356561, -0.06367294, 0.108630784, -0.14137438, 0.08536725, -0.03209748, 0.07250959, -0.014214082, 0.07170588, -0.25647813, 0.1092683, 0.18791042) * go_2(0.0, 1.0); + result += mat4(-0.023783233, 0.14261739, 0.102011986, -0.03633555, -0.05032627, 0.09378387, 0.11764051, 0.1353335, 0.032817088, -0.1352964, -0.00667997, -0.13388929, 0.022861317, 0.0037358075, 0.018605746, -0.0009892831) * go_2(1.0, -1.0); + result += mat4(0.22419162, -0.23105696, -0.09900454, -0.15831396, 0.12398773, 0.097933106, -0.13189293, 0.1330756, -0.19673057, -0.037342317, -0.13462654, -0.08974021, 0.030326528, -0.0815862, -0.118352115, 0.009187904) * go_2(1.0, 0.0); + result += mat4(-0.012130391, -0.06408448, 0.13710785, -0.06678414, -0.09970725, -0.14895032, -0.02366641, 0.029581001, -0.07101809, 0.09414698, 0.018300869, 0.009139046, -0.0027311493, -0.2359952, -0.011602826, -0.007582444) * go_2(1.0, 1.0); + result += mat4(-0.15473361, -0.06868751, -0.030721204, -0.08650113, 0.071349874, -0.08177769, 0.1611948, 0.18305337, -0.0144878505, 0.10975452, -0.026968453, -0.04909913, -0.059665974, 0.056036238, -0.11623168, -0.10584912) * go_3(-1.0, -1.0); + result += mat4(-0.096973225, 0.054132458, -0.010600018, 0.089397885, -0.0031138035, 0.037452973, 0.041115325, 0.1924831, 0.14759748, 0.032560788, -0.082884625, 0.0324635, -0.083511285, -0.050381303, 0.025589975, -0.0981257) * go_3(-1.0, 0.0); + result += mat4(-0.09183111, 0.034952193, -0.048511654, 0.020719057, 0.1863456, 0.01902738, 0.14455654, -0.008500172, 0.16385981, -0.07806569, -0.031216217, -0.17002788, -0.08882952, 0.07335293, -0.2223089, 0.01706056) * go_3(-1.0, 1.0); + result += mat4(-0.08361569, 0.046698716, -0.016646344, 0.09351987, 0.0054158634, -0.13641126, -0.12396605, 0.011380122, 0.040951792, -0.11222528, -0.0031548145, -0.0022303525, 0.0350846, -0.03280425, -0.09972476, -0.113325305) * go_3(0.0, -1.0); + result += mat4(-0.19961461, -0.27561286, -0.12783135, -0.062596925, 0.005870981, -0.24796526, 0.18717633, -0.16945636, -0.076396205, -0.08411448, 0.13751988, 0.21014418, -0.008655945, -0.09848541, -0.14536901, -0.2132181) * go_3(0.0, 0.0); + result += mat4(0.14118621, 0.20831147, -0.020545695, 0.008340737, 0.016840864, -0.16912372, -0.121718146, 0.15108089, -0.19803092, -0.07827729, -0.047639225, -0.12277847, 0.04974115, -0.09349339, -0.2756667, -0.19581003) * go_3(0.0, 1.0); + result += mat4(-0.0036992705, 0.16539848, 0.022026122, 0.07740234, -0.035687633, -0.004568715, 0.017408118, -0.09757294, -0.094941914, -0.3381112, -0.12724453, 0.025583982, -0.18571027, 0.047607586, -0.0704089, -0.055323426) * go_3(1.0, -1.0); + result += mat4(0.13821335, 0.028168043, 0.09990671, -0.032266147, -0.067236245, 0.11512147, -0.112986445, -0.10818019, -0.10062181, 0.21276556, 0.01681818, 0.069806606, 0.09628121, 0.06456379, 0.10394843, -0.02343886) * go_3(1.0, 0.0); + result += mat4(0.041937463, 0.072631165, 0.045366894, -0.0046993676, 0.03946691, 0.121010706, -0.030089365, -0.007266469, 0.0092267515, 0.14853416, -0.033248078, -0.027284347, -0.10031526, 0.15864117, -0.16782752, -0.18466589) * go_3(1.0, 1.0); + result += vec4(0.07722432, -0.025165567, 0.034291282, -0.09902708); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_3_tf +//!BIND conv2d_3_tf1 +//!SAVE conv2d_4_tf +//!WIDTH conv2d_3_tf.w +//!HEIGHT conv2d_3_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(-0.004729794, -0.0124398535, -0.08538641, -0.058604605, 0.008671952, 0.25604513, 0.020800482, 0.24144122, -0.028920606, -0.04705229, 0.030192787, 0.0010597534, 0.017666103, 0.0041322373, 0.20027764, 0.08919112) * go_0(-1.0, -1.0); + result += mat4(0.0001626656, 0.05816014, -0.0060765734, 0.08811165, 0.35835367, -0.016291425, -0.56892496, 0.083845764, 0.15026698, -0.15916558, 0.08069463, -0.3931291, -0.0123534845, -0.111639686, -0.14637001, -0.08171439) * go_0(-1.0, 0.0); + result += mat4(-0.114976816, 0.023376396, 0.13855027, 0.07438716, -0.069991484, 0.20377779, 0.23929878, -0.040769435, 0.018832395, 0.005638609, -0.091848075, 0.027843866, 0.023744943, -0.06620523, -0.11678267, 0.0844119) * go_0(-1.0, 1.0); + result += mat4(0.0035854098, -0.08432094, -0.17799544, -0.10041983, 0.25605857, 0.021009786, 0.030499447, -0.09928291, 0.052178737, -0.08286175, -0.057888374, 0.024606042, 0.046342995, 0.13875343, 0.11279266, 0.19826262) * go_0(0.0, -1.0); + result += mat4(-0.016232021, -0.21539623, 0.0936961, 0.021143785, 0.094262615, 0.049040064, 0.40978724, 0.15347758, 0.08884813, -0.24887115, -0.14756748, -0.5020875, 0.112477, 0.1466549, -0.33418837, 0.5769466) * go_0(0.0, 0.0); + result += mat4(-0.16832942, -0.07354198, -0.12081261, -0.055348314, 0.39716053, 0.25583258, 0.09870877, 0.2151021, -0.025700683, -0.1801462, -0.04616654, -0.02782245, -0.054461803, -0.00042802413, -0.00163228, -0.004240747) * go_0(0.0, 1.0); + result += mat4(-0.05193433, -0.0018198475, -0.17647028, -0.19462106, 0.1538165, 0.054894235, 0.12183955, 0.07340974, -0.0019901982, 0.0357373, -0.07597063, -0.06681543, -0.00090057997, -0.053894397, -0.010301875, -0.16553953) * go_0(1.0, -1.0); + result += mat4(-0.30873474, -0.2836045, 0.057037193, -0.5016378, 0.11952749, 0.102353275, 0.2351629, -0.14635189, -0.019398788, -0.08776502, 0.021669978, -0.089918956, -0.2187901, -0.1180891, -0.049789533, -0.16109149) * go_0(1.0, 0.0); + result += mat4(-0.078335494, -0.08867304, 0.03349591, -0.1000293, -0.20235832, 0.22917585, -0.09905303, 0.08381748, 0.014350217, -0.14478815, -0.027479894, -0.026432173, -0.10309177, -0.09860884, -0.019177807, -0.06963025) * go_0(1.0, 1.0); + result += mat4(0.008169383, 0.12532842, -0.23369955, 0.077973194, 0.09076616, -0.021277165, 0.1721421, -0.26914293, -0.014729218, -0.023279984, -0.057670787, 0.003598546, -0.015225789, -0.0115396585, -0.26196182, -0.10724508) * go_1(-1.0, -1.0); + result += mat4(0.16542235, 0.06589374, 0.07410237, 0.26753154, -0.3356288, 0.3096256, 0.07112498, -0.0992165, 0.15020338, -0.11021673, 0.18803611, 0.12918204, 0.109007336, -0.031968266, 0.057093572, 0.035949256) * go_1(-1.0, 0.0); + result += mat4(0.065006174, 0.031055925, 0.0390232, -0.01678507, -0.21553491, 0.14171642, -0.19541772, -0.033691674, -0.06241631, 0.07497651, 0.024557155, 0.056778047, -0.060191352, -0.0261998, 0.07493729, -0.0699132) * go_1(-1.0, 1.0); + result += mat4(-0.008541382, 0.020270415, -0.027760057, -0.040962905, -0.26732433, 0.34379438, -0.23012447, 0.0051356517, -0.04059567, 0.0972959, 0.039965224, -0.14796777, -0.0016924662, -0.116963714, -0.026353523, -0.29799464) * go_1(0.0, -1.0); + result += mat4(0.03329303, -0.12663862, -0.0004959157, -0.11162377, 0.26238343, 0.43260252, -0.16504994, 0.10727678, -0.22505566, 0.43474057, 0.43304008, 0.05143919, 0.40494493, 0.08689636, -0.035733614, 0.25727916) * go_1(0.0, 0.0); + result += mat4(0.12175736, -0.014467151, -0.17461288, -0.18480565, -0.26439998, 0.307935, -0.058916792, -0.014292711, -0.0569471, 0.10751278, -0.04134206, 0.1847734, -0.07519831, -0.033909313, -0.05001451, -0.136606) * go_1(0.0, 1.0); + result += mat4(0.1424893, -0.026820501, 0.19645774, -0.0011315406, -0.14680974, 0.07662838, 0.21108222, 0.13260938, 0.17923595, -0.085527614, 0.08217639, 0.06579479, 0.05985784, -0.09016323, 0.11172888, 0.111903176) * go_1(1.0, -1.0); + result += mat4(0.19842595, 0.0093640275, 0.10433465, 0.13341904, -0.082806975, 0.22555825, -0.1315717, 0.11907785, 0.24012424, 0.47776055, 0.1835734, 0.17483878, 0.079803735, 0.01155073, -0.21146573, -0.16484722) * go_1(1.0, 0.0); + result += mat4(0.15064004, 0.021381427, 0.18301587, 0.21225913, 0.054995645, 0.03212186, 0.052798916, -0.048424408, 0.03609021, 0.0964704, -0.059469886, -0.05133066, -0.08157349, 0.051145166, -0.09107608, -0.1362262) * go_1(1.0, 1.0); + result += mat4(0.090521574, -0.014747857, -0.081675015, -0.118686825, 0.04848682, -0.033071827, 0.008534588, 0.023765508, 0.16849907, -0.21797262, -0.17049783, -0.07824179, -0.033794608, 0.052612655, 0.095820345, -0.07262317) * go_2(-1.0, -1.0); + result += mat4(0.22816367, -0.13772108, -0.036353834, -0.47638395, -0.0530902, 0.14089061, 0.076203234, 0.18006112, 0.121814854, -0.20750527, 0.08266107, -0.28634354, 0.14301859, -0.13458411, 0.00501663, -0.039783802) * go_2(-1.0, 0.0); + result += mat4(-0.103384845, -0.14389835, 0.08275834, -0.068423435, 0.22643796, -0.02966374, -0.2847584, 0.037081387, 0.02349005, -0.19353923, -0.00095957273, -0.13623689, -0.073120415, 0.03941467, 0.21864155, -0.014019576) * go_2(-1.0, 1.0); + result += mat4(-0.082576886, 0.17085212, 0.08971252, -0.04213377, -0.032548156, 0.022137715, 0.08399252, -0.0011743539, -0.09410863, -0.41728264, -0.20709297, -0.18933547, 0.027059928, 0.09743364, 0.2504647, -0.041173562) * go_2(0.0, -1.0); + result += mat4(-0.20924084, 0.291118, 0.029851688, 0.16953468, 0.02936709, 0.12213576, 0.22944322, 0.108747594, 0.0001881129, -0.27398208, -0.009702691, 0.15449248, -0.9472944, -0.26114875, -0.28161275, -0.3495961) * go_2(0.0, 0.0); + result += mat4(-0.12994622, -0.2758638, -0.1091727, -0.0968308, -0.14323105, 0.035175014, -0.08023811, 0.006023802, -0.031529594, -0.1486306, -0.3398172, -0.23240276, -0.29163983, 0.173475, 0.18809283, 0.22197202) * go_2(0.0, 1.0); + result += mat4(0.048254848, -0.083444916, -0.014334202, 0.060992356, -0.023099286, -0.09492961, 0.05592045, 0.0026059286, 0.08998117, -0.108810075, -0.053304546, 0.045926623, 0.068255246, 0.099023566, 0.01595483, 0.1336309) * go_2(1.0, -1.0); + result += mat4(0.21916585, 0.2837387, 0.14624594, 0.18843961, -0.06747584, 0.054924384, -0.082568415, 0.05011459, 0.014297759, -0.3884833, -0.054417178, -0.18970548, 0.088336475, -0.030646667, -0.2980552, -0.030035203) * go_2(1.0, 0.0); + result += mat4(-0.02748568, -0.011897529, -0.2370837, -0.016740574, -0.0282112, 0.050353892, -0.10761107, -0.00036999505, 0.037646662, -0.17742962, 0.06489219, -0.158852, -0.08016933, 0.07808515, -0.105895035, 0.079869986) * go_2(1.0, 1.0); + result += mat4(-0.0058994526, -0.037170693, 0.2574696, 0.06199102, -0.04497728, -0.10667442, -0.15183865, 0.0212881, -0.030842574, 0.073473394, 0.010764398, -0.00084518327, -0.03893014, -0.009649613, 0.07443129, 0.15108284) * go_3(-1.0, -1.0); + result += mat4(0.11325495, -0.096435815, -0.097331434, -0.049700152, -0.17231967, 0.047090057, -0.019111065, 0.104790315, -0.15004838, 0.13950798, 0.055996202, -0.070548095, 0.047154237, -0.007650949, -0.053611025, -0.012242293) * go_3(-1.0, 0.0); + result += mat4(0.12787002, -0.04958212, 0.053988468, 0.0017896162, 0.049493514, -0.009475431, -0.0022641935, 0.03933694, -0.005174597, 0.043754533, -0.1432976, 0.037084177, -0.04601288, -0.032077815, -0.059897035, 0.12584484) * go_3(-1.0, 1.0); + result += mat4(0.019409029, 0.10492923, 0.268368, 0.12597778, -0.17733063, -0.0085961, -0.27136415, -0.049664587, 0.012515404, -0.21444482, -0.39275557, -0.12297177, 0.06800057, 0.19228315, 0.06245887, 0.35772634) * go_3(0.0, -1.0); + result += mat4(-0.16317715, 0.2288402, -0.23235172, 0.22230752, -0.1646375, 0.13366091, 0.16681044, -0.17399235, 0.33997267, -0.3179832, -0.34756508, 0.39843196, -0.10748536, 0.322923, 0.23339489, 0.08684083) * go_3(0.0, 0.0); + result += mat4(0.02835275, 0.12314228, 0.24030593, 0.30856124, 0.055735108, -0.044914473, 0.0031432225, 0.07469899, 0.1778018, 0.107083894, -0.023706734, -0.15501897, 0.0943098, -0.034707237, -0.18622099, 0.05257965) * go_3(0.0, 1.0); + result += mat4(0.042839274, 0.12597966, 0.08979042, -0.0647561, -0.050434645, 0.049438696, -0.20008127, -0.05572608, 0.046238814, 0.12622325, -0.019017145, -0.13960391, -0.040050175, 0.14298008, -0.20270552, 0.13391526) * go_3(1.0, -1.0); + result += mat4(-0.0073277587, 0.10606624, -0.08940439, -0.09656414, 0.12387374, -0.0013147948, 0.23607181, -0.00037969893, 0.050353236, -0.17266603, 0.27796733, -0.09877832, 0.02711225, 0.096394345, 0.07457944, 0.21541388) * go_3(1.0, 0.0); + result += mat4(-0.18612787, -0.00027517386, -0.17136407, -0.06413671, 0.025629476, -0.04570916, 0.0008431566, -0.03419168, 0.08123608, 0.09465922, 0.11975521, 0.1269741, 0.08413221, 0.12125001, 0.04727287, 0.072378494) * go_3(1.0, 1.0); + result += vec4(0.04244928, -0.014280219, 0.017129054, -0.08807801); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_3_tf +//!BIND conv2d_3_tf1 +//!SAVE conv2d_4_tf1 +//!WIDTH conv2d_3_tf.w +//!HEIGHT conv2d_3_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(0.01973856, -0.05053795, 0.015545361, 0.10867395, 0.33441806, 0.14731607, 0.6793983, -0.21394718, -0.00846322, 0.09146322, -0.07427475, -0.078477465, -0.090998545, 0.133366, 0.105515696, -0.13784988) * go_0(-1.0, -1.0); + result += mat4(-0.05404873, 0.09784018, -0.1337389, -0.18082313, 0.13461179, -0.3816801, 0.12209786, 0.08176651, 0.10461896, -0.43315184, 0.017470734, 0.20423968, -0.03941875, -0.101959296, -0.09440259, 0.09154717) * go_0(-1.0, 0.0); + result += mat4(0.17229515, -0.06907825, -0.008382803, -0.16671611, -0.01576541, 0.03985307, 0.08209482, -0.11707446, -0.11793074, 0.13702396, -0.02013158, 0.07302033, -0.022301994, -0.11464677, 0.036753565, -0.093276784) * go_0(-1.0, 1.0); + result += mat4(-0.017650167, 0.009475923, -0.17856382, 0.15925962, 0.06434641, -0.15568036, 0.038135886, 0.18855911, -0.04427734, 0.1878215, 0.10856261, 0.0041275816, -0.12046199, 0.13610138, 0.3741596, -0.12934728) * go_0(0.0, -1.0); + result += mat4(-0.24631616, 0.0169485, -0.035534818, 0.37795424, -0.08546174, 0.07817259, 0.42897213, -0.47965595, -0.0146556785, -0.20510523, -0.18889453, 0.06476019, 0.1021008, -0.35398817, -0.031071864, -0.21416448) * go_0(0.0, 0.0); + result += mat4(0.32810766, 0.050585747, -0.17658374, -0.13881154, 0.16417882, -0.21286008, -0.106835455, -0.1722344, -0.14151084, 0.08962986, 0.057395387, -0.01623662, 0.02570415, 0.15626897, -0.12687978, 0.080729105) * go_0(0.0, 1.0); + result += mat4(-0.050597478, -0.018753758, -0.036346875, -0.017908493, 0.058593344, 0.008303028, 0.05254987, -0.06635018, -0.022532012, 0.029511122, 0.026682215, -0.054647952, 0.069466785, -0.08892492, 0.025351115, -0.023130694) * go_0(1.0, -1.0); + result += mat4(0.2412473, -0.16138165, -0.15117447, 0.11851003, -0.096868426, 0.082690425, 0.27923304, 0.11590443, 0.19363573, -0.15770023, -0.066793665, 0.011681678, 0.14037277, -0.112065665, -0.048159517, 0.009453693) * go_0(1.0, 0.0); + result += mat4(0.1580054, -0.0060506654, 0.05267837, -0.09178131, -0.09107123, 0.23191126, 0.21108283, -0.070422985, 0.024321035, 0.06131459, 0.066626504, 0.032481454, 0.044402298, 0.1390604, -0.14432502, 0.040869843) * go_0(1.0, 1.0); + result += mat4(0.10264861, 0.013504324, 0.012482852, -0.1781206, -0.12799414, -0.27026084, -0.123830505, 0.098105, -0.039127555, 0.09367889, 0.122323096, 0.1416734, 0.044763107, -0.21801683, -0.14018978, 0.17646866) * go_1(-1.0, -1.0); + result += mat4(0.017453065, 0.11498537, -0.10998983, -0.3116098, -0.3099762, 0.5024706, 0.051817298, 0.03170681, -0.18937826, 0.07946567, -0.11978771, -0.09523745, -0.0033551592, -0.11768945, 0.08932359, -0.06689581) * go_1(-1.0, 0.0); + result += mat4(0.1507582, -0.013266159, -0.073085934, -0.07252967, -0.06301927, -0.13218755, 0.12984878, -0.13678701, 0.023422396, 0.082123175, 0.006906731, -0.004018426, -0.15813835, 0.13711788, 0.016018609, 0.13443229) * go_1(-1.0, 1.0); + result += mat4(-0.06960673, 0.16156524, -0.1374069, -0.05803206, -0.077960715, -0.10676749, 0.26282015, 0.03521529, 0.058099385, -0.014738148, 0.0011174522, 0.24279532, -0.023991548, -0.108812414, -0.08886019, 0.20584475) * go_1(0.0, -1.0); + result += mat4(-0.08043308, 0.063343, 0.055290066, -0.15991378, -0.08096304, -0.23888679, 0.019161629, 0.38381267, 0.3672934, -0.119608454, -0.43623593, -0.46014485, -0.5323366, 0.1318621, 0.087373205, -0.05535459) * go_1(0.0, 0.0); + result += mat4(0.20640239, -0.1369444, -0.21677823, 0.08202178, 0.10515278, 0.06810837, 0.073207974, 0.23623931, 0.102422275, -0.05016664, -0.0039228587, -0.1810343, -0.2235563, -0.1246854, 0.1428113, -0.10609135) * go_1(0.0, 1.0); + result += mat4(-0.031941894, -0.08905056, 0.21501167, 0.11244667, -0.011811734, 0.21630247, 0.07589472, -0.040489636, -0.11824066, -0.11520391, -0.10075633, -0.035642453, 0.062144946, 0.0073282206, 0.14119269, -0.060479023) * go_1(1.0, -1.0); + result += mat4(-0.29382935, -0.056808118, 0.051812876, -0.061358813, -0.08344258, 0.124203674, 0.037964176, -0.01961274, -0.000951725, 0.50005037, -0.24176972, 0.06487161, -0.15469861, 0.04336187, 0.17826353, 0.040010225) * go_1(1.0, 0.0); + result += mat4(0.02044482, -0.0879271, -0.01053958, -0.31148303, 0.07497373, -0.11548258, -0.1666126, 0.02369657, -0.058044076, 0.010801491, -0.005933901, -0.08910467, 0.007953008, 0.03761974, -0.029501524, 0.16816042) * go_1(1.0, 1.0); + result += mat4(0.1779597, -0.10213089, 0.29942423, -0.016642543, -0.015537001, -0.04676146, 0.09585872, -0.0055750017, -0.014361908, -0.20667697, -0.11348746, 0.13081487, -0.10437329, 0.14328459, 0.11648822, -0.09163837) * go_2(-1.0, -1.0); + result += mat4(0.019033967, -0.12420627, -0.07748253, 0.43203858, -0.109799065, 0.07605535, 0.060791396, -0.24517195, -0.15674245, 0.21267459, 0.10665515, -0.073150024, -0.1358355, 0.0054066703, -0.16434059, -0.06031853) * go_2(-1.0, 0.0); + result += mat4(-0.18834068, 0.26840356, -0.12937617, 0.16103932, -0.0062331813, -0.13630053, -0.013911821, 0.022389365, -0.044232946, -0.056454606, 0.022426741, 0.18010215, 0.041900013, 0.03375041, -0.11376866, -0.010313381) * go_2(-1.0, 1.0); + result += mat4(0.12497669, -0.31161824, 0.097568035, 0.19443443, -0.05056519, -0.0031457904, 0.1055554, -0.083650924, 0.07630523, -0.34177595, -0.093093194, 0.20701368, -0.030962149, -0.054470222, -0.23853977, 0.004326528) * go_2(0.0, -1.0); + result += mat4(0.34370202, 0.085750066, -0.16071722, -0.54335934, -0.35595295, -0.050744478, -0.17405547, 0.008628697, -0.007086256, 0.23164117, 0.340156, 0.5475976, -0.15292351, 0.28019544, 0.038059216, 0.0044727) * go_2(0.0, 0.0); + result += mat4(-0.08231968, -0.0052294536, 0.07451547, 0.22278999, -0.3305531, 0.0017458396, 0.10818422, -0.21325395, -0.08807993, -0.110342845, 0.10082142, -0.051594347, 0.24192205, -0.18042035, -0.0095462985, -0.08757798) * go_2(0.0, 1.0); + result += mat4(0.096379586, 0.021887815, -0.05097233, -0.06797989, -0.026171045, 0.022944937, -0.015915364, 0.037667938, 0.17216732, -0.014889412, 0.07343887, 0.028236505, 0.0015047621, 0.1355103, -0.09918284, -0.07673695) * go_2(1.0, -1.0); + result += mat4(-0.25385055, 0.15163356, 0.0030003798, 0.18464413, 0.05611221, 0.099498056, -0.07128191, 0.042955168, 0.027493173, 0.07440157, 0.07814497, 0.096160784, 0.13571084, 0.056412842, -0.031997006, -0.16073681) * go_2(1.0, 0.0); + result += mat4(-0.21634746, 0.025153082, -0.064477116, 0.0005679147, -0.0029436245, 0.12794618, 0.024849026, 0.03018052, 0.11723976, 0.059955597, -0.013594654, 0.09091745, 0.04775348, 0.21260159, -0.07463213, -0.06727042) * go_2(1.0, 1.0); + result += mat4(-0.12166018, 0.024545137, 0.08611618, -0.17627168, 0.09042604, -0.14157623, -0.22147785, 0.09100581, 0.11078359, 0.031410985, -0.17170976, 0.09532806, -0.059569277, 0.09392676, 0.11784347, -0.21471368) * go_3(-1.0, -1.0); + result += mat4(0.1483187, -0.2217563, 0.12032977, 0.14932398, 0.27428308, -0.04568031, 0.12670338, 0.09586169, 0.06700745, 0.005126449, 0.0027694793, -0.033667028, 0.06447861, -0.08585174, -0.05509812, -0.11358761) * go_3(-1.0, 0.0); + result += mat4(-0.22750492, 0.032906335, -0.029479047, 0.11580199, -0.05812372, -0.032269973, 0.05219915, 0.041658226, 0.010897959, 0.065550454, 0.0076911976, -0.045743827, 0.11614996, -0.10393113, -0.0012606392, -0.034367524) * go_3(-1.0, 1.0); + result += mat4(0.09350742, 0.09561609, 0.3735968, 0.031685118, -0.042026598, 0.17006761, -0.3910107, 0.16984761, 0.25679177, 0.036610503, -0.13772772, 0.11101589, -0.1137049, 0.07211461, 0.18065079, -0.12324793) * go_3(0.0, -1.0); + result += mat4(-0.020749722, 0.14413361, -0.061903823, -0.21550268, 0.31306142, -0.11532895, 0.029482557, 0.03282164, -0.09800627, -0.20765196, 0.33030233, 0.075725295, 0.49252015, 0.042455837, -0.07264194, -0.10401895) * go_3(0.0, 0.0); + result += mat4(-0.22697076, -0.15738785, 0.09740376, -0.072098814, -0.06638972, 0.12336611, 0.0073687397, 0.048267826, 0.06717852, -0.027047804, -0.123397194, 0.17829034, 0.04215185, 0.066311836, -0.061742183, -0.046373066) * go_3(0.0, 1.0); + result += mat4(0.041311592, 0.2813485, 0.055084586, -0.01823069, 0.08105147, -0.087944716, -0.10135052, -0.02653456, 0.063169874, -0.1351186, 0.06722432, -0.016406318, 0.08666922, 0.0555909, 0.12086502, -0.17224412) * go_3(1.0, -1.0); + result += mat4(0.26026788, -0.18303715, 0.029279215, -0.12858874, 0.027197823, 0.0919464, 0.00849638, 0.10547888, -0.12952055, -0.14414985, 0.1903315, 0.05004528, -0.12657289, 0.038008716, -0.036606666, -0.054025438) * go_3(1.0, 0.0); + result += mat4(0.069167465, 0.2699947, -0.11137602, -0.05888806, -0.107324794, -0.07598601, 0.06042177, 0.0064530694, -0.039780665, -0.076666445, -0.00846108, -0.06165907, -0.06978219, -0.19108103, -0.040026028, -0.120319635) * go_3(1.0, 1.0); + result += vec4(-0.14375664, -0.0056876075, 0.052177623, 0.07152566); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_4_tf +//!BIND conv2d_4_tf1 +//!SAVE conv2d_5_tf +//!WIDTH conv2d_4_tf.w +//!HEIGHT conv2d_4_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(-0.15667982, -0.31441393, 0.29112124, -0.15737213, 0.022372838, 0.10690639, -0.12019085, -0.051941186, -0.30367845, 0.02612279, 0.2372532, 0.2021648, -0.20481086, -0.003770439, 0.14981231, 0.066780254) * go_0(-1.0, -1.0); + result += mat4(0.03270688, -0.42270073, 0.044317324, 0.15907793, 0.14681059, -0.2934784, 0.24933252, -0.067273855, 0.07752533, -0.23194817, 0.0686707, 0.08999225, 0.121678345, -0.12916678, 0.012397381, 0.012315053) * go_0(-1.0, 0.0); + result += mat4(-0.10090412, -0.20792678, 0.11076032, -0.02938975, -0.1944187, -0.2003259, 0.04438032, 0.36946484, -0.019868722, -0.15830222, 0.042811528, 0.015641417, 0.113098525, 0.080257006, 0.011135628, -0.2877629) * go_0(-1.0, 1.0); + result += mat4(0.15482685, 0.06579119, 0.28301102, 0.23729764, 0.15990537, 0.4529694, 0.107880585, 0.10668121, -0.42430598, -0.2631025, 0.10513542, -0.036242936, -0.09827965, -0.0069260495, -0.11689201, -0.041436482) * go_0(0.0, -1.0); + result += mat4(0.08472191, -0.13051608, 0.047930017, 0.36831668, 0.1164478, 0.21384816, 0.22062506, 0.2094167, 0.48668453, 0.32302913, 0.36268055, -0.091801375, -0.079141125, -0.26613805, -0.16608004, 0.03810683) * go_0(0.0, 0.0); + result += mat4(-0.13474251, -0.04824603, 0.23303726, -0.116136365, 0.0056330245, 0.15829784, 0.0012259148, 0.12648389, 0.038680512, 0.05131116, 0.024099711, 0.4555406, 0.0035716395, 0.11633299, 0.094744846, -0.2457627) * go_0(0.0, 1.0); + result += mat4(-0.0576871, -0.04037522, 0.16857862, 0.0031084458, -0.027274646, -0.18154246, 0.13337846, 0.035422433, -0.0030749738, -0.17288287, 0.019983152, -0.31871706, -0.03280405, 0.06825421, -0.1563798, 0.05031885) * go_0(1.0, -1.0); + result += mat4(-0.066631876, 0.012560506, 0.1690693, -0.018248236, 0.0450104, 0.016296914, -0.14910112, -0.16191053, 0.5078224, -0.017615631, 0.15226597, -0.13373777, 0.20148668, 0.060258996, 0.13215344, 0.18430072) * go_0(1.0, 0.0); + result += mat4(0.12976126, -0.072738245, 0.053067926, 0.09752956, -0.04716214, 0.04136464, 0.014162617, -0.06621296, -0.09617736, 0.057469178, 0.01280261, -0.042976785, -0.12570308, 0.006027807, 0.031038594, 0.06569918) * go_0(1.0, 1.0); + result += mat4(-0.12655424, -0.41563693, -0.030971345, -0.06357555, -0.14121394, -0.15667427, 0.14398985, 0.05995984, 0.0821605, 0.12462943, 0.007492498, -0.0030187522, -0.22804567, -0.10487421, 0.13180672, -0.13978589) * go_1(-1.0, -1.0); + result += mat4(-0.075991526, 0.12352044, -0.17844258, 0.010614991, -0.18293494, 0.25009897, -0.080779895, 0.21548378, 0.22215544, 0.048670914, -0.057372037, 0.078176, 0.17490411, 0.004919551, 0.059619516, 0.12660357) * go_1(-1.0, 0.0); + result += mat4(-0.06282951, 0.10929357, 0.026720649, -0.15939257, 0.17107709, -0.04334904, -0.03047162, -0.101681694, 0.03118431, 0.19994627, 0.025729552, 0.035035726, -0.0012207883, -0.08618888, 0.061205562, 0.009940555) * go_1(-1.0, 1.0); + result += mat4(-0.23581573, 0.08002133, -0.15170844, 0.08872338, -0.25767094, -0.09273545, 0.18153891, 0.2544269, -0.084598936, -0.089766875, -0.14610913, 0.002247754, 0.1802837, -0.019625561, 0.30239686, -0.032793984) * go_1(0.0, -1.0); + result += mat4(0.5223286, 0.10347663, 0.4000593, 0.25440502, -0.07646958, -0.31940606, 0.053407036, -0.09356492, 0.2738851, 0.23945184, -0.2907089, -0.45822915, 0.13415676, 0.17187089, 0.08731114, -0.27670014) * go_1(0.0, 0.0); + result += mat4(0.059273496, -0.107137166, 0.12087539, 0.179237, -0.021209063, -0.02548005, 0.061256204, 0.033822674, 0.54491127, -0.2475085, 0.08055858, -0.4071213, -0.045093834, 0.07161349, 0.08219979, -0.31735933) * go_1(0.0, 1.0); + result += mat4(-0.29527053, 0.021469543, 0.07202354, -0.07103959, 0.03990857, 0.2490762, -0.19419849, -0.13916986, -0.05325315, 0.12922864, -0.041463424, -0.031249814, 0.073991664, -0.09723187, 0.35132217, 0.024760868) * go_1(1.0, -1.0); + result += mat4(0.09606787, -0.0951808, -0.0059865676, -0.052033573, -0.3118038, 0.4432636, -0.12943317, 0.09484738, 0.10621756, -0.10550469, 0.11264014, 0.1402276, -0.012679125, -0.08809835, 0.029994955, -0.15121669) * go_1(1.0, 0.0); + result += mat4(0.123397775, 0.048338536, -0.00975707, -0.103767075, -0.041053303, -0.07228534, 0.046792876, 0.0668788, 0.29554394, 0.012451002, 0.19568972, 0.112091154, 0.10882395, -0.0995439, 0.051324263, 0.24967718) * go_1(1.0, 1.0); + result += mat4(0.2699648, 0.17300771, -0.16056584, 0.1099392, 0.11674778, -0.19811755, 0.111880325, -0.06075038, -0.095849104, -0.04510651, -0.04180761, -0.0052786698, 0.11037549, -0.24115366, 0.018509468, -0.07819484) * go_2(-1.0, -1.0); + result += mat4(0.10981622, 0.044488225, 0.050722387, -0.3146652, -0.0013019707, -0.24084032, -0.10475088, 0.026944289, 0.1592903, 0.33087498, 0.061839584, -0.043863457, -0.06904603, -0.08635262, 0.088630445, -0.15485142) * go_2(-1.0, 0.0); + result += mat4(-0.06810522, 0.19927117, -0.08130387, 0.11612667, -0.015104349, -7.738651e-05, -0.06419643, -0.14813533, 0.026650215, 0.015038833, 0.08161237, 0.058321163, 0.015005185, -0.16189656, 0.024501886, 0.1927279) * go_2(-1.0, 1.0); + result += mat4(0.31858218, 0.11962043, -0.20560326, -0.13190113, 0.02138715, -0.057066392, -0.085771754, -0.124566585, 0.044749223, 0.13687828, 0.1195792, 0.14021616, 0.26204133, 0.05119197, -0.13980037, 0.050747477) * go_2(0.0, -1.0); + result += mat4(-0.21238558, -0.0734057, -0.2036023, -0.34308743, -0.29370925, 0.2393742, -0.37877437, 0.036869828, -0.17053255, -0.26900926, -0.23330869, 0.32902205, -0.4882585, 0.27430108, -0.033711653, 0.15501487) * go_2(0.0, 0.0); + result += mat4(0.23487025, 0.085289046, -0.14281847, 0.12543266, 0.15871634, -0.13858907, 0.14810285, -0.0239261, 0.1286852, 0.07754033, 0.01072327, -0.14313328, 0.05480442, -0.12195059, 0.11341822, 0.08224607) * go_2(0.0, 1.0); + result += mat4(0.19490337, 0.023521842, -0.24548791, 0.0035114093, -0.07937166, -0.07674376, 0.08365873, -0.003286068, 0.023862893, 0.009626835, 0.032829892, 0.0078141205, 0.053484406, -0.08297165, 0.09303188, 0.004273738) * go_2(1.0, -1.0); + result += mat4(-0.0032906602, 0.13636959, 0.027821168, 0.06270053, 0.024775786, -0.077529594, 0.03799126, 0.030000908, 0.031749167, 0.04360487, 0.004448846, -0.17835903, -0.30834544, 0.013150946, -0.13758293, -0.03296242) * go_2(1.0, 0.0); + result += mat4(-0.14166978, 0.034131095, 0.049779188, 0.09453289, -0.011406557, -0.07020709, -0.0031981543, -0.03443845, -0.00010218944, 0.0855161, -0.10951453, 0.042758763, 0.1718446, -0.1577923, 0.0410027, -0.04992991) * go_2(1.0, 1.0); + result += mat4(0.1219178, 0.105126485, -0.041097324, -0.08110963, -0.04857337, -0.11544925, -0.14572923, 0.092435546, 0.091857366, 0.15425235, -0.020324683, -0.05764375, -0.020458939, -0.10527823, -0.085554086, 0.16358297) * go_3(-1.0, -1.0); + result += mat4(-0.12372687, -0.009976829, 0.14252265, -0.1321053, -0.05965866, -0.1393898, -0.017603246, -0.02714342, -0.16824952, -0.23083204, -0.012299022, -0.06689838, -0.015830487, 0.21299921, -0.11637202, 0.0074968333) * go_3(-1.0, 0.0); + result += mat4(-0.01979935, -0.182785, -0.015397454, 0.14175794, -0.011465284, 0.11285164, -0.036115747, 0.07150463, -0.083641894, -0.10221778, -0.13871445, 0.099696055, 0.04603662, -0.06463785, -0.007984529, -0.0032940735) * go_3(-1.0, 1.0); + result += mat4(0.072830334, -0.057334073, 0.09086239, 0.13039105, 0.06350303, 0.17130788, -0.2181585, -0.09137403, -0.31397742, -0.019071499, -0.017274613, 0.13762084, 0.10195637, -0.021455176, 0.04011394, -0.08029658) * go_3(0.0, -1.0); + result += mat4(-0.26982597, -0.40265098, -0.4151411, 0.038557775, -0.095602125, 0.3503172, -0.029988842, -0.03484708, 0.095536314, -0.0030311556, 0.31589827, 0.52763534, -0.12629713, -0.24356791, 0.0059487303, 0.42298427) * go_3(0.0, 0.0); + result += mat4(0.054166105, 0.18827972, -0.081673265, -0.06720384, 0.09375001, 0.22173035, -0.14050071, 0.108400136, -0.15553835, -0.08716729, -0.037366748, 0.10971073, -0.02560103, -0.26702073, -0.05201882, 0.2432563) * go_3(0.0, 1.0); + result += mat4(0.16196893, 0.0889265, -0.09887943, -0.042956755, -0.054403376, -0.123823255, 0.045847844, 0.017027669, 0.00539936, -0.112265736, 0.050549984, -0.104931094, -0.06883012, -0.25745714, 0.11155538, -0.15363649) * go_3(1.0, -1.0); + result += mat4(-0.22157209, 0.18200903, -0.13290548, 0.026721261, -0.06066069, -0.18150693, 0.08768983, 0.037362453, -0.1073367, -0.070236765, -0.41223463, -0.168915, -0.15517351, -0.13949952, -0.13307643, -0.15935421) * go_3(1.0, 0.0); + result += mat4(-0.026589906, 0.0930502, 0.05195435, 0.06301585, -0.01107014, -0.019382332, 0.027223695, -0.004045145, -0.15238355, -0.0345132, 0.06355168, 0.0011230056, 0.16690113, 0.0017829507, -0.0023939044, -0.09471834) * go_3(1.0, 1.0); + result += vec4(0.024455175, 0.01669877, -0.066231176, 0.036848705); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_4_tf +//!BIND conv2d_4_tf1 +//!SAVE conv2d_5_tf1 +//!WIDTH conv2d_4_tf.w +//!HEIGHT conv2d_4_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(0.01763509, -0.17156707, -0.06841296, -0.026132878, -0.10600523, 0.11245994, 0.121395074, -0.09331501, 0.12764473, 0.0428028, -0.11837395, 0.2092563, -0.04357652, -0.0490096, 0.024701532, 0.10518723) * go_0(-1.0, -1.0); + result += mat4(-0.17130826, -0.31987694, -0.07639005, 0.21362033, 0.058639023, 0.066175915, -0.25344703, -0.07923442, -0.14766373, 0.040518284, -0.031103026, -0.040075514, -0.051108997, -0.28214613, -0.18504949, 0.27544948) * go_0(-1.0, 0.0); + result += mat4(0.030991005, -0.011353306, 0.15237464, 0.15458584, 0.1250524, 0.19959912, 0.14049476, 0.38410887, 0.07378578, -0.017728366, 0.0963528, -0.043756213, -0.039577194, -0.11800575, -0.08392266, -0.07599512) * go_0(-1.0, 1.0); + result += mat4(0.022089608, -0.027317125, 0.051330008, -0.0075439885, 0.021650828, -0.0009390209, -0.12043464, 0.049332134, -0.055557396, -0.053297505, -0.0918705, -0.13089466, -0.10994107, 0.072746456, 0.11496739, -0.05225977) * go_0(0.0, -1.0); + result += mat4(0.29730305, 0.26317745, 0.052159555, -0.32006654, 0.48288685, -0.049926184, -0.08091092, -0.13825637, -0.1485706, -0.288657, -0.41443697, 0.06856032, -0.23809211, -0.12953928, 0.4783034, -0.47557938) * go_0(0.0, 0.0); + result += mat4(0.026139118, -0.23031352, 0.04861487, 0.033556074, 0.2702056, 0.22802536, -0.15385233, 0.1664119, 0.18749923, 0.36927548, -0.011473684, -0.11771165, -0.16859052, -0.4513202, 0.12863952, 0.02482837) * go_0(0.0, 1.0); + result += mat4(0.0073229345, -0.061915245, 0.06710329, 0.0062416573, -0.00555983, 0.14592186, 0.11201052, -0.123630054, 0.32611257, -0.11279885, -0.059449438, 0.2891043, -0.10519016, 0.040108994, -0.012468261, 0.02083298) * go_0(1.0, -1.0); + result += mat4(-0.057483062, 0.08454755, -0.15529329, -0.12572923, 0.2600099, -0.02319978, -0.04037675, 0.11496361, 0.07728194, -0.12908956, -0.025529336, 0.112581626, 0.02971823, 0.11659056, -0.01298622, 0.017061908) * go_0(1.0, 0.0); + result += mat4(0.22417091, -0.00222947, 0.04980858, 0.12260437, -0.025507605, 0.042577885, 0.120813504, -0.048522256, -0.038494784, -0.0072195013, -0.23012944, -0.020850847, -0.078296244, -0.014830018, 0.19759563, -0.10000253) * go_0(1.0, 1.0); + result += mat4(-0.032090195, 0.023757193, -0.08989734, 0.14419042, 0.0112194475, -0.093776144, -0.020197887, 0.29295877, 0.06872183, 0.09511462, -0.03245769, -0.06504889, 0.05132126, 0.00399527, 0.075911656, 0.250893) * go_1(-1.0, -1.0); + result += mat4(-0.3418496, 0.25525784, 0.0018161442, 0.028484365, -0.17573346, -0.12457501, 0.18466166, 0.20209278, 0.10282706, 0.16353399, 0.025052028, -0.059714165, -0.055806916, -0.28651386, 0.112798095, 0.11624314) * go_1(-1.0, 0.0); + result += mat4(-0.018793896, 0.07500149, -0.01728254, -0.1726998, -0.13333, 0.09590344, -0.036537904, -0.11522523, 0.19445558, 0.22680458, 0.12061006, -0.06225618, 0.1127748, 0.28380096, -0.07099846, -0.007440302) * go_1(-1.0, 1.0); + result += mat4(-0.43887648, -0.10018577, -0.29267642, 0.12149727, -0.14333835, 0.04161915, 0.19442867, 0.16506511, 0.09655387, -0.0014398015, 0.13189743, -0.14068556, 0.049408, 0.0829072, 0.2950336, 0.36965907) * go_1(0.0, -1.0); + result += mat4(0.41486958, -0.023498302, -0.37900022, -0.31752598, 0.13758768, -0.18782206, -0.31358528, 0.3330786, -0.4039293, -0.06539036, 0.032599606, 0.10663507, -0.26369813, -0.17365438, 0.20723309, 0.1801556) * go_1(0.0, 0.0); + result += mat4(0.004117444, -0.14894462, 0.14915143, -0.047375835, -0.2609916, -0.10172324, -0.14925237, -0.33830285, 0.12131607, -0.18156646, -0.42382464, -0.052582145, 0.2329045, -0.4576963, 0.13756892, 0.055571318) * go_1(0.0, 1.0); + result += mat4(-0.31689477, 0.017058033, -0.01904924, -0.016893756, -0.011479519, 0.07316262, -0.07086077, 0.08923511, -0.08190091, -0.025866933, -0.06909204, -0.028601022, 0.023224542, 0.03082087, 0.2230426, -0.16713654) * go_1(1.0, -1.0); + result += mat4(0.13457374, 0.110913865, -0.1130815, -0.031438913, -0.55201167, 0.04831016, 0.25107765, -0.014003224, 0.19532952, 0.02062346, 0.04839241, 0.088673405, 0.30325848, -0.20222804, -0.085780576, 0.22512968) * go_1(1.0, 0.0); + result += mat4(0.076354, 0.021940092, -0.16170324, 0.0025543426, -0.0032400405, -0.0046705627, 0.06241069, -0.031247333, 0.098353796, 0.03723474, 0.22971998, -0.017877292, 0.119858086, 0.008041448, 0.2140585, 0.10343376) * go_1(1.0, 1.0); + result += mat4(0.08627595, 0.04532834, 0.027579082, -0.16222088, 0.15583228, -0.14371829, -0.07243855, -0.111895435, -0.14438897, -0.10250594, 0.0034202964, -0.066547595, -0.034390844, -0.021545287, 0.014540157, -0.10215731) * go_2(-1.0, -1.0); + result += mat4(0.19720152, 0.21534947, 0.1130938, -0.011730973, 0.013247983, -0.10344174, -0.1906514, -0.015767017, -0.020093633, -0.26487067, -0.005960781, -0.057149183, 0.030110173, 0.047692046, -0.19308545, -0.25292158) * go_2(-1.0, 0.0); + result += mat4(0.039498243, 0.053682897, -0.01844695, -0.017540915, 0.039454967, -0.27696076, 0.09503274, -0.038958035, 0.17321438, -0.036311295, 0.03123055, 0.02310311, 0.040591653, 0.0054627894, -0.03520426, -0.026101988) * go_2(-1.0, 1.0); + result += mat4(0.055991564, 0.06512919, -0.12532505, 0.024075158, -0.04926237, -0.11701171, 0.026792146, 0.013033238, -0.052847516, -0.01550091, -0.008442071, -0.077945165, -0.033220004, -0.13678443, -0.07040586, 0.121846326) * go_2(0.0, -1.0); + result += mat4(-0.19537796, -0.016634773, 0.10707109, -0.024361614, -0.16002733, -0.44066608, 0.16488662, 0.013152995, 0.22407806, 0.12854017, 0.19028598, -0.08379244, -0.05594235, -0.15909895, 0.511962, 0.39027596) * go_2(0.0, 0.0); + result += mat4(-0.032652248, 0.06004893, 0.011166194, 0.102761306, -0.035113614, -0.29961765, -0.013817978, 0.20938557, 0.08488225, -0.1118558, -0.0375328, -0.035511103, 0.0046933405, 0.20203683, -0.13552529, -0.12685429) * go_2(0.0, 1.0); + result += mat4(0.03054923, 0.08224908, -0.059128158, -0.02583655, -0.02133876, 0.0048713544, 0.10848829, 0.06324404, 0.028332822, -0.011002306, -0.027557913, -0.06072362, 0.1019048, -0.02587316, 0.08563405, -0.08119947) * go_2(1.0, -1.0); + result += mat4(-0.10568117, 0.1075248, 0.19379964, -0.14337265, 0.019374132, -0.0907804, -0.13827625, -0.03628561, 0.014735499, -0.026882607, -0.25948793, 0.034926686, -0.05988073, -0.22735636, 0.053511668, 0.04765336) * go_2(1.0, 0.0); + result += mat4(-0.029848114, 0.09183966, 0.084713496, 0.09422864, 0.069713995, -0.10584984, -0.020899031, 0.059645247, -0.075805016, -0.01828552, 0.06689195, -0.13804196, -0.023465823, -0.034038994, -0.12946706, 0.058709413) * go_2(1.0, 1.0); + result += mat4(0.061918218, 0.038984764, 0.013660938, -0.19340219, -0.014949839, 0.12946278, 0.12725051, 0.13429146, 0.05993008, -0.015394284, 0.011232483, 0.0344157, 0.022161875, -0.023923954, 0.061736204, 0.025963215) * go_3(-1.0, -1.0); + result += mat4(0.048136763, 0.03162042, -0.01967249, 0.06374493, 0.034645267, 0.22403605, 0.036197048, -0.06903216, -0.1024706, -0.0005459356, 0.049185563, 0.16309108, 0.07394778, 0.10351343, 0.28430694, -0.13531347) * go_3(-1.0, 0.0); + result += mat4(-0.14705071, -0.09458433, 0.03063114, 0.07901115, -0.11911086, -0.06428132, -0.013549552, -0.041342866, -0.20770676, -0.15104479, 0.054365363, -0.11652907, 0.05639815, 0.070518605, 0.0017846811, -0.00056205114) * go_3(-1.0, 1.0); + result += mat4(0.27148908, 0.07358356, 0.13644488, -0.13824654, 0.0112991175, -0.021521023, -0.10197379, 0.007816017, -0.13314332, 0.12318473, -0.043214846, -0.15759036, -0.19744353, -0.10267182, -0.28249928, 0.11233295) * go_3(0.0, -1.0); + result += mat4(-0.096474804, 0.17893109, 0.014679829, -0.21218887, -0.24170275, 0.10603527, 0.05375366, -0.059315052, 0.17087384, 0.13633691, -0.37958893, 0.43264794, 0.17829923, 0.06485103, -0.37551817, -0.22082718) * go_3(0.0, 0.0); + result += mat4(-0.30536333, -0.033212308, -0.25232, 0.11730442, -0.11176368, 0.26223183, -0.049025323, -0.01375941, -0.29028055, 0.16842811, -0.035684332, -0.4180911, -0.1611732, 0.07683385, -0.14263596, 0.17508087) * go_3(0.0, 1.0); + result += mat4(0.23580009, 0.025621435, -0.15757325, 0.008123166, -0.021905439, -0.02162503, -0.059497356, -0.01636353, 0.047654126, -0.084423855, -0.033733923, 0.0127116265, -0.059593942, -0.053935718, -0.050729543, 0.013887048) * go_3(1.0, -1.0); + result += mat4(-0.19232626, 0.07915767, -0.05909752, 0.007695347, 0.058876406, 0.057521783, -0.080253534, 0.2011056, -0.27965516, -0.08033169, -0.13025513, 0.12854645, 0.053400308, -0.18445957, -0.18463044, 0.27920377) * go_3(1.0, 0.0); + result += mat4(-0.061806213, -0.020037206, 0.003183183, -0.029844081, -0.039553937, 0.028905323, -0.11367984, -0.097321615, -0.10112643, 0.0039709485, -0.06020118, -0.23871279, -0.077974856, 0.05806996, -0.21440302, 0.11898043) * go_3(1.0, 1.0); + result += vec4(-0.023832673, 0.03702965, -0.04749135, -0.10982549); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_5_tf +//!BIND conv2d_5_tf1 +//!SAVE conv2d_6_tf +//!WIDTH conv2d_5_tf.w +//!HEIGHT conv2d_5_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(0.030931145, 0.013683292, -0.0650242, -0.028732346, 0.120067924, -0.029404473, 0.0038229884, -0.14631765, 0.041900825, -0.076596744, -0.11096378, -0.27100095, 0.0052598766, -0.05929686, -0.06816563, -0.086864315) * go_0(-1.0, -1.0); + result += mat4(-0.043620087, -0.16360405, 0.006527374, 0.15706524, 0.08338088, -0.19027525, 0.22595987, -0.054963548, 0.01825031, -0.03149212, 0.025471251, 0.06429379, -0.011633275, -0.079389006, -0.0030728737, 0.17345747) * go_0(-1.0, 0.0); + result += mat4(-0.011275288, -0.10668036, 0.05718997, 0.010336089, 0.33393976, -0.2029354, 0.075444475, -0.092244044, 0.07605498, 0.20125951, 0.10493973, -0.12306946, 0.03658231, 0.08233366, -0.12205888, -0.116969004) * go_0(-1.0, 1.0); + result += mat4(-0.0070305974, 0.105127215, 0.006041873, 0.26743913, 0.028119443, 0.14823505, -0.28344348, 0.12362866, -0.1215781, 0.08104382, 0.102011785, 0.085380934, 0.061244503, -0.06230063, -0.05353345, 0.1166729) * go_0(0.0, -1.0); + result += mat4(0.08945733, 0.4101902, -0.06404005, 0.040728435, 0.13076581, -0.20805469, -0.10897316, -0.14924604, 0.10090762, 0.015475414, 0.26346552, 0.12096677, -0.20199244, 0.2780031, 0.18515368, 0.35105625) * go_0(0.0, 0.0); + result += mat4(0.07463155, 0.26932517, -0.06768551, 0.10470878, -0.1423996, 0.013550665, -0.06167201, -0.1022994, -0.3107166, -0.15609552, 0.1695213, -0.1277181, 0.12582655, -0.1596128, 0.015612055, -0.19826376) * go_0(0.0, 1.0); + result += mat4(0.011745468, 0.006471601, 0.008110513, 0.025831396, 0.1272883, -0.221959, 0.11993834, -0.007903633, 0.009993582, -0.10170755, 0.026594637, -0.027883623, 0.030666083, -0.036415886, 0.007469573, 0.0674783) * go_0(1.0, -1.0); + result += mat4(-0.022760388, -0.10911659, -0.012589904, -0.046462692, 0.36987287, 0.71668935, -0.04466556, 0.12082762, 0.0026539841, 0.07070946, -0.00020439121, -0.13925348, 0.08672072, 0.20075354, -0.066352285, 0.14655356) * go_0(1.0, 0.0); + result += mat4(-0.081081845, -0.21956222, 0.06781787, -0.106362104, -0.03016425, -0.010460211, -0.009725996, -0.009805538, 0.07037355, 0.19254607, 0.038890257, 0.29580075, -0.10355764, 0.12613009, 0.02485986, -0.031927988) * go_0(1.0, 1.0); + result += mat4(-0.13882205, 0.21770848, 0.015392157, 0.010310204, 0.008225721, 0.07457836, 0.09984027, -0.25452816, 0.2193511, -0.22262146, -0.12950355, 0.026151875, 0.022114651, -0.030566849, 0.034688126, 0.03047327) * go_1(-1.0, -1.0); + result += mat4(0.0363441, 0.19290726, -0.1143055, 0.30871987, -0.05780708, 0.082128406, -0.115280904, 0.07636388, 0.48947453, -0.29715258, 0.146737, -0.3275992, -0.055972476, -0.09991753, 0.17435446, 0.10917291) * go_1(-1.0, 0.0); + result += mat4(0.026389305, 0.054523308, -0.028950177, 0.06913328, -0.18626037, 0.08829993, 0.10407121, 0.001246911, 0.103938825, -0.3117343, -0.045564886, 0.07316613, 0.0027089121, 0.099437356, -0.046500806, -0.0927284) * go_1(-1.0, 1.0); + result += mat4(0.051037624, -0.2068234, 0.061572235, -0.3345198, 0.16960172, -0.30289862, -0.002583443, 0.39312238, 0.08246557, 0.16374862, -0.31902805, -0.13205275, -0.032050006, 0.01670186, 0.13852347, 0.120012194) * go_1(0.0, -1.0); + result += mat4(-0.67096996, -0.06274476, 0.18575665, 0.80282855, 0.23201196, -0.0054729837, 0.050396994, -0.42014772, 0.34904522, 0.26281372, 0.24697208, 0.55475426, 0.49850988, -0.06581312, -0.0068906257, -0.15741143) * go_1(0.0, 0.0); + result += mat4(-0.04252036, -0.28224963, 0.009723064, 0.116357096, 0.2992567, -0.26702902, -0.05648925, 0.12729199, -0.37574205, 0.54211813, -0.25248805, -0.13023548, 0.18903324, -0.5182459, 0.0141203115, -0.19444294) * go_1(0.0, 1.0); + result += mat4(-0.0017735233, -0.010132458, -0.040924776, -0.13767008, 0.20757031, -0.06509882, -0.09756446, 0.018974079, 0.090851985, -0.010158765, -0.03999607, -0.12055641, 0.03629025, -0.018645551, -0.05506811, -0.014202848) * go_1(1.0, -1.0); + result += mat4(0.16203491, 0.011118734, -0.18486023, -0.024290733, -0.3673846, -0.20295864, 0.23055002, -0.1555852, -0.02706522, 0.03262891, 0.008724611, -0.03760652, -0.20946771, -0.01951837, 0.16955496, 0.11690098) * go_1(1.0, 0.0); + result += mat4(0.0783421, 0.22656651, -0.15715368, -0.024174158, 0.020260733, 0.032390315, -0.029133298, 0.086601086, 0.13871798, -0.12525433, 0.16097449, 0.058946393, 0.029865682, 0.08508385, 0.040569812, -0.09402932) * go_1(1.0, 1.0); + result += mat4(-0.05063873, 0.11269313, -0.057484943, -0.13579641, 0.047973365, -0.07103839, -0.07838756, -0.0028928046, -0.019466015, 0.018428024, 0.010016324, -0.057396665, -0.19495595, 0.034307264, -0.022888038, 0.08112259) * go_2(-1.0, -1.0); + result += mat4(-0.09790086, 0.10613111, 0.06611674, 0.19356097, -0.00073371036, -0.019078335, 0.076719105, -0.016212497, -0.3283475, -0.07547389, -0.08140701, 0.3185625, -0.25060275, 0.16820994, -0.123497784, 0.43272668) * go_2(-1.0, 0.0); + result += mat4(-0.06365342, 0.11186735, -0.17493224, -0.04207358, 0.0003117533, 0.034089327, -3.067692e-05, -0.03422754, 0.16267666, 0.054771993, 0.048384454, -0.041866794, 0.0036008756, 0.0021496525, 0.20258942, -0.06297619) * go_2(-1.0, 1.0); + result += mat4(0.03578836, 0.08763908, -0.22370125, -0.32465744, 0.019142643, 0.011316954, 0.17920344, 0.031633645, 0.03766343, -0.116487674, -0.05281752, -0.018965483, 0.049297336, -0.34511214, 0.42598158, 0.051361635) * go_2(0.0, -1.0); + result += mat4(0.26638633, -0.33628765, 0.04437907, 0.09616201, -0.020049393, 0.2560829, -0.027108455, 0.255752, 0.3666511, 0.052277412, -0.46667686, 0.48482272, 0.51302284, -0.06941614, -0.17967525, -0.07889891) * go_2(0.0, 0.0); + result += mat4(0.18503937, 0.088710256, 0.2083147, -0.20758459, -0.036416974, 0.018303726, 0.03729963, -0.035969947, -0.2685231, -0.42169708, -0.039593916, -0.02642618, 0.29050872, -0.25723743, -0.111259766, 0.15001127) * go_2(0.0, 1.0); + result += mat4(-0.026473878, -0.07241443, 0.022400148, -0.03214132, 0.0859297, -0.0036677981, -0.07039137, 0.03703108, 0.042322673, -0.01222808, -0.08151938, 0.033109214, -0.048737407, 0.25929528, -0.40535828, -0.123594694) * go_2(1.0, -1.0); + result += mat4(0.10233285, 0.22455986, -0.13368733, 0.033236265, -0.052114893, -0.11709317, 0.009709581, 0.19201641, -0.02973698, 0.032114245, -0.09771862, 0.085680574, 0.15827927, -0.15042172, 0.21833214, -0.13262676) * go_2(1.0, 0.0); + result += mat4(-0.08460587, -0.09473209, 0.019323658, -0.057233352, 0.0019434267, -0.14437936, 0.034232683, 0.0030602294, -0.023598112, 0.10692026, -0.09960999, 0.005887181, 0.014738836, -0.32473162, -0.10886747, -0.08365826) * go_2(1.0, 1.0); + result += mat4(0.10900178, 0.00080280803, -0.14009437, -0.053074867, -0.07811151, -0.03456029, -0.104943685, 0.016918905, -0.11335709, 0.079421654, 0.13481963, 0.037818357, -0.027339859, 0.05856774, -0.044562265, 0.03908084) * go_3(-1.0, -1.0); + result += mat4(0.07628258, -0.23815769, 0.2840278, -0.3541637, -0.044292126, -0.09310441, -0.1335055, -0.031899665, -0.11981227, 0.24012394, -0.041896038, -0.10168982, 0.20248915, -0.10036763, -0.044115108, 0.08520525) * go_3(-1.0, 0.0); + result += mat4(0.07234102, -0.119480744, -0.01401321, -0.025182616, -0.031284854, -0.050089385, 0.014808948, 0.038662236, -0.18539418, 0.017342187, 0.023812262, 0.13428104, 0.020824855, -0.07433546, 0.054307282, 0.08511016) * go_3(-1.0, 1.0); + result += mat4(-0.11046813, -0.04663274, 0.33497185, 0.023273284, -0.24681108, 0.116665915, 0.12045893, 0.13306482, -0.039098527, 0.04747061, 0.042796664, 0.053514794, 0.011861975, -0.048702, 0.008408589, -0.09497112) * go_3(0.0, -1.0); + result += mat4(0.34634927, 0.37973458, -0.79267627, -0.7362719, 0.35489878, -0.07635863, 0.24082923, -0.27480397, -0.3236968, -0.25523046, 0.05118527, -0.040529836, -0.6000509, 0.39020586, 0.27632973, 0.5141453) * go_3(0.0, 0.0); + result += mat4(0.16761221, -0.033125393, 0.00561569, 0.083019435, -0.101278506, 0.07810264, 0.12060661, 0.16048536, 0.14257826, -0.15996903, 0.018831912, -0.094429865, -0.22227801, 0.426937, -0.054677445, 0.05067348) * go_3(0.0, 1.0); + result += mat4(0.02233958, 0.02608942, -0.045318656, 0.06509929, 0.035911568, 0.025316885, 0.0840986, 0.08326237, 0.048455603, -0.13630742, 0.07230253, -0.047261715, -0.092630014, 0.04786565, 0.10354939, -0.07094341) * go_3(1.0, -1.0); + result += mat4(-0.1463382, -0.14900577, 0.2835977, -0.106733374, -0.11554754, -0.168429, -0.1411373, -0.20654152, -0.06388508, 0.039648015, 0.08543832, -0.13253337, 0.017264463, -0.06346233, -0.10823598, 0.067361064) * go_3(1.0, 0.0); + result += mat4(0.04419582, 0.039152585, 0.06222691, 0.05757103, 0.012084537, 0.051425997, -0.061130576, 0.16752882, 0.07497411, 0.13495837, -0.15585983, -0.02050144, -0.08555421, -0.09147339, 0.025115604, 0.05948922) * go_3(1.0, 1.0); + result += vec4(0.00590038, 0.03082865, 0.002111702, -0.03330112); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x3x3x16 +//!HOOK MAIN +//!BIND conv2d_5_tf +//!BIND conv2d_5_tf1 +//!SAVE conv2d_6_tf1 +//!WIDTH conv2d_5_tf.w +//!HEIGHT conv2d_5_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define go_0(x_off, y_off) (max((conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_1(x_off, y_off) (max((conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0)) +#define go_2(x_off, y_off) (max(-(conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0)) +#define go_3(x_off, y_off) (max(-(conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0)) +vec4 hook() { + vec4 result = mat4(0.009029573, 0.029218858, 0.029705316, -0.019268971, -0.0023235187, -0.072589695, 0.1424836, 0.09049359, 0.04342995, 0.18134294, 0.018145641, 0.14789368, 0.050923645, 0.06524081, 0.036812488, 0.11108108) * go_0(-1.0, -1.0); + result += mat4(-0.026506428, 0.016968496, 0.015961196, 0.010030791, -0.3141888, -0.06769598, -0.23920257, -0.031002127, -0.07351358, -0.19290134, -0.24282931, -0.18831016, -0.0928966, 0.075177215, -0.19699521, -0.05810917) * go_0(-1.0, 0.0); + result += mat4(-0.017991852, -0.079427645, 0.035970494, -0.017095685, -0.27197137, -0.20046075, 0.2616644, 0.021876303, -0.077394076, -0.04978692, 0.20363241, -0.013741705, -0.032103598, 0.14403099, 0.01442474, 0.048115995) * go_0(-1.0, 1.0); + result += mat4(-0.16939245, -0.001777, 0.026244136, -0.14122388, -0.056853324, 0.54357284, -0.19769607, -0.03187079, 0.04559263, -0.16048127, 0.12830622, 0.1442168, 0.006611398, -0.01618195, 0.012860053, -0.16539487) * go_0(0.0, -1.0); + result += mat4(0.13116026, -0.006161343, 0.7209969, 0.18338475, 0.3099777, 0.6500026, 0.3883795, -0.021434233, 0.31667513, 0.008917659, 0.14124091, -0.22335114, 0.12198921, -0.16449445, 0.08773425, 0.30054978) * go_0(0.0, 0.0); + result += mat4(-0.10413989, -0.10316161, 0.04342709, -0.021252686, 0.120892406, 0.37798002, -0.35963747, 0.021069285, 0.37587845, -0.08159587, 0.011139747, 0.2501104, -0.094568014, 0.037900843, -0.025109999, -0.030106556) * go_0(0.0, 1.0); + result += mat4(0.09680291, -0.040868275, 0.051731605, 0.089064725, -0.56098557, -0.38148618, -0.017037416, 0.08508287, -0.019247344, 0.019857002, -0.03512887, 0.031057188, -0.09648583, -0.04474188, 0.028748507, -0.11880965) * go_0(1.0, -1.0); + result += mat4(-0.010236943, 0.04257042, -0.08202597, -0.004203426, -0.26801527, -0.11716526, -0.017402772, -0.05819106, -0.13394608, 0.0234606, -0.15404865, -0.06801164, -0.0047627664, -0.1975249, 0.09420144, 0.23249897) * go_0(1.0, 0.0); + result += mat4(0.107361935, 0.07373787, 0.06242962, 0.05236332, -0.028867323, 0.025924044, -0.042526353, -0.0015729597, -0.1323144, -0.4040712, 0.023919407, -0.09535502, 0.049100045, 0.081110805, 0.08946112, 0.058505684) * go_0(1.0, 1.0); + result += mat4(0.13236825, -0.04468476, -0.04426802, 0.031087106, -0.09093992, -0.07470971, -0.01591504, 0.05924266, -0.21910913, 0.065537, -0.18358919, -0.02533145, -0.1512009, -0.04953928, 0.015540006, -0.0043442883) * go_1(-1.0, -1.0); + result += mat4(-0.14016777, -0.1086958, 0.16316028, 0.050777458, 0.23148167, 0.04944809, -0.10599886, -0.10447021, -0.40729257, -0.10926556, 0.069055155, 0.110635415, 0.108922414, -0.1716362, 0.10743909, -0.102534756) * go_1(-1.0, 0.0); + result += mat4(0.017795928, -0.066930935, 0.09396082, 0.092585504, 0.14223933, 0.059458215, 0.072033696, -0.04507726, -0.19956456, 0.1251282, -0.31733638, -0.10465904, 0.08546377, 0.048638333, 0.031372465, -0.08720661) * go_1(-1.0, 1.0); + result += mat4(0.108719654, -0.092161916, -0.014724377, 0.20068261, -0.24350016, 0.2113636, -0.07483714, -0.45665312, -0.25134233, 0.2753893, -0.11324696, -0.04472, 0.1576102, -0.045395147, 0.06013951, -0.12507361) * go_1(0.0, -1.0); + result += mat4(0.546225, -0.281897, 0.19477816, -0.116612464, -0.3145171, -0.41660902, 0.333625, 0.35902345, 0.48333502, 0.4662005, 0.10222491, -0.15314859, -0.3036888, 0.22849742, 0.20740797, 0.41399437) * go_1(0.0, 0.0); + result += mat4(0.007284074, 0.0393942, -0.31192186, -0.15687793, -0.289214, -0.015956698, -0.24718472, -0.1637855, -0.00765037, 0.26677555, 0.20215511, 0.37790874, -0.22096673, 0.25287116, -0.2446764, -0.13610223) * go_1(0.0, 1.0); + result += mat4(-0.16734968, 0.16721225, -0.053508647, -0.041097626, 0.062356673, 0.07812319, -0.263546, -0.39739034, 0.003389846, 0.12676363, -0.13175991, -0.19019242, -0.011847587, -0.007580052, -0.023946386, 0.046034034) * go_1(1.0, -1.0); + result += mat4(-0.17047611, 0.13298693, -0.07506747, -0.045542978, 0.33571973, 0.20192616, 0.30674616, 0.25668672, -0.24134545, 0.031693842, -0.009647641, 0.040534843, 0.03159419, -0.1100516, 0.11371316, 0.06098735) * go_1(1.0, 0.0); + result += mat4(-0.05518961, 0.19402988, -0.09646874, -0.059196774, -0.0073436056, -0.1381309, 0.06868669, 0.061328378, -0.1480867, -0.15774113, -0.022572191, 0.122521356, -0.04067007, -0.10145177, 0.13006335, -0.099452734) * go_1(1.0, 1.0); + result += mat4(0.06962972, 0.07768411, 0.021085173, 0.108355984, -0.03132525, 0.10220273, -0.11626593, -0.14104277, 0.018778645, -0.024237925, 0.048783034, 0.09074447, 0.4120426, -0.01948466, 0.073218934, 0.055681944) * go_2(-1.0, -1.0); + result += mat4(-0.22553118, -0.12923603, -0.22068842, -0.35037905, 0.005709937, -0.09528472, 0.08718399, 0.13200706, 0.17220478, 0.096844435, -0.30439013, -0.14122063, 0.15733318, -0.1014675, 0.33836862, 0.042193163) * go_2(-1.0, 0.0); + result += mat4(0.15826897, -0.034870047, 0.09295099, -0.17674965, -0.042326324, 0.06680338, -0.074267656, -0.0631393, -0.11267909, -0.19795708, 0.22005288, 0.35703793, 0.033995766, -0.12663686, -0.02449896, -0.123250045) * go_2(-1.0, 1.0); + result += mat4(0.021434195, 0.058398597, 0.04828315, -0.0016824572, -0.04291545, -0.0744907, -0.07698706, -0.15937585, -0.18852457, -0.17966963, 0.023800725, 0.025979731, -0.51412296, -0.018316887, -0.23076254, -0.12298674) * go_2(0.0, -1.0); + result += mat4(0.16054317, -0.0002730893, -0.54173076, -0.62443435, 0.04300197, -0.08529622, 0.15392275, 0.15742144, 0.025834514, -0.2800517, -0.17600477, 0.0020806703, -0.3010582, 0.45233512, 0.25595665, 0.103661336) * go_2(0.0, 0.0); + result += mat4(-0.024034392, -0.43800178, 0.28606912, -0.20908915, 0.078471914, -0.030501373, -0.059055753, 0.050494444, 0.063274644, -0.025071034, 0.17561312, -0.100698635, -0.25631955, 0.039981876, -0.18506624, 0.08366402) * go_2(0.0, 1.0); + result += mat4(-0.1413656, 0.03589635, -0.020917566, 0.017598262, 0.020156413, -0.018854238, 0.027228508, -0.03806087, -0.021715842, 0.071974196, -0.040065665, 0.08459291, -0.23530225, 0.16599682, -0.2772327, 0.10041177) * go_2(1.0, -1.0); + result += mat4(-0.055056706, 0.1286236, -0.11890451, -0.1790546, 0.16517544, -0.040448934, 0.12548013, 0.017075695, 0.07185459, -0.13236302, 0.19354409, 0.12767012, 0.31120765, 0.16378082, -0.036915366, -0.19724306) * go_2(1.0, 0.0); + result += mat4(-0.02225051, 0.033263147, 0.003279449, 0.08826271, -0.047833472, 6.574577e-05, 0.13721916, 0.04801998, -0.014958419, 0.08791209, -0.08076282, 0.024002168, -0.18028922, 0.23835851, -0.23309888, -0.119310364) * go_2(1.0, 1.0); + result += mat4(0.044960875, 0.18821983, 0.027640678, 0.013462449, 0.19011214, 0.21559924, -0.03329638, 0.07234414, 0.030880248, -0.11273214, 0.102028474, 0.12203351, 0.035855662, 0.008828778, 0.007218363, -0.012421797) * go_3(-1.0, -1.0); + result += mat4(-0.09450626, 0.025191775, -0.10738468, 0.16237053, 0.073676676, 0.12488881, -0.048748355, 0.007877263, 0.3572506, -0.07911043, 0.14684045, 0.0015310893, -0.33411503, -0.1151223, 0.004201752, 0.017775744) * go_3(-1.0, 0.0); + result += mat4(-0.10607509, -0.008143826, -0.08448629, -0.27557802, 0.0046665915, 0.008158659, 0.030826218, 0.020516023, 0.2333065, -0.017463414, -0.041772116, -0.03027809, -0.028166672, -0.080471426, 0.048199337, 0.08341059) * go_3(-1.0, 1.0); + result += mat4(-0.14640257, -0.18334304, -0.061674733, 0.0008892598, -0.2374775, -0.2721524, -0.040371176, 0.26362613, 0.19872928, -0.11246391, 0.0842288, 0.11188515, 0.0045209546, -0.04250933, -0.0738212, -0.069005966) * go_3(0.0, -1.0); + result += mat4(-0.08760266, 0.4816288, -0.21241407, 0.22734411, -0.1783721, -0.26842996, 0.099888, -0.2867675, 0.085521065, -0.3780281, -0.018543908, -0.039699722, 0.75688565, -0.5333645, 0.47567275, 0.09518891) * go_3(0.0, 0.0); + result += mat4(-0.04072665, 0.05998423, -0.48314768, -0.29495844, 0.10358383, -0.09816629, 0.028586809, -0.047708735, 0.008320228, 0.04089551, -0.18359782, -0.27615002, 0.12414414, -0.072417594, 0.25932562, 0.30268723) * go_3(0.0, 1.0); + result += mat4(0.14481631, 0.06484443, -0.09898657, -0.06553556, 0.25750044, -0.07265585, 0.12903488, -0.022347894, -0.04693863, -0.000107379274, 0.030295763, -0.0325354, 0.086214684, -0.021326948, 0.039682828, -0.034843277) * go_3(1.0, -1.0); + result += mat4(-0.031971477, -0.25145087, 0.03931631, 0.14262606, -0.06044626, 0.22820354, -0.10506207, 0.18064679, 0.0069641788, 0.01477993, -0.003626875, 0.118767865, 0.109416224, -0.002998205, 0.035680585, 0.07843882) * go_3(1.0, 0.0); + result += mat4(0.03375426, -0.059815384, 0.11632834, -0.12411481, 0.022583738, 0.02544465, -0.054889992, -0.07031964, -0.10140042, 0.16750422, -0.1448294, -0.09316004, 0.035582513, -0.026138382, -0.031955894, 0.040148776) * go_3(1.0, 1.0); + result += vec4(-0.03573331, 0.032919675, 0.011109369, 0.008329268); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x1x1x112 +//!HOOK MAIN +//!BIND conv2d_tf +//!BIND conv2d_tf1 +//!BIND conv2d_1_tf +//!BIND conv2d_1_tf1 +//!BIND conv2d_2_tf +//!BIND conv2d_2_tf1 +//!BIND conv2d_3_tf +//!BIND conv2d_3_tf1 +//!BIND conv2d_4_tf +//!BIND conv2d_4_tf1 +//!BIND conv2d_5_tf +//!BIND conv2d_5_tf1 +//!BIND conv2d_6_tf +//!BIND conv2d_6_tf1 +//!SAVE conv2d_last_tf +//!WIDTH conv2d_tf.w +//!HEIGHT conv2d_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define g_0 (max((conv2d_tf_tex(conv2d_tf_pos)), 0.0)) +#define g_1 (max((conv2d_tf1_tex(conv2d_tf1_pos)), 0.0)) +#define g_2 (max(-(conv2d_tf_tex(conv2d_tf_pos)), 0.0)) +#define g_3 (max(-(conv2d_tf1_tex(conv2d_tf1_pos)), 0.0)) +#define g_4 (max((conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0)) +#define g_5 (max((conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0)) +#define g_6 (max(-(conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0)) +#define g_7 (max(-(conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0)) +#define g_8 (max((conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0)) +#define g_9 (max((conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0)) +#define g_10 (max(-(conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0)) +#define g_11 (max(-(conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0)) +#define g_12 (max((conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0)) +#define g_13 (max((conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0)) +#define g_14 (max(-(conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0)) +#define g_15 (max(-(conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0)) +#define g_16 (max((conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0)) +#define g_17 (max((conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0)) +#define g_18 (max(-(conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0)) +#define g_19 (max(-(conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0)) +#define g_20 (max((conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0)) +#define g_21 (max((conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0)) +#define g_22 (max(-(conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0)) +#define g_23 (max(-(conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0)) +#define g_24 (max((conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0)) +#define g_25 (max((conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0)) +#define g_26 (max(-(conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0)) +#define g_27 (max(-(conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0)) +vec4 hook() { + vec4 result = mat4(-0.11498094, -0.053904895, -0.11520678, -0.05479549, 0.028396055, 0.032767884, 0.052479446, 0.05257866, -0.25706592, -0.3454966, -0.24713765, -0.2854201, -0.10287636, 0.0023146886, -0.09190338, -0.011193905) * g_0; + result += mat4(-0.05461422, 0.008780496, -0.07738697, -0.032230727, -0.047554165, -0.025061952, -0.051897213, -0.009545297, -0.14548294, -0.15184018, -0.01313442, -0.015299784, -0.0007883845, -0.12866738, -0.15260352, -0.27081275) * g_1; + result += mat4(0.11007706, 0.035344437, 0.11020841, 0.0425353, 0.1613199, 0.18417408, 0.09274313, 0.11943135, 0.106862, 0.079875536, 0.0937752, 0.068030775, 0.029093558, -0.06441164, 0.06467169, -0.021989612) * g_2; + result += mat4(0.049548414, -0.012455486, 0.07185561, 0.021865537, 0.020969186, -0.03374196, -0.024260623, -0.07739141, 0.07164591, 0.12741035, 0.0379913, 0.076403245, 0.07049977, 0.0744538, 0.0062989634, 0.01818882) * g_3; + result += mat4(-0.12511204, -0.010836819, 0.13709816, 0.22472954, 0.21280868, -0.006484726, 0.17554289, -0.009977173, 0.078398876, 0.20698707, 0.13432744, 0.29740283, -0.24750128, -0.32757792, -0.19807857, -0.2537023) * g_4; + result += mat4(-0.27207088, -0.1385644, -0.2166476, -0.07687419, -0.20300622, -0.29678395, -0.13135734, -0.20851587, 0.0361364, 0.011243289, -0.06845459, -0.11796941, 0.11575868, 0.070215136, -0.10295678, -0.12281369) * g_5; + result += mat4(0.13619795, -0.0019436983, -0.12701888, -0.25933513, -0.20134166, 0.00062823144, -0.076756015, 0.11002947, 0.0059049693, -0.18756741, -0.0718802, -0.2589954, 0.23413423, 0.30107784, 0.14445266, 0.18920745) * g_6; + result += mat4(0.1494216, 0.0587532, 0.05478662, -0.039123338, 0.23322394, 0.29950607, 0.24384268, 0.27843767, -0.16094431, -0.04705998, -0.016345032, 0.028868208, -0.102872886, -0.04659664, 0.104105346, 0.14305067) * g_7; + result += mat4(-0.001037014, 0.010001526, -0.0052278573, 0.024779709, 0.06857274, 0.067640975, 0.085439384, 0.09242789, -0.066597246, -0.055928994, 0.0015658981, 0.016131008, -0.03524695, -0.018364554, -0.047754433, -0.014295886) * g_8; + result += mat4(-0.042207, 0.02835915, -0.1404656, -0.08563323, -0.030979915, -0.0673764, 0.10733943, 0.057902794, 0.00022424995, -0.0023634837, -0.10778953, -0.10202357, -0.020368295, -0.019088887, -0.06875738, -0.08504131) * g_9; + result += mat4(-0.00043458896, 0.00045652856, -0.02016843, -0.020062413, -0.08740103, -0.042085808, -0.10644177, -0.09226477, 0.11212161, -0.00048174805, 0.021872435, -0.05868698, 0.0333954, 0.058184672, 0.05532576, 0.07621587) * g_10; + result += mat4(0.054245148, 0.001020329, 0.09106849, 0.05303779, 0.009889632, 0.01309413, -0.09187347, -0.08618193, -0.011621187, 0.016222361, 0.061095525, 0.060885344, 0.078050986, 0.0111776795, 0.08829944, 0.032022282) * g_11; + result += mat4(0.01643529, 0.02285545, -0.03498564, 0.00769657, -0.0042474116, 0.015836312, -0.025771018, -0.0016368, -0.008897948, -0.012588166, -0.01416411, -0.003578984, 0.025991246, 0.021237152, 0.017450012, 0.025172485) * g_12; + result += mat4(0.014568868, 0.017796224, -0.036679734, -0.03138748, 0.019457601, -0.027607411, -0.004529679, -0.038048342, -0.054055385, -0.03876025, 0.041948095, 0.005869784, 0.02439633, 0.05177997, 0.016000897, 0.0057169925) * g_13; + result += mat4(-0.03021866, 0.017678728, -0.01371109, 0.013548159, -0.0038099394, -0.014066414, 0.028093752, 0.0027308422, -0.010615999, 0.012673458, -0.03028171, -0.016818244, -0.06530097, -0.018845048, -0.0072947564, -0.0038243714) * g_14; + result += mat4(-0.019006258, -0.007847591, 0.03690709, 0.06714211, 0.0073993434, -0.009766907, -0.0021441753, -0.01308625, 0.06658726, 0.06701995, -0.027305668, -0.016032105, -0.028976806, -0.0036668575, -0.0027825525, 0.0105632655) * g_15; + result += mat4(0.028945107, -0.0014701135, 0.048950657, -0.01923516, -0.0014054152, 0.002650635, -0.005300331, 0.004860559, 0.011158468, 0.005940625, -0.012095051, 0.0041518128, -0.020433836, -0.025870577, -0.0007547932, -0.026509356) * g_16; + result += mat4(-0.004545374, 0.04264545, 0.021741537, 0.029115127, 0.04225599, -0.0055392785, 0.026570829, -0.031795148, -0.008307126, 0.020176455, 0.010904648, 0.017765503, -0.10806103, -0.01776947, 0.00070428237, -0.06356262) * g_17; + result += mat4(-0.05663172, 0.05908046, -0.03837452, 0.06636983, -0.007960516, -0.06384041, 0.023125881, -0.030108837, 0.0038054318, -0.023263922, 0.020264054, -0.0062937695, 0.031630237, 0.020909082, 0.03594235, 0.035879835) * g_18; + result += mat4(-0.0050448794, 0.033650696, -0.002830413, 0.035174295, -0.024521282, 0.013054315, -0.020833842, 0.037953895, 0.08249671, 0.024239466, -0.012758333, -0.027316988, 0.051040914, 0.0005025873, 0.039778862, 0.0024668393) * g_19; + result += mat4(0.017232442, 0.022482058, 0.020233413, 0.024337437, 0.07986929, 0.06234036, 0.12662584, -0.05271183, -0.009718745, -0.0046989853, -0.0030333172, -0.04034237, -0.0113442, 0.022746231, -0.035293855, -0.009433693) * g_20; + result += mat4(0.015766997, 0.013647276, -0.029327558, 0.039106004, -0.010398323, -0.032851525, 0.02908329, -0.003789618, 0.12963496, 0.010851003, 0.1126276, -0.049255487, 0.06867432, 0.07970792, 0.017840397, -0.026481882) * g_21; + result += mat4(-0.058729574, -0.07886952, 0.033267397, 0.02755372, -0.0172006, 0.012404398, -0.0230168, -0.015059758, -0.09239916, -0.029533267, -0.043251917, 0.0035152994, 0.022931995, 0.101714484, -0.044946067, 0.094993) * g_22; + result += mat4(-0.04708704, -0.032475296, -0.03228093, -0.08810475, 0.013745045, 0.027828002, -0.031922746, 0.022986397, -0.061620213, -0.03694645, -0.055026993, 0.0031291894, -0.028799903, -0.0025357977, -0.03441407, 0.0028600092) * g_23; + result += mat4(0.058981724, -0.10447273, -0.088705614, 0.16546178, -0.023549391, -0.008831522, -0.018411588, 0.029640056, -0.068086684, -0.05414636, -0.029401174, 0.036180343, -0.031988926, -0.047249753, 0.008162177, 0.00548062) * g_24; + result += mat4(0.05287462, -0.030657746, 0.02821435, 0.037005343, 0.03534311, -0.15614955, 0.07085459, -0.11997641, -0.009156166, -0.021968868, -0.054147746, -0.07307657, -0.006428544, -0.017528288, 0.012614676, 0.037840024) * g_25; + result += mat4(-0.021977803, 0.047799855, 0.02660416, -0.07292106, 0.045195807, -0.0056674764, 0.10824326, -0.112114795, 0.1447127, -0.0119616175, 0.0011661504, -0.04553905, 0.13048342, 0.14574122, -0.105522245, -0.102792375) * g_26; + result += mat4(-0.16397473, 0.15785863, -0.06666504, -0.01682913, 0.06070918, 0.070222184, 0.037701584, 0.026657054, -0.0835267, -0.009457008, 0.13232987, 0.13508691, -0.056414206, -0.06818828, 0.079076104, 0.032249212) * g_27; + result += vec4(-0.10795144, -0.09953324, -0.055413827, -0.03875493); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x1x1x112 +//!HOOK MAIN +//!BIND conv2d_tf +//!BIND conv2d_tf1 +//!BIND conv2d_1_tf +//!BIND conv2d_1_tf1 +//!BIND conv2d_2_tf +//!BIND conv2d_2_tf1 +//!BIND conv2d_3_tf +//!BIND conv2d_3_tf1 +//!BIND conv2d_4_tf +//!BIND conv2d_4_tf1 +//!BIND conv2d_5_tf +//!BIND conv2d_5_tf1 +//!BIND conv2d_6_tf +//!BIND conv2d_6_tf1 +//!SAVE conv2d_last_tf1 +//!WIDTH conv2d_tf.w +//!HEIGHT conv2d_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define g_0 (max((conv2d_tf_tex(conv2d_tf_pos)), 0.0)) +#define g_1 (max((conv2d_tf1_tex(conv2d_tf1_pos)), 0.0)) +#define g_2 (max(-(conv2d_tf_tex(conv2d_tf_pos)), 0.0)) +#define g_3 (max(-(conv2d_tf1_tex(conv2d_tf1_pos)), 0.0)) +#define g_4 (max((conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0)) +#define g_5 (max((conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0)) +#define g_6 (max(-(conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0)) +#define g_7 (max(-(conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0)) +#define g_8 (max((conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0)) +#define g_9 (max((conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0)) +#define g_10 (max(-(conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0)) +#define g_11 (max(-(conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0)) +#define g_12 (max((conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0)) +#define g_13 (max((conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0)) +#define g_14 (max(-(conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0)) +#define g_15 (max(-(conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0)) +#define g_16 (max((conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0)) +#define g_17 (max((conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0)) +#define g_18 (max(-(conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0)) +#define g_19 (max(-(conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0)) +#define g_20 (max((conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0)) +#define g_21 (max((conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0)) +#define g_22 (max(-(conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0)) +#define g_23 (max(-(conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0)) +#define g_24 (max((conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0)) +#define g_25 (max((conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0)) +#define g_26 (max(-(conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0)) +#define g_27 (max(-(conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0)) +vec4 hook() { + vec4 result = mat4(0.024905335, -0.0020974763, 0.02695263, 0.00016802056, -0.024053082, -0.02133723, -0.031614035, -0.031826317, 0.120421864, 0.10555479, 0.08609448, 0.116875134, 0.046175968, 0.04224941, 0.059216674, 0.035143953) * g_0; + result += mat4(0.059397914, 0.016519934, 0.07189327, 0.047407165, 0.04808963, 0.02792908, 0.057017103, 0.034324065, 0.14228246, 0.11275426, 0.088058695, 0.059600517, 0.02063494, 0.052596953, 0.047207687, 0.08789091) * g_1; + result += mat4(-0.013453174, 0.008474715, -0.017593835, 0.009218917, 0.070580654, 0.040542338, 0.08812338, 0.074653216, -0.016356857, 0.015809007, -0.008739107, 0.0097674895, -0.018381525, -0.007775341, -0.040571664, -0.011188163) * g_2; + result += mat4(-0.026196122, -0.034825727, -0.042998232, -0.033436514, -0.01678153, -0.004592797, -0.010311677, 0.0008815291, -0.08899181, -0.10274026, -0.066960976, -0.082430154, -0.057137426, -0.07554528, -0.030993424, -0.050372377) * g_3; + result += mat4(0.022921838, -0.010479244, -0.050794605, -0.073633075, -0.053708922, 0.009594084, -0.071259, -0.01054356, 0.005165821, -0.08024963, -0.049251772, -0.09581235, 0.17995799, 0.09743011, 0.13533138, 0.11643848) * g_4; + result += mat4(0.09727046, 0.07292666, 0.06820908, 0.041535784, -0.0049705, 0.0048759184, -0.035702795, -0.015944308, -0.010730028, 0.018847652, 0.06466244, 0.086318985, -0.05661574, -0.040698618, 0.010839972, 0.0027009705) * g_5; + result += mat4(-0.04628466, 0.010060396, 0.02609333, 0.08664702, 0.057045907, 0.033591177, 0.02186063, -0.024303377, 0.006569828, 0.08025825, 0.016128821, 0.10180713, -0.12228169, -0.112990454, -0.078443415, -0.09126021) * g_6; + result += mat4(-0.12733299, -0.087755, -0.07374111, -0.044979006, -0.025347412, -0.004083168, 0.023782173, 0.02900392, -0.017815407, -0.041119996, -0.057978686, -0.13521095, 0.08364004, 0.06950181, 0.023554614, 0.008043734) * g_7; + result += mat4(0.009062775, -0.003570175, -0.007378757, -0.0018487388, 0.01145638, 0.05217187, -0.008250244, 0.008433307, -0.056756936, -0.044681005, -0.08096105, -0.08033185, -0.023784965, -0.01859799, 0.013042476, 0.021188647) * g_8; + result += mat4(-0.0071619656, -0.012498299, -0.05144986, -0.078112476, -0.034992415, -0.017038302, -0.04464615, -0.044504963, 0.024249, -0.004297534, 0.03674578, 0.03090718, 0.04698553, 0.008344952, 0.057619847, -0.0338724) * g_9; + result += mat4(-0.011845145, -0.0045043705, -1.6646482e-06, -0.0038495932, -0.01992515, 0.004827126, 0.019493148, 0.00862289, 0.10151322, 0.0021909082, 0.09940764, 0.03728846, 0.027824005, 0.04358071, 0.014909185, 0.036326095) * g_10; + result += mat4(0.022513246, 0.028257169, 0.0102195935, 0.03301329, 0.052253865, -0.0021944977, 0.08247392, 0.03256867, -0.040685873, -0.0052207555, -0.0451257, -0.054165114, 0.01647699, 0.0028809097, -0.015233776, -0.0008741886) * g_11; + result += mat4(0.017371105, 0.01597189, -0.052552313, -0.008554715, -0.0023150423, 0.006076517, -0.012868931, 0.0039361073, -0.007524978, -0.004284313, -0.021520883, -0.010327569, 0.02543678, 0.008725823, -0.0073885336, 0.005528395) * g_12; + result += mat4(0.019192757, 0.016561812, 0.0027538154, 0.0013078215, 0.007916496, -0.042525183, -0.013173432, -0.05265476, -0.062195376, -0.011255499, 0.020898128, 0.021532273, -0.001524097, 0.034835674, -0.004051403, -0.0292426) * g_13; + result += mat4(-0.049191684, -9.43322e-06, -0.009106849, 0.012845289, -0.019482708, -0.011163468, 0.0034011535, -0.007062845, -0.006469714, 0.03177786, -0.033006195, -0.0006813464, -0.053963087, 0.00085209147, 0.02734121, 0.034086403) * g_14; + result += mat4(-0.03232248, -0.004037002, -0.010319106, 0.030889064, 0.019604538, 0.0020888883, 0.010277864, 0.000661223, 0.057915937, 0.030683514, 0.00042533095, -0.013019287, -0.015896408, 0.0038484468, -0.0042103594, 0.02174542) * g_15; + result += mat4(0.032975145, 0.0011456647, 0.04913679, -0.017063798, 0.0117176045, 0.007440557, 0.0020480808, 0.009415731, 0.027573857, 0.015140836, -0.01679426, -0.006124731, -0.03206279, -0.029842237, -0.010428016, -0.028513178) * g_16; + result += mat4(-0.00506859, 0.055869613, 0.010164368, 0.027031485, 0.042289548, -0.0054258504, 0.032214936, -0.029970925, -0.0058315448, 0.022889478, 0.01681123, 0.02985076, -0.111186065, -0.02202099, 0.0030994313, -0.062343158) * g_17; + result += mat4(-0.060951103, 0.06079555, -0.0396464, 0.070911355, -0.011480358, -0.06803282, 0.01637355, -0.043100975, -0.00423709, -0.028337711, 0.021635853, 0.0014857082, 0.030084312, 0.018155476, 0.043694943, 0.038795974) * g_18; + result += mat4(-0.0060662925, 0.029721662, -0.008117774, 0.034551267, -0.024477571, 0.018841071, -0.027095588, 0.034495078, 0.082398005, 0.008998768, -0.016399248, -0.043801688, 0.05936684, 0.006066549, 0.045399766, 3.5319943e-05) * g_19; + result += mat4(0.019259382, 0.02494012, 0.029301709, 0.028329274, 0.09122267, 0.06900443, 0.1412115, -0.043169618, -0.01627418, -0.004989528, -0.0042651827, -0.04556752, -0.023623291, 0.013007996, -0.04483056, -0.015727345) * g_20; + result += mat4(0.016332543, 0.016384754, -0.030676385, 0.045312885, -0.0100853555, -0.032632045, 0.031514473, -0.0070776115, 0.13642761, 0.0023589598, 0.12214136, -0.062155515, 0.08240989, 0.08894205, 0.03325406, -0.016589595) * g_21; + result += mat4(-0.06494277, -0.08158925, 0.030425413, 0.019835634, -0.012624623, 0.013942616, -0.030527417, -0.021668324, -0.09444672, -0.033064254, -0.044167448, 0.0011024752, 0.03210801, 0.12662941, -0.03912534, 0.1112649) * g_22; + result += mat4(-0.04716062, -0.03751481, -0.031030515, -0.09067383, 0.0077815712, 0.02169541, -0.035285182, 0.02290573, -0.0704085, -0.03916127, -0.058103334, 0.004915147, -0.0333844, -0.011548617, -0.031151932, -0.00043817286) * g_23; + result += mat4(0.05976319, -0.107285, -0.097245865, 0.17706421, -0.021453341, -0.0047738464, -0.017621001, 0.033400454, -0.07225561, -0.05599672, -0.027600193, 0.038664024, -0.03762786, -0.052429967, 0.0104017975, 0.007116869) * g_24; + result += mat4(0.06014114, -0.029824806, 0.03209269, 0.04392036, 0.031300627, -0.16249833, 0.06878509, -0.12658615, -0.012383169, -0.025043553, -0.06527381, -0.08149099, -0.014006842, -0.018669648, 0.014510818, 0.042045828) * g_25; + result += mat4(-0.023342922, 0.047104675, 0.029629575, -0.082307704, 0.04035797, -0.0013049254, 0.11085582, -0.11031226, 0.14778149, -0.016699014, -0.00634342, -0.055320874, 0.14306462, 0.15896587, -0.110229075, -0.1069649) * g_26; + result += mat4(-0.17449625, 0.15787153, -0.06711028, -0.023110518, 0.06862914, 0.074063435, 0.042682912, 0.029800726, -0.08768606, -0.009814701, 0.14180017, 0.14780663, -0.05672417, -0.074305914, 0.07873489, 0.028458012) * g_27; + result += vec4(0.06026231, 0.040204916, 0.037672628, 0.023496555); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Conv-4x1x1x112 +//!HOOK MAIN +//!BIND conv2d_tf +//!BIND conv2d_tf1 +//!BIND conv2d_1_tf +//!BIND conv2d_1_tf1 +//!BIND conv2d_2_tf +//!BIND conv2d_2_tf1 +//!BIND conv2d_3_tf +//!BIND conv2d_3_tf1 +//!BIND conv2d_4_tf +//!BIND conv2d_4_tf1 +//!BIND conv2d_5_tf +//!BIND conv2d_5_tf1 +//!BIND conv2d_6_tf +//!BIND conv2d_6_tf1 +//!SAVE conv2d_last_tf2 +//!WIDTH conv2d_tf.w +//!HEIGHT conv2d_tf.h +//!COMPONENTS 4 +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +#define g_0 (max((conv2d_tf_tex(conv2d_tf_pos)), 0.0)) +#define g_1 (max((conv2d_tf1_tex(conv2d_tf1_pos)), 0.0)) +#define g_2 (max(-(conv2d_tf_tex(conv2d_tf_pos)), 0.0)) +#define g_3 (max(-(conv2d_tf1_tex(conv2d_tf1_pos)), 0.0)) +#define g_4 (max((conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0)) +#define g_5 (max((conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0)) +#define g_6 (max(-(conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0)) +#define g_7 (max(-(conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0)) +#define g_8 (max((conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0)) +#define g_9 (max((conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0)) +#define g_10 (max(-(conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0)) +#define g_11 (max(-(conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0)) +#define g_12 (max((conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0)) +#define g_13 (max((conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0)) +#define g_14 (max(-(conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0)) +#define g_15 (max(-(conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0)) +#define g_16 (max((conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0)) +#define g_17 (max((conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0)) +#define g_18 (max(-(conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0)) +#define g_19 (max(-(conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0)) +#define g_20 (max((conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0)) +#define g_21 (max((conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0)) +#define g_22 (max(-(conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0)) +#define g_23 (max(-(conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0)) +#define g_24 (max((conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0)) +#define g_25 (max((conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0)) +#define g_26 (max(-(conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0)) +#define g_27 (max(-(conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0)) +vec4 hook() { + vec4 result = mat4(0.1765669, 0.14268716, 0.19186598, 0.15799578, 0.016374417, 0.018578433, 0.0039475, 0.0046772263, 0.39840183, 0.36909792, 0.35409746, 0.37422222, -0.108508386, -0.1331279, -0.10336035, -0.14776541) * g_0; + result += mat4(-0.057757027, -0.14071062, -0.025283009, -0.09397916, -0.09031894, -0.14219165, -0.08299535, -0.13970287, -0.12259208, -0.14382727, -0.22002274, -0.25016093, -0.048906635, 0.06620249, 0.016965045, 0.1295978) * g_1; + result += mat4(-0.16748372, -0.13718611, -0.18565705, -0.15029612, -0.080749065, -0.09955825, 0.032431383, 0.023855643, -0.2748885, -0.23232168, -0.29121292, -0.26405892, 0.16556135, 0.18657646, 0.1424068, 0.18855052) * g_2; + result += mat4(0.10960496, 0.10851629, 0.095003806, 0.11053746, 0.09885307, 0.14437789, 0.13191165, 0.17365928, 0.16558935, 0.15473324, 0.21136154, 0.19976667, -0.07267957, -0.11469687, -0.029134216, -0.06817615) * g_3; + result += mat4(0.10202856, 0.04216857, -0.03959349, -0.09849683, -0.1576996, -0.049997438, -0.1579918, -0.058789205, 0.029792828, -0.07311781, -0.045432188, -0.11312683, 0.24257647, 0.16204113, 0.17869382, 0.16024388) * g_4; + result += mat4(0.17193612, 0.12692013, 0.13177487, 0.0796725, 0.0797928, 0.08952722, -0.012468046, 0.011071511, -0.068559825, -0.024852324, 0.0526428, 0.07917346, -0.085534215, -0.09591339, 0.04615827, 0.024577664) * g_5; + result += mat4(-0.14653449, -0.067267366, -0.002524394, 0.086243175, 0.13660401, 0.08039592, 0.09179008, 0.022573143, -0.024744196, 0.09120211, 0.017654825, 0.14114714, -0.16093308, -0.14538004, -0.09950235, -0.111152865) * g_6; + result += mat4(-0.188637, -0.12968326, -0.1200479, -0.06537649, -0.12589337, -0.106242515, -0.02788782, -0.025949068, 0.04948153, 0.02222735, -0.025291357, -0.12379292, 0.11074645, 0.11902375, -0.00056989543, -0.0024386419) * g_7; + result += mat4(0.018286629, 0.0072215167, 0.00037828335, 0.0047001047, 0.011478272, 0.041745186, -0.015742473, -0.002282524, -0.03440817, -0.02196847, -0.07838253, -0.07993771, -0.010155526, -0.017590692, 0.027141469, 0.029741213) * g_8; + result += mat4(0.016512005, 0.004950637, -0.0238836, -0.05587327, -0.03164328, -0.009499985, -0.059880238, -0.061794154, 0.023154303, -0.013266373, 0.04701534, 0.0415862, 0.06357814, 0.033057794, 0.08389772, 0.00035060212) * g_9; + result += mat4(-0.016403968, -0.012538788, -0.0015746636, -0.004771009, -0.021361275, -0.009695242, 0.020548422, -0.0024130535, 0.07796766, -0.01516671, 0.09961382, 0.042754963, 0.017363647, 0.03729065, -0.004795824, 0.01550197) * g_10; + result += mat4(-0.0028093113, 0.011869523, -0.02216933, 0.011177349, 0.033342455, -0.021146454, 0.07830085, 0.032490104, -0.03281833, 0.0060484232, -0.04081057, -0.04945058, -0.0056189033, -0.010636801, -0.041949317, -0.025739705) * g_11; + result += mat4(0.012979897, 0.016758928, -0.049062215, -0.0035748442, 0.0085972, 0.0036381132, -0.0055621094, 0.0041307937, -0.0008907763, -0.0034079372, -0.025680453, -0.015531803, 0.012816766, 0.009977763, -0.016416566, 0.0034859509) * g_12; + result += mat4(0.021753248, 0.016452711, 0.009833835, 0.0065052663, 0.0014061348, -0.046160888, -0.0132271005, -0.05051269, -0.05746351, -0.0012690664, 0.017191738, 0.018192926, -0.008879476, 0.026354216, -0.012801991, -0.029587373) * g_13; + result += mat4(-0.04220692, -0.0015560482, -0.0019648245, 0.013402305, -0.018259782, -0.0036008905, 0.0035650074, -0.0019178417, 0.00051580026, 0.027355857, -0.017914988, 0.004937948, -0.046335887, 0.00013612259, 0.030293299, 0.030688645) * g_14; + result += mat4(-0.036683388, -0.0031274238, -0.026074665, 0.021684237, 0.022639066, 0.0022493738, 0.011508554, -0.0006385944, 0.04890418, 0.020119468, 0.004167364, -0.008356099, -0.008598796, 0.0089028, -0.0029575853, 0.016687104) * g_15; + result += mat4(0.027207986, 0.0011099194, 0.042383645, -0.015179333, 0.014744431, 0.006148344, 0.005165422, 0.0070196544, 0.030286826, 0.016620956, -0.01611366, -0.00667594, -0.029524863, -0.024751091, -0.013321004, -0.025199674) * g_16; + result += mat4(0.0027477827, 0.054622147, 0.010154094, 0.025437292, 0.031773083, -0.01055473, 0.022864206, -0.029010754, -0.0029999653, 0.025018329, 0.015316208, 0.027188798, -0.10096525, -0.017268656, 0.0012529213, -0.062078856) * g_17; + result += mat4(-0.053670805, 0.057336535, -0.037418038, 0.06443577, -0.016027879, -0.058168363, 0.007034215, -0.03390141, -0.0019346164, -0.027947908, 0.021723913, -0.0018286633, 0.030507812, 0.018293543, 0.042917266, 0.033528328) * g_18; + result += mat4(-0.004559579, 0.029667616, -0.001870353, 0.0378995, -0.017147437, 0.020192018, -0.021574946, 0.031568103, 0.07487145, 0.0032376775, -0.018893708, -0.041981626, 0.054478757, 0.0061423797, 0.041280247, 0.000878061) * g_19; + result += mat4(0.017076394, 0.023647636, 0.029403262, 0.029923365, 0.08866472, 0.060613394, 0.1314274, -0.04490231, -0.016304834, -0.0062647443, -0.0031828512, -0.03989252, -0.024330825, 0.00741213, -0.04075287, -0.01615817) * g_20; + result += mat4(0.017866978, 0.017720113, -0.02846163, 0.040761847, -0.0063438355, -0.02347501, 0.029564403, -0.0029562064, 0.12505588, -0.0073986333, 0.11250363, -0.06179967, 0.07854423, 0.08546533, 0.034743227, -0.010757377) * g_21; + result += mat4(-0.06416677, -0.08344284, 0.030138884, 0.017635904, -0.012087523, 0.014205202, -0.03221233, -0.023834767, -0.091186255, -0.028958676, -0.04724334, 0.00013161585, 0.027391518, 0.1249978, -0.045047652, 0.10737729) * g_22; + result += mat4(-0.04326348, -0.03543181, -0.029558217, -0.08582413, 0.007812453, 0.014296562, -0.028779754, 0.018517692, -0.063755795, -0.036619596, -0.050809663, 0.005431336, -0.029205568, -0.011827915, -0.031110523, -0.005648626) * g_23; + result += mat4(0.05499293, -0.10000709, -0.0943537, 0.16143042, -0.019952895, -0.0039807972, -0.014841254, 0.0320363, -0.065173544, -0.049425576, -0.023904482, 0.03759679, -0.03207411, -0.047782745, 0.01352581, 0.008140566) * g_24; + result += mat4(0.055923894, -0.025134467, 0.029583648, 0.04096879, 0.027551858, -0.14995384, 0.06467113, -0.11633077, -0.01563784, -0.026909819, -0.06292879, -0.078409635, -0.009081105, -0.015533088, 0.019585673, 0.04334208) * g_25; + result += mat4(-0.021717606, 0.042464726, 0.02743202, -0.07388838, 0.03460472, 0.0038285658, 0.099842004, -0.098247, 0.13276267, -0.020793032, -0.008603039, -0.051913783, 0.12959045, 0.14735717, -0.10888226, -0.10263746) * g_26; + result += mat4(-0.16819532, 0.141579, -0.062480718, -0.021918943, 0.06348125, 0.06849444, 0.03888676, 0.027375204, -0.08194279, -0.012574497, 0.13523251, 0.13739482, -0.047547445, -0.058767617, 0.07009549, 0.028136581) * g_27; + result += vec4(0.069033325, 0.040207114, 0.027286075, 0.0065334598); + return result; +} +//!DESC Anime4K-v3.2-Upscale-CNN-x2-(VL)-Depth-to-Space +//!HOOK MAIN +//!BIND MAIN +//!BIND conv2d_last_tf +//!BIND conv2d_last_tf1 +//!BIND conv2d_last_tf2 +//!SAVE MAIN +//!WIDTH conv2d_last_tf.w 2 * +//!HEIGHT conv2d_last_tf.h 2 * +//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * +vec4 hook() { + vec2 f0 = fract(conv2d_last_tf_pos * conv2d_last_tf_size); + ivec2 i0 = ivec2(f0 * vec2(2.0)); + float c0 = conv2d_last_tf_tex((vec2(0.5) - f0) * conv2d_last_tf_pt + conv2d_last_tf_pos)[i0.y * 2 + i0.x]; + vec2 f1 = fract(conv2d_last_tf1_pos * conv2d_last_tf1_size); + ivec2 i1 = ivec2(f1 * vec2(2.0)); + float c1 = conv2d_last_tf1_tex((vec2(0.5) - f1) * conv2d_last_tf1_pt + conv2d_last_tf1_pos)[i1.y * 2 + i1.x]; + vec2 f2 = fract(conv2d_last_tf2_pos * conv2d_last_tf2_size); + ivec2 i2 = ivec2(f2 * vec2(2.0)); + float c2 = conv2d_last_tf2_tex((vec2(0.5) - f2) * conv2d_last_tf2_pt + conv2d_last_tf2_pos)[i2.y * 2 + i2.x]; + float c3 = c2; + return vec4(c0, c1, c2, c3) + MAIN_tex(MAIN_pos); +} diff --git a/.config/mpv/shaders/FSR.glsl b/.config/mpv/shaders/FSR.glsl new file mode 100644 index 0000000..f1794d7 --- /dev/null +++ b/.config/mpv/shaders/FSR.glsl @@ -0,0 +1,453 @@ +// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// FidelityFX FSR v1.0.2 by AMD +// ported to mpv by agyild + +// Changelog +// Made it compatible with pre-OpenGL 4.0 renderers +// Made it directly operate on LUMA plane, since the original shader was operating on LUMA by deriving it from RGB. This should cause a major increase in performance, especially on OpenGL 4.0+ renderers (4+2 texture lookups vs. 12+5) +// Removed transparency preservation mechanism since the alpha channel is a separate source plane than LUMA +// Added optional performance-saving lossy optimizations to EASU (Credit: atyuwen, https://atyuwen.github.io/posts/optimizing-fsr/) +// +// Notes +// Per AMD's guidelines only upscales content up to 4x (e.g., 1080p -> 2160p, 720p -> 1440p etc.) and everything else in between, +// that means FSR will scale up to 4x at maximum, and any further scaling will be processed by mpv's scalers + +//!HOOK LUMA +//!BIND HOOKED +//!SAVE EASUTEX +//!DESC FidelityFX Super Resolution v1.0.2 (EASU) +//!WHEN OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 > +//!WIDTH OUTPUT.w OUTPUT.w LUMA.w 2 * < * LUMA.w 2 * OUTPUT.w LUMA.w 2 * > * + OUTPUT.w OUTPUT.w LUMA.w 2 * = * + +//!HEIGHT OUTPUT.h OUTPUT.h LUMA.h 2 * < * LUMA.h 2 * OUTPUT.h LUMA.h 2 * > * + OUTPUT.h OUTPUT.h LUMA.h 2 * = * + +//!COMPONENTS 1 + +// User variables - EASU +#define FSR_PQ 0 // Whether the source content has PQ gamma or not. Needs to be set to the same value for both passes. 0 or 1. +#define FSR_EASU_DERING 1 // If set to 0, disables deringing for a small increase in performance. 0 or 1. +#define FSR_EASU_SIMPLE_ANALYSIS 0 // If set to 1, uses a simpler single-pass direction and length analysis for an increase in performance. 0 or 1. +#define FSR_EASU_QUIT_EARLY 0 // If set to 1, uses bilinear filtering for non-edge pixels and skips EASU on those regions for an increase in performance. 0 or 1. + +// Shader code + +#ifndef FSR_EASU_DIR_THRESHOLD + #if (FSR_EASU_QUIT_EARLY == 1) + #define FSR_EASU_DIR_THRESHOLD 64.0 + #elif (FSR_EASU_QUIT_EARLY == 0) + #define FSR_EASU_DIR_THRESHOLD 32768.0 + #endif +#endif + +float APrxLoRcpF1(float a) { + return uintBitsToFloat(uint(0x7ef07ebb) - floatBitsToUint(a)); +} + +float APrxLoRsqF1(float a) { + return uintBitsToFloat(uint(0x5f347d74) - (floatBitsToUint(a) >> uint(1))); +} + +float AMin3F1(float x, float y, float z) { + return min(x, min(y, z)); +} + +float AMax3F1(float x, float y, float z) { + return max(x, max(y, z)); +} + +#if (FSR_PQ == 1) + +float ToGamma2(float a) { + return pow(a, 4.0); +} + +#endif + + // Filtering for a given tap for the scalar. + void FsrEasuTap( + inout float aC, // Accumulated color, with negative lobe. + inout float aW, // Accumulated weight. + vec2 off, // Pixel offset from resolve position to tap. + vec2 dir, // Gradient direction. + vec2 len, // Length. + float lob, // Negative lobe strength. + float clp, // Clipping point. + float c){ // Tap color. + // Rotate offset by direction. + vec2 v; + v.x = (off.x * ( dir.x)) + (off.y * dir.y); + v.y = (off.x * (-dir.y)) + (off.y * dir.x); + // Anisotropy. + v *= len; + // Compute distance^2. + float d2 = v.x * v.x + v.y * v.y; + // Limit to the window as at corner, 2 taps can easily be outside. + d2 = min(d2, clp); + // Approximation of lancos2 without sin() or rcp(), or sqrt() to get x. + // (25/16 * (2/5 * x^2 - 1)^2 - (25/16 - 1)) * (1/4 * x^2 - 1)^2 + // |_______________________________________| |_______________| + // base window + // The general form of the 'base' is, + // (a*(b*x^2-1)^2-(a-1)) + // Where 'a=1/(2*b-b^2)' and 'b' moves around the negative lobe. + float wB = float(2.0 / 5.0) * d2 + -1.0; + float wA = lob * d2 + -1.0; + wB *= wB; + wA *= wA; + wB = float(25.0 / 16.0) * wB + float(-(25.0 / 16.0 - 1.0)); + float w = wB * wA; + // Do weighted average. + aC += c * w; + aW += w; +} + +// Accumulate direction and length. +void FsrEasuSet( + inout vec2 dir, + inout float len, + vec2 pp, +#if (FSR_EASU_SIMPLE_ANALYSIS == 1) + float b, float c, + float i, float j, float f, float e, + float k, float l, float h, float g, + float o, float n +#elif (FSR_EASU_SIMPLE_ANALYSIS == 0) + bool biS, bool biT, bool biU, bool biV, + float lA, float lB, float lC, float lD, float lE +#endif + ){ + // Compute bilinear weight, branches factor out as predicates are compiler time immediates. + // s t + // u v +#if (FSR_EASU_SIMPLE_ANALYSIS == 1) + vec4 w = vec4(0.0); + w.x = (1.0 - pp.x) * (1.0 - pp.y); + w.y = pp.x * (1.0 - pp.y); + w.z = (1.0 - pp.x) * pp.y; + w.w = pp.x * pp.y; + + float lA = dot(w, vec4(b, c, f, g)); + float lB = dot(w, vec4(e, f, i, j)); + float lC = dot(w, vec4(f, g, j, k)); + float lD = dot(w, vec4(g, h, k, l)); + float lE = dot(w, vec4(j, k, n, o)); +#elif (FSR_EASU_SIMPLE_ANALYSIS == 0) + float w = 0.0; + if (biS) + w = (1.0 - pp.x) * (1.0 - pp.y); + if (biT) + w = pp.x * (1.0 - pp.y); + if (biU) + w = (1.0 - pp.x) * pp.y; + if (biV) + w = pp.x * pp.y; +#endif + // Direction is the '+' diff. + // a + // b c d + // e + // Then takes magnitude from abs average of both sides of 'c'. + // Length converts gradient reversal to 0, smoothly to non-reversal at 1, shaped, then adding horz and vert terms. + float dc = lD - lC; + float cb = lC - lB; + float lenX = max(abs(dc), abs(cb)); + lenX = APrxLoRcpF1(lenX); + float dirX = lD - lB; + lenX = clamp(abs(dirX) * lenX, 0.0, 1.0); + lenX *= lenX; + // Repeat for the y axis. + float ec = lE - lC; + float ca = lC - lA; + float lenY = max(abs(ec), abs(ca)); + lenY = APrxLoRcpF1(lenY); + float dirY = lE - lA; + lenY = clamp(abs(dirY) * lenY, 0.0, 1.0); + lenY *= lenY; +#if (FSR_EASU_SIMPLE_ANALYSIS == 1) + len = lenX + lenY; + dir = vec2(dirX, dirY); +#elif (FSR_EASU_SIMPLE_ANALYSIS == 0) + dir += vec2(dirX, dirY) * w; + len += dot(vec2(w), vec2(lenX, lenY)); +#endif +} + +vec4 hook() { + // Result + vec4 pix = vec4(0.0, 0.0, 0.0, 1.0); + + //------------------------------------------------------------------------------------------------------------------------------ + // +---+---+ + // | | | + // +--(0)--+ + // | b | c | + // +---F---+---+---+ + // | e | f | g | h | + // +--(1)--+--(2)--+ + // | i | j | k | l | + // +---+---+---+---+ + // | n | o | + // +--(3)--+ + // | | | + // +---+---+ + // Get position of 'F'. + vec2 pp = HOOKED_pos * HOOKED_size - vec2(0.5); + vec2 fp = floor(pp); + pp -= fp; + //------------------------------------------------------------------------------------------------------------------------------ + // 12-tap kernel. + // b c + // e f g h + // i j k l + // n o + // Gather 4 ordering. + // a b + // r g + // Allowing dead-code removal to remove the 'z's. +#if (defined(HOOKED_gather) && (__VERSION__ >= 400 || (GL_ES && __VERSION__ >= 310))) + vec4 bczzL = HOOKED_gather(vec2((fp + vec2(1.0, -1.0)) * HOOKED_pt), 0); + vec4 ijfeL = HOOKED_gather(vec2((fp + vec2(0.0, 1.0)) * HOOKED_pt), 0); + vec4 klhgL = HOOKED_gather(vec2((fp + vec2(2.0, 1.0)) * HOOKED_pt), 0); + vec4 zzonL = HOOKED_gather(vec2((fp + vec2(1.0, 3.0)) * HOOKED_pt), 0); +#else + // pre-OpenGL 4.0 compatibility + float b = HOOKED_tex(vec2((fp + vec2(0.5, -0.5)) * HOOKED_pt)).r; + float c = HOOKED_tex(vec2((fp + vec2(1.5, -0.5)) * HOOKED_pt)).r; + + float e = HOOKED_tex(vec2((fp + vec2(-0.5, 0.5)) * HOOKED_pt)).r; + float f = HOOKED_tex(vec2((fp + vec2( 0.5, 0.5)) * HOOKED_pt)).r; + float g = HOOKED_tex(vec2((fp + vec2( 1.5, 0.5)) * HOOKED_pt)).r; + float h = HOOKED_tex(vec2((fp + vec2( 2.5, 0.5)) * HOOKED_pt)).r; + + float i = HOOKED_tex(vec2((fp + vec2(-0.5, 1.5)) * HOOKED_pt)).r; + float j = HOOKED_tex(vec2((fp + vec2( 0.5, 1.5)) * HOOKED_pt)).r; + float k = HOOKED_tex(vec2((fp + vec2( 1.5, 1.5)) * HOOKED_pt)).r; + float l = HOOKED_tex(vec2((fp + vec2( 2.5, 1.5)) * HOOKED_pt)).r; + + float n = HOOKED_tex(vec2((fp + vec2(0.5, 2.5) ) * HOOKED_pt)).r; + float o = HOOKED_tex(vec2((fp + vec2(1.5, 2.5) ) * HOOKED_pt)).r; + + vec4 bczzL = vec4(b, c, 0.0, 0.0); + vec4 ijfeL = vec4(i, j, f, e); + vec4 klhgL = vec4(k, l, h, g); + vec4 zzonL = vec4(0.0, 0.0, o, n); +#endif + //------------------------------------------------------------------------------------------------------------------------------ + // Rename. + float bL = bczzL.x; + float cL = bczzL.y; + float iL = ijfeL.x; + float jL = ijfeL.y; + float fL = ijfeL.z; + float eL = ijfeL.w; + float kL = klhgL.x; + float lL = klhgL.y; + float hL = klhgL.z; + float gL = klhgL.w; + float oL = zzonL.z; + float nL = zzonL.w; + +#if (FSR_PQ == 1) + // Not the most performance-friendly solution, but should work until mpv adds proper gamma transformation functions for shaders + bL = ToGamma2(bL); + cL = ToGamma2(cL); + iL = ToGamma2(iL); + jL = ToGamma2(jL); + fL = ToGamma2(fL); + eL = ToGamma2(eL); + kL = ToGamma2(kL); + lL = ToGamma2(lL); + hL = ToGamma2(hL); + gL = ToGamma2(gL); + oL = ToGamma2(oL); + nL = ToGamma2(nL); +#endif + + // Accumulate for bilinear interpolation. + vec2 dir = vec2(0.0); + float len = 0.0; +#if (FSR_EASU_SIMPLE_ANALYSIS == 1) + FsrEasuSet(dir, len, pp, bL, cL, iL, jL, fL, eL, kL, lL, hL, gL, oL, nL); +#elif (FSR_EASU_SIMPLE_ANALYSIS == 0) + FsrEasuSet(dir, len, pp, true, false, false, false, bL, eL, fL, gL, jL); + FsrEasuSet(dir, len, pp, false, true, false, false, cL, fL, gL, hL, kL); + FsrEasuSet(dir, len, pp, false, false, true, false, fL, iL, jL, kL, nL); + FsrEasuSet(dir, len, pp, false, false, false, true, gL, jL, kL, lL, oL); +#endif + //------------------------------------------------------------------------------------------------------------------------------ + // Normalize with approximation, and cleanup close to zero. + vec2 dir2 = dir * dir; + float dirR = dir2.x + dir2.y; + bool zro = dirR < float(1.0 / FSR_EASU_DIR_THRESHOLD); + dirR = APrxLoRsqF1(dirR); +#if (FSR_EASU_QUIT_EARLY == 1) + if (zro) { + vec4 w = vec4(0.0); + w.x = (1.0 - pp.x) * (1.0 - pp.y); + w.y = pp.x * (1.0 - pp.y); + w.z = (1.0 - pp.x) * pp.y; + w.w = pp.x * pp.y; + + pix.r = clamp(dot(w, vec4(fL, gL, jL, kL)), 0.0, 1.0); + return pix; + } +#elif (FSR_EASU_QUIT_EARLY == 0) + dirR = zro ? 1.0 : dirR; + dir.x = zro ? 1.0 : dir.x; +#endif + dir *= vec2(dirR); + // Transform from {0 to 2} to {0 to 1} range, and shape with square. + len = len * 0.5; + len *= len; + // Stretch kernel {1.0 vert|horz, to sqrt(2.0) on diagonal}. + float stretch = (dir.x * dir.x + dir.y * dir.y) * APrxLoRcpF1(max(abs(dir.x), abs(dir.y))); + // Anisotropic length after rotation, + // x := 1.0 lerp to 'stretch' on edges + // y := 1.0 lerp to 2x on edges + vec2 len2 = vec2(1.0 + (stretch - 1.0) * len, 1.0 + -0.5 * len); + // Based on the amount of 'edge', + // the window shifts from +/-{sqrt(2.0) to slightly beyond 2.0}. + float lob = 0.5 + float((1.0 / 4.0 - 0.04) - 0.5) * len; + // Set distance^2 clipping point to the end of the adjustable window. + float clp = APrxLoRcpF1(lob); + //------------------------------------------------------------------------------------------------------------------------------ + // Accumulation + // b c + // e f g h + // i j k l + // n o + float aC = 0.0; + float aW = 0.0; + FsrEasuTap(aC, aW, vec2( 0.0,-1.0) - pp, dir, len2, lob, clp, bL); // b + FsrEasuTap(aC, aW, vec2( 1.0,-1.0) - pp, dir, len2, lob, clp, cL); // c + FsrEasuTap(aC, aW, vec2(-1.0, 1.0) - pp, dir, len2, lob, clp, iL); // i + FsrEasuTap(aC, aW, vec2( 0.0, 1.0) - pp, dir, len2, lob, clp, jL); // j + FsrEasuTap(aC, aW, vec2( 0.0, 0.0) - pp, dir, len2, lob, clp, fL); // f + FsrEasuTap(aC, aW, vec2(-1.0, 0.0) - pp, dir, len2, lob, clp, eL); // e + FsrEasuTap(aC, aW, vec2( 1.0, 1.0) - pp, dir, len2, lob, clp, kL); // k + FsrEasuTap(aC, aW, vec2( 2.0, 1.0) - pp, dir, len2, lob, clp, lL); // l + FsrEasuTap(aC, aW, vec2( 2.0, 0.0) - pp, dir, len2, lob, clp, hL); // h + FsrEasuTap(aC, aW, vec2( 1.0, 0.0) - pp, dir, len2, lob, clp, gL); // g + FsrEasuTap(aC, aW, vec2( 1.0, 2.0) - pp, dir, len2, lob, clp, oL); // o + FsrEasuTap(aC, aW, vec2( 0.0, 2.0) - pp, dir, len2, lob, clp, nL); // n + //------------------------------------------------------------------------------------------------------------------------------ + // Normalize and dering. + pix.r = aC / aW; +#if (FSR_EASU_DERING == 1) + float min1 = min(AMin3F1(fL, gL, jL), kL); + float max1 = max(AMax3F1(fL, gL, jL), kL); + pix.r = clamp(pix.r, min1, max1); +#endif + pix.r = clamp(pix.r, 0.0, 1.0); + + return pix; +} + +//!HOOK LUMA +//!BIND EASUTEX +//!DESC FidelityFX Super Resolution v1.0.2 (RCAS) +//!WIDTH EASUTEX.w +//!HEIGHT EASUTEX.h +//!COMPONENTS 1 + +// User variables - RCAS +#define SHARPNESS 0.2 // Controls the amount of sharpening. The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}. 0.0 to 2.0. +#define FSR_RCAS_DENOISE 1 // If set to 1, lessens the sharpening on noisy areas. Can be disabled for better performance. 0 or 1. +#define FSR_PQ 0 // Whether the source content has PQ gamma or not. Needs to be set to the same value for both passes. 0 or 1. + +// Shader code + +#define FSR_RCAS_LIMIT (0.25 - (1.0 / 16.0)) // This is set at the limit of providing unnatural results for sharpening. + +float APrxMedRcpF1(float a) { + float b = uintBitsToFloat(uint(0x7ef19fff) - floatBitsToUint(a)); + return b * (-b * a + 2.0); +} + +float AMax3F1(float x, float y, float z) { + return max(x, max(y, z)); +} + +float AMin3F1(float x, float y, float z) { + return min(x, min(y, z)); +} + +#if (FSR_PQ == 1) + +float FromGamma2(float a) { + return sqrt(sqrt(a)); +} + +#endif + +vec4 hook() { + // Algorithm uses minimal 3x3 pixel neighborhood. + // b + // d e f + // h +#if (defined(EASUTEX_gather) && (__VERSION__ >= 400 || (GL_ES && __VERSION__ >= 310))) + vec3 bde = EASUTEX_gather(EASUTEX_pos + EASUTEX_pt * vec2(-0.5), 0).xyz; + float b = bde.z; + float d = bde.x; + float e = bde.y; + + vec2 fh = EASUTEX_gather(EASUTEX_pos + EASUTEX_pt * vec2(0.5), 0).zx; + float f = fh.x; + float h = fh.y; +#else + float b = EASUTEX_texOff(vec2( 0.0, -1.0)).r; + float d = EASUTEX_texOff(vec2(-1.0, 0.0)).r; + float e = EASUTEX_tex(EASUTEX_pos).r; + float f = EASUTEX_texOff(vec2(1.0, 0.0)).r; + float h = EASUTEX_texOff(vec2(0.0, 1.0)).r; +#endif + + // Min and max of ring. + float mn1L = min(AMin3F1(b, d, f), h); + float mx1L = max(AMax3F1(b, d, f), h); + + // Immediate constants for peak range. + vec2 peakC = vec2(1.0, -1.0 * 4.0); + + // Limiters, these need to be high precision RCPs. + float hitMinL = min(mn1L, e) / (4.0 * mx1L); + float hitMaxL = (peakC.x - max(mx1L, e)) / (4.0 * mn1L + peakC.y); + float lobeL = max(-hitMinL, hitMaxL); + float lobe = max(float(-FSR_RCAS_LIMIT), min(lobeL, 0.0)) * exp2(-clamp(float(SHARPNESS), 0.0, 2.0)); + + // Apply noise removal. +#if (FSR_RCAS_DENOISE == 1) + // Noise detection. + float nz = 0.25 * b + 0.25 * d + 0.25 * f + 0.25 * h - e; + nz = clamp(abs(nz) * APrxMedRcpF1(AMax3F1(AMax3F1(b, d, e), f, h) - AMin3F1(AMin3F1(b, d, e), f, h)), 0.0, 1.0); + nz = -0.5 * nz + 1.0; + lobe *= nz; +#endif + + // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes. + float rcpL = APrxMedRcpF1(4.0 * lobe + 1.0); + vec4 pix = vec4(0.0, 0.0, 0.0, 1.0); + pix.r = float((lobe * b + lobe * d + lobe * h + lobe * f + e) * rcpL); +#if (FSR_PQ == 1) + pix.r = FromGamma2(pix.r); +#endif + + return pix; +} \ No newline at end of file diff --git a/.config/mpv/shaders/ravu-r4.hook b/.config/mpv/shaders/ravu-r4.hook new file mode 100644 index 0000000..62a6d5f --- /dev/null +++ b/.config/mpv/shaders/ravu-r4.hook @@ -0,0 +1,757 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + +//!DESC RAVU (step1, luma, r4) +//!HOOK LUMA +//!BIND HOOKED +//!BIND ravu_lut4 +//!SAVE ravu_int11 +//!WHEN HOOKED.w OUTPUT.w / 0.707106 < HOOKED.h OUTPUT.h / 0.707106 < * +vec4 hook() { +float sample0 = HOOKED_texOff(vec2(-3.0, -3.0)).x; +float sample1 = HOOKED_texOff(vec2(-3.0, -2.0)).x; +float sample2 = HOOKED_texOff(vec2(-3.0, -1.0)).x; +float sample3 = HOOKED_texOff(vec2(-3.0, 0.0)).x; +float sample4 = HOOKED_texOff(vec2(-3.0, 1.0)).x; +float sample5 = HOOKED_texOff(vec2(-3.0, 2.0)).x; +float sample6 = HOOKED_texOff(vec2(-3.0, 3.0)).x; +float sample7 = HOOKED_texOff(vec2(-3.0, 4.0)).x; +float sample8 = HOOKED_texOff(vec2(-2.0, -3.0)).x; +float sample9 = HOOKED_texOff(vec2(-2.0, -2.0)).x; +float sample10 = HOOKED_texOff(vec2(-2.0, -1.0)).x; +float sample11 = HOOKED_texOff(vec2(-2.0, 0.0)).x; +float sample12 = HOOKED_texOff(vec2(-2.0, 1.0)).x; +float sample13 = HOOKED_texOff(vec2(-2.0, 2.0)).x; +float sample14 = HOOKED_texOff(vec2(-2.0, 3.0)).x; +float sample15 = HOOKED_texOff(vec2(-2.0, 4.0)).x; +float sample16 = HOOKED_texOff(vec2(-1.0, -3.0)).x; +float sample17 = HOOKED_texOff(vec2(-1.0, -2.0)).x; +float sample18 = HOOKED_texOff(vec2(-1.0, -1.0)).x; +float sample19 = HOOKED_texOff(vec2(-1.0, 0.0)).x; +float sample20 = HOOKED_texOff(vec2(-1.0, 1.0)).x; +float sample21 = HOOKED_texOff(vec2(-1.0, 2.0)).x; +float sample22 = HOOKED_texOff(vec2(-1.0, 3.0)).x; +float sample23 = HOOKED_texOff(vec2(-1.0, 4.0)).x; +float sample24 = HOOKED_texOff(vec2(0.0, -3.0)).x; +float sample25 = HOOKED_texOff(vec2(0.0, -2.0)).x; +float sample26 = HOOKED_texOff(vec2(0.0, -1.0)).x; +float sample27 = HOOKED_texOff(vec2(0.0, 0.0)).x; +float sample28 = HOOKED_texOff(vec2(0.0, 1.0)).x; +float sample29 = HOOKED_texOff(vec2(0.0, 2.0)).x; +float sample30 = HOOKED_texOff(vec2(0.0, 3.0)).x; +float sample31 = HOOKED_texOff(vec2(0.0, 4.0)).x; +float sample32 = HOOKED_texOff(vec2(1.0, -3.0)).x; +float sample33 = HOOKED_texOff(vec2(1.0, -2.0)).x; +float sample34 = HOOKED_texOff(vec2(1.0, -1.0)).x; +float sample35 = HOOKED_texOff(vec2(1.0, 0.0)).x; +float sample36 = HOOKED_texOff(vec2(1.0, 1.0)).x; +float sample37 = HOOKED_texOff(vec2(1.0, 2.0)).x; +float sample38 = HOOKED_texOff(vec2(1.0, 3.0)).x; +float sample39 = HOOKED_texOff(vec2(1.0, 4.0)).x; +float sample40 = HOOKED_texOff(vec2(2.0, -3.0)).x; +float sample41 = HOOKED_texOff(vec2(2.0, -2.0)).x; +float sample42 = HOOKED_texOff(vec2(2.0, -1.0)).x; +float sample43 = HOOKED_texOff(vec2(2.0, 0.0)).x; +float sample44 = HOOKED_texOff(vec2(2.0, 1.0)).x; +float sample45 = HOOKED_texOff(vec2(2.0, 2.0)).x; +float sample46 = HOOKED_texOff(vec2(2.0, 3.0)).x; +float sample47 = HOOKED_texOff(vec2(2.0, 4.0)).x; +float sample48 = HOOKED_texOff(vec2(3.0, -3.0)).x; +float sample49 = HOOKED_texOff(vec2(3.0, -2.0)).x; +float sample50 = HOOKED_texOff(vec2(3.0, -1.0)).x; +float sample51 = HOOKED_texOff(vec2(3.0, 0.0)).x; +float sample52 = HOOKED_texOff(vec2(3.0, 1.0)).x; +float sample53 = HOOKED_texOff(vec2(3.0, 2.0)).x; +float sample54 = HOOKED_texOff(vec2(3.0, 3.0)).x; +float sample55 = HOOKED_texOff(vec2(3.0, 4.0)).x; +float sample56 = HOOKED_texOff(vec2(4.0, -3.0)).x; +float sample57 = HOOKED_texOff(vec2(4.0, -2.0)).x; +float sample58 = HOOKED_texOff(vec2(4.0, -1.0)).x; +float sample59 = HOOKED_texOff(vec2(4.0, 0.0)).x; +float sample60 = HOOKED_texOff(vec2(4.0, 1.0)).x; +float sample61 = HOOKED_texOff(vec2(4.0, 2.0)).x; +float sample62 = HOOKED_texOff(vec2(4.0, 3.0)).x; +float sample63 = HOOKED_texOff(vec2(4.0, 4.0)).x; +vec3 abd = vec3(0.0); +float gx, gy; +gx = (sample17-sample1)/2.0; +gy = (sample10-sample8)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (sample18-sample2)/2.0; +gy = (-sample12+8.0*sample11-8.0*sample9+sample8)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample19-sample3)/2.0; +gy = (-sample13+8.0*sample12-8.0*sample10+sample9)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample20-sample4)/2.0; +gy = (-sample14+8.0*sample13-8.0*sample11+sample10)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample21-sample5)/2.0; +gy = (-sample15+8.0*sample14-8.0*sample12+sample11)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample22-sample6)/2.0; +gy = (sample15-sample13)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (-sample33+8.0*sample25-8.0*sample9+sample1)/12.0; +gy = (sample18-sample16)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample34+8.0*sample26-8.0*sample10+sample2)/12.0; +gy = (-sample20+8.0*sample19-8.0*sample17+sample16)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample35+8.0*sample27-8.0*sample11+sample3)/12.0; +gy = (-sample21+8.0*sample20-8.0*sample18+sample17)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample36+8.0*sample28-8.0*sample12+sample4)/12.0; +gy = (-sample22+8.0*sample21-8.0*sample19+sample18)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample37+8.0*sample29-8.0*sample13+sample5)/12.0; +gy = (-sample23+8.0*sample22-8.0*sample20+sample19)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample38+8.0*sample30-8.0*sample14+sample6)/12.0; +gy = (sample23-sample21)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample41+8.0*sample33-8.0*sample17+sample9)/12.0; +gy = (sample26-sample24)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample42+8.0*sample34-8.0*sample18+sample10)/12.0; +gy = (-sample28+8.0*sample27-8.0*sample25+sample24)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample43+8.0*sample35-8.0*sample19+sample11)/12.0; +gy = (-sample29+8.0*sample28-8.0*sample26+sample25)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample44+8.0*sample36-8.0*sample20+sample12)/12.0; +gy = (-sample30+8.0*sample29-8.0*sample27+sample26)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample45+8.0*sample37-8.0*sample21+sample13)/12.0; +gy = (-sample31+8.0*sample30-8.0*sample28+sample27)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample46+8.0*sample38-8.0*sample22+sample14)/12.0; +gy = (sample31-sample29)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample49+8.0*sample41-8.0*sample25+sample17)/12.0; +gy = (sample34-sample32)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample50+8.0*sample42-8.0*sample26+sample18)/12.0; +gy = (-sample36+8.0*sample35-8.0*sample33+sample32)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample51+8.0*sample43-8.0*sample27+sample19)/12.0; +gy = (-sample37+8.0*sample36-8.0*sample34+sample33)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample52+8.0*sample44-8.0*sample28+sample20)/12.0; +gy = (-sample38+8.0*sample37-8.0*sample35+sample34)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample53+8.0*sample45-8.0*sample29+sample21)/12.0; +gy = (-sample39+8.0*sample38-8.0*sample36+sample35)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample54+8.0*sample46-8.0*sample30+sample22)/12.0; +gy = (sample39-sample37)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample57+8.0*sample49-8.0*sample33+sample25)/12.0; +gy = (sample42-sample40)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample58+8.0*sample50-8.0*sample34+sample26)/12.0; +gy = (-sample44+8.0*sample43-8.0*sample41+sample40)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample59+8.0*sample51-8.0*sample35+sample27)/12.0; +gy = (-sample45+8.0*sample44-8.0*sample42+sample41)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample60+8.0*sample52-8.0*sample36+sample28)/12.0; +gy = (-sample46+8.0*sample45-8.0*sample43+sample42)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample61+8.0*sample53-8.0*sample37+sample29)/12.0; +gy = (-sample47+8.0*sample46-8.0*sample44+sample43)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample62+8.0*sample54-8.0*sample38+sample30)/12.0; +gy = (sample47-sample45)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample57-sample41)/2.0; +gy = (sample50-sample48)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (sample58-sample42)/2.0; +gy = (-sample52+8.0*sample51-8.0*sample49+sample48)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample59-sample43)/2.0; +gy = (-sample53+8.0*sample52-8.0*sample50+sample49)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample60-sample44)/2.0; +gy = (-sample54+8.0*sample53-8.0*sample51+sample50)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample61-sample45)/2.0; +gy = (-sample55+8.0*sample54-8.0*sample52+sample51)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample62-sample46)/2.0; +gy = (sample55-sample53)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +float a = abd.x, b = abd.y, d = abd.z; +float T = a + d, D = a * d - b * b; +float delta = sqrt(max(T * T / 4.0 - D, 0.0)); +float L1 = T / 2.0 + delta, L2 = T / 2.0 - delta; +float sqrtL1 = sqrt(L1), sqrtL2 = sqrt(L2); +float theta = mix(mod(atan(L1 - a, b) + 3.141592653589793, 3.141592653589793), 0.0, abs(b) < 1.192092896e-7); +float lambda = sqrtL1; +float mu = mix((sqrtL1 - sqrtL2) / (sqrtL1 + sqrtL2), 0.0, sqrtL1 + sqrtL2 < 1.192092896e-7); +float angle = floor(theta * 24.0 / 3.141592653589793); +float strength = clamp(floor(log2(lambda * 2000.0 + 1.192092896e-7)), 0.0, 8.0); +float coherence = mix(mix(0.0, 1.0, mu >= 0.25), 2.0, mu >= 0.5); +float coord_y = ((angle * 9.0 + strength) * 3.0 + coherence + 0.5) / 648.0; +float res = 0.0; +vec4 w; +w = texture(ravu_lut4, vec2(0.0625, coord_y)); +res += (sample0 + sample63) * w[0]; +res += (sample1 + sample62) * w[1]; +res += (sample2 + sample61) * w[2]; +res += (sample3 + sample60) * w[3]; +w = texture(ravu_lut4, vec2(0.1875, coord_y)); +res += (sample4 + sample59) * w[0]; +res += (sample5 + sample58) * w[1]; +res += (sample6 + sample57) * w[2]; +res += (sample7 + sample56) * w[3]; +w = texture(ravu_lut4, vec2(0.3125, coord_y)); +res += (sample8 + sample55) * w[0]; +res += (sample9 + sample54) * w[1]; +res += (sample10 + sample53) * w[2]; +res += (sample11 + sample52) * w[3]; +w = texture(ravu_lut4, vec2(0.4375, coord_y)); +res += (sample12 + sample51) * w[0]; +res += (sample13 + sample50) * w[1]; +res += (sample14 + sample49) * w[2]; +res += (sample15 + sample48) * w[3]; +w = texture(ravu_lut4, vec2(0.5625, coord_y)); +res += (sample16 + sample47) * w[0]; +res += (sample17 + sample46) * w[1]; +res += (sample18 + sample45) * w[2]; +res += (sample19 + sample44) * w[3]; +w = texture(ravu_lut4, vec2(0.6875, coord_y)); +res += (sample20 + sample43) * w[0]; +res += (sample21 + sample42) * w[1]; +res += (sample22 + sample41) * w[2]; +res += (sample23 + sample40) * w[3]; +w = texture(ravu_lut4, vec2(0.8125, coord_y)); +res += (sample24 + sample39) * w[0]; +res += (sample25 + sample38) * w[1]; +res += (sample26 + sample37) * w[2]; +res += (sample27 + sample36) * w[3]; +w = texture(ravu_lut4, vec2(0.9375, coord_y)); +res += (sample28 + sample35) * w[0]; +res += (sample29 + sample34) * w[1]; +res += (sample30 + sample33) * w[2]; +res += (sample31 + sample32) * w[3]; +res = clamp(res, 0.0, 1.0); +return vec4(res, 0.0, 0.0, 0.0); +} +//!DESC RAVU (step2, luma, r4) +//!HOOK LUMA +//!BIND HOOKED +//!BIND ravu_lut4 +//!BIND ravu_int11 +//!SAVE ravu_int10 +//!WHEN HOOKED.w OUTPUT.w / 0.707106 < HOOKED.h OUTPUT.h / 0.707106 < * +vec4 hook() { +float sample0 = HOOKED_texOff(vec2(-3.0, 0.0)).x; +float sample16 = HOOKED_texOff(vec2(-2.0, -1.0)).x; +float sample9 = HOOKED_texOff(vec2(-2.0, 0.0)).x; +float sample2 = HOOKED_texOff(vec2(-2.0, 1.0)).x; +float sample32 = HOOKED_texOff(vec2(-1.0, -2.0)).x; +float sample25 = HOOKED_texOff(vec2(-1.0, -1.0)).x; +float sample18 = HOOKED_texOff(vec2(-1.0, 0.0)).x; +float sample11 = HOOKED_texOff(vec2(-1.0, 1.0)).x; +float sample4 = HOOKED_texOff(vec2(-1.0, 2.0)).x; +float sample48 = HOOKED_texOff(vec2(0.0, -3.0)).x; +float sample41 = HOOKED_texOff(vec2(0.0, -2.0)).x; +float sample34 = HOOKED_texOff(vec2(0.0, -1.0)).x; +float sample27 = HOOKED_texOff(vec2(0.0, 0.0)).x; +float sample20 = HOOKED_texOff(vec2(0.0, 1.0)).x; +float sample13 = HOOKED_texOff(vec2(0.0, 2.0)).x; +float sample6 = HOOKED_texOff(vec2(0.0, 3.0)).x; +float sample57 = HOOKED_texOff(vec2(1.0, -3.0)).x; +float sample50 = HOOKED_texOff(vec2(1.0, -2.0)).x; +float sample43 = HOOKED_texOff(vec2(1.0, -1.0)).x; +float sample36 = HOOKED_texOff(vec2(1.0, 0.0)).x; +float sample29 = HOOKED_texOff(vec2(1.0, 1.0)).x; +float sample22 = HOOKED_texOff(vec2(1.0, 2.0)).x; +float sample15 = HOOKED_texOff(vec2(1.0, 3.0)).x; +float sample59 = HOOKED_texOff(vec2(2.0, -2.0)).x; +float sample52 = HOOKED_texOff(vec2(2.0, -1.0)).x; +float sample45 = HOOKED_texOff(vec2(2.0, 0.0)).x; +float sample38 = HOOKED_texOff(vec2(2.0, 1.0)).x; +float sample31 = HOOKED_texOff(vec2(2.0, 2.0)).x; +float sample61 = HOOKED_texOff(vec2(3.0, -1.0)).x; +float sample54 = HOOKED_texOff(vec2(3.0, 0.0)).x; +float sample47 = HOOKED_texOff(vec2(3.0, 1.0)).x; +float sample63 = HOOKED_texOff(vec2(4.0, 0.0)).x; +float sample8 = ravu_int11_texOff(vec2(-3.0, -1.0)).x; +float sample1 = ravu_int11_texOff(vec2(-3.0, 0.0)).x; +float sample24 = ravu_int11_texOff(vec2(-2.0, -2.0)).x; +float sample17 = ravu_int11_texOff(vec2(-2.0, -1.0)).x; +float sample10 = ravu_int11_texOff(vec2(-2.0, 0.0)).x; +float sample3 = ravu_int11_texOff(vec2(-2.0, 1.0)).x; +float sample40 = ravu_int11_texOff(vec2(-1.0, -3.0)).x; +float sample33 = ravu_int11_texOff(vec2(-1.0, -2.0)).x; +float sample26 = ravu_int11_texOff(vec2(-1.0, -1.0)).x; +float sample19 = ravu_int11_texOff(vec2(-1.0, 0.0)).x; +float sample12 = ravu_int11_texOff(vec2(-1.0, 1.0)).x; +float sample5 = ravu_int11_texOff(vec2(-1.0, 2.0)).x; +float sample56 = ravu_int11_texOff(vec2(0.0, -4.0)).x; +float sample49 = ravu_int11_texOff(vec2(0.0, -3.0)).x; +float sample42 = ravu_int11_texOff(vec2(0.0, -2.0)).x; +float sample35 = ravu_int11_texOff(vec2(0.0, -1.0)).x; +float sample28 = ravu_int11_texOff(vec2(0.0, 0.0)).x; +float sample21 = ravu_int11_texOff(vec2(0.0, 1.0)).x; +float sample14 = ravu_int11_texOff(vec2(0.0, 2.0)).x; +float sample7 = ravu_int11_texOff(vec2(0.0, 3.0)).x; +float sample58 = ravu_int11_texOff(vec2(1.0, -3.0)).x; +float sample51 = ravu_int11_texOff(vec2(1.0, -2.0)).x; +float sample44 = ravu_int11_texOff(vec2(1.0, -1.0)).x; +float sample37 = ravu_int11_texOff(vec2(1.0, 0.0)).x; +float sample30 = ravu_int11_texOff(vec2(1.0, 1.0)).x; +float sample23 = ravu_int11_texOff(vec2(1.0, 2.0)).x; +float sample60 = ravu_int11_texOff(vec2(2.0, -2.0)).x; +float sample53 = ravu_int11_texOff(vec2(2.0, -1.0)).x; +float sample46 = ravu_int11_texOff(vec2(2.0, 0.0)).x; +float sample39 = ravu_int11_texOff(vec2(2.0, 1.0)).x; +float sample62 = ravu_int11_texOff(vec2(3.0, -1.0)).x; +float sample55 = ravu_int11_texOff(vec2(3.0, 0.0)).x; +vec3 abd = vec3(0.0); +float gx, gy; +gx = (sample17-sample1)/2.0; +gy = (sample10-sample8)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (sample18-sample2)/2.0; +gy = (-sample12+8.0*sample11-8.0*sample9+sample8)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample19-sample3)/2.0; +gy = (-sample13+8.0*sample12-8.0*sample10+sample9)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample20-sample4)/2.0; +gy = (-sample14+8.0*sample13-8.0*sample11+sample10)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample21-sample5)/2.0; +gy = (-sample15+8.0*sample14-8.0*sample12+sample11)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample22-sample6)/2.0; +gy = (sample15-sample13)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (-sample33+8.0*sample25-8.0*sample9+sample1)/12.0; +gy = (sample18-sample16)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample34+8.0*sample26-8.0*sample10+sample2)/12.0; +gy = (-sample20+8.0*sample19-8.0*sample17+sample16)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample35+8.0*sample27-8.0*sample11+sample3)/12.0; +gy = (-sample21+8.0*sample20-8.0*sample18+sample17)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample36+8.0*sample28-8.0*sample12+sample4)/12.0; +gy = (-sample22+8.0*sample21-8.0*sample19+sample18)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample37+8.0*sample29-8.0*sample13+sample5)/12.0; +gy = (-sample23+8.0*sample22-8.0*sample20+sample19)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample38+8.0*sample30-8.0*sample14+sample6)/12.0; +gy = (sample23-sample21)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample41+8.0*sample33-8.0*sample17+sample9)/12.0; +gy = (sample26-sample24)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample42+8.0*sample34-8.0*sample18+sample10)/12.0; +gy = (-sample28+8.0*sample27-8.0*sample25+sample24)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample43+8.0*sample35-8.0*sample19+sample11)/12.0; +gy = (-sample29+8.0*sample28-8.0*sample26+sample25)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample44+8.0*sample36-8.0*sample20+sample12)/12.0; +gy = (-sample30+8.0*sample29-8.0*sample27+sample26)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample45+8.0*sample37-8.0*sample21+sample13)/12.0; +gy = (-sample31+8.0*sample30-8.0*sample28+sample27)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample46+8.0*sample38-8.0*sample22+sample14)/12.0; +gy = (sample31-sample29)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample49+8.0*sample41-8.0*sample25+sample17)/12.0; +gy = (sample34-sample32)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample50+8.0*sample42-8.0*sample26+sample18)/12.0; +gy = (-sample36+8.0*sample35-8.0*sample33+sample32)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample51+8.0*sample43-8.0*sample27+sample19)/12.0; +gy = (-sample37+8.0*sample36-8.0*sample34+sample33)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample52+8.0*sample44-8.0*sample28+sample20)/12.0; +gy = (-sample38+8.0*sample37-8.0*sample35+sample34)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample53+8.0*sample45-8.0*sample29+sample21)/12.0; +gy = (-sample39+8.0*sample38-8.0*sample36+sample35)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample54+8.0*sample46-8.0*sample30+sample22)/12.0; +gy = (sample39-sample37)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample57+8.0*sample49-8.0*sample33+sample25)/12.0; +gy = (sample42-sample40)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample58+8.0*sample50-8.0*sample34+sample26)/12.0; +gy = (-sample44+8.0*sample43-8.0*sample41+sample40)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample59+8.0*sample51-8.0*sample35+sample27)/12.0; +gy = (-sample45+8.0*sample44-8.0*sample42+sample41)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample60+8.0*sample52-8.0*sample36+sample28)/12.0; +gy = (-sample46+8.0*sample45-8.0*sample43+sample42)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample61+8.0*sample53-8.0*sample37+sample29)/12.0; +gy = (-sample47+8.0*sample46-8.0*sample44+sample43)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample62+8.0*sample54-8.0*sample38+sample30)/12.0; +gy = (sample47-sample45)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample57-sample41)/2.0; +gy = (sample50-sample48)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (sample58-sample42)/2.0; +gy = (-sample52+8.0*sample51-8.0*sample49+sample48)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample59-sample43)/2.0; +gy = (-sample53+8.0*sample52-8.0*sample50+sample49)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample60-sample44)/2.0; +gy = (-sample54+8.0*sample53-8.0*sample51+sample50)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample61-sample45)/2.0; +gy = (-sample55+8.0*sample54-8.0*sample52+sample51)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample62-sample46)/2.0; +gy = (sample55-sample53)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +float a = abd.x, b = abd.y, d = abd.z; +float T = a + d, D = a * d - b * b; +float delta = sqrt(max(T * T / 4.0 - D, 0.0)); +float L1 = T / 2.0 + delta, L2 = T / 2.0 - delta; +float sqrtL1 = sqrt(L1), sqrtL2 = sqrt(L2); +float theta = mix(mod(atan(L1 - a, b) + 3.141592653589793, 3.141592653589793), 0.0, abs(b) < 1.192092896e-7); +float lambda = sqrtL1; +float mu = mix((sqrtL1 - sqrtL2) / (sqrtL1 + sqrtL2), 0.0, sqrtL1 + sqrtL2 < 1.192092896e-7); +float angle = floor(theta * 24.0 / 3.141592653589793); +float strength = clamp(floor(log2(lambda * 2000.0 + 1.192092896e-7)), 0.0, 8.0); +float coherence = mix(mix(0.0, 1.0, mu >= 0.25), 2.0, mu >= 0.5); +float coord_y = ((angle * 9.0 + strength) * 3.0 + coherence + 0.5) / 648.0; +float res = 0.0; +vec4 w; +w = texture(ravu_lut4, vec2(0.0625, coord_y)); +res += (sample0 + sample63) * w[0]; +res += (sample1 + sample62) * w[1]; +res += (sample2 + sample61) * w[2]; +res += (sample3 + sample60) * w[3]; +w = texture(ravu_lut4, vec2(0.1875, coord_y)); +res += (sample4 + sample59) * w[0]; +res += (sample5 + sample58) * w[1]; +res += (sample6 + sample57) * w[2]; +res += (sample7 + sample56) * w[3]; +w = texture(ravu_lut4, vec2(0.3125, coord_y)); +res += (sample8 + sample55) * w[0]; +res += (sample9 + sample54) * w[1]; +res += (sample10 + sample53) * w[2]; +res += (sample11 + sample52) * w[3]; +w = texture(ravu_lut4, vec2(0.4375, coord_y)); +res += (sample12 + sample51) * w[0]; +res += (sample13 + sample50) * w[1]; +res += (sample14 + sample49) * w[2]; +res += (sample15 + sample48) * w[3]; +w = texture(ravu_lut4, vec2(0.5625, coord_y)); +res += (sample16 + sample47) * w[0]; +res += (sample17 + sample46) * w[1]; +res += (sample18 + sample45) * w[2]; +res += (sample19 + sample44) * w[3]; +w = texture(ravu_lut4, vec2(0.6875, coord_y)); +res += (sample20 + sample43) * w[0]; +res += (sample21 + sample42) * w[1]; +res += (sample22 + sample41) * w[2]; +res += (sample23 + sample40) * w[3]; +w = texture(ravu_lut4, vec2(0.8125, coord_y)); +res += (sample24 + sample39) * w[0]; +res += (sample25 + sample38) * w[1]; +res += (sample26 + sample37) * w[2]; +res += (sample27 + sample36) * w[3]; +w = texture(ravu_lut4, vec2(0.9375, coord_y)); +res += (sample28 + sample35) * w[0]; +res += (sample29 + sample34) * w[1]; +res += (sample30 + sample33) * w[2]; +res += (sample31 + sample32) * w[3]; +res = clamp(res, 0.0, 1.0); +return vec4(res, 0.0, 0.0, 0.0); +} +//!DESC RAVU (step3, luma, r4) +//!HOOK LUMA +//!BIND HOOKED +//!BIND ravu_lut4 +//!BIND ravu_int11 +//!SAVE ravu_int01 +//!WHEN HOOKED.w OUTPUT.w / 0.707106 < HOOKED.h OUTPUT.h / 0.707106 < * +vec4 hook() { +float sample8 = HOOKED_texOff(vec2(-3.0, 0.0)).x; +float sample1 = HOOKED_texOff(vec2(-3.0, 1.0)).x; +float sample24 = HOOKED_texOff(vec2(-2.0, -1.0)).x; +float sample17 = HOOKED_texOff(vec2(-2.0, 0.0)).x; +float sample10 = HOOKED_texOff(vec2(-2.0, 1.0)).x; +float sample3 = HOOKED_texOff(vec2(-2.0, 2.0)).x; +float sample40 = HOOKED_texOff(vec2(-1.0, -2.0)).x; +float sample33 = HOOKED_texOff(vec2(-1.0, -1.0)).x; +float sample26 = HOOKED_texOff(vec2(-1.0, 0.0)).x; +float sample19 = HOOKED_texOff(vec2(-1.0, 1.0)).x; +float sample12 = HOOKED_texOff(vec2(-1.0, 2.0)).x; +float sample5 = HOOKED_texOff(vec2(-1.0, 3.0)).x; +float sample56 = HOOKED_texOff(vec2(0.0, -3.0)).x; +float sample49 = HOOKED_texOff(vec2(0.0, -2.0)).x; +float sample42 = HOOKED_texOff(vec2(0.0, -1.0)).x; +float sample35 = HOOKED_texOff(vec2(0.0, 0.0)).x; +float sample28 = HOOKED_texOff(vec2(0.0, 1.0)).x; +float sample21 = HOOKED_texOff(vec2(0.0, 2.0)).x; +float sample14 = HOOKED_texOff(vec2(0.0, 3.0)).x; +float sample7 = HOOKED_texOff(vec2(0.0, 4.0)).x; +float sample58 = HOOKED_texOff(vec2(1.0, -2.0)).x; +float sample51 = HOOKED_texOff(vec2(1.0, -1.0)).x; +float sample44 = HOOKED_texOff(vec2(1.0, 0.0)).x; +float sample37 = HOOKED_texOff(vec2(1.0, 1.0)).x; +float sample30 = HOOKED_texOff(vec2(1.0, 2.0)).x; +float sample23 = HOOKED_texOff(vec2(1.0, 3.0)).x; +float sample60 = HOOKED_texOff(vec2(2.0, -1.0)).x; +float sample53 = HOOKED_texOff(vec2(2.0, 0.0)).x; +float sample46 = HOOKED_texOff(vec2(2.0, 1.0)).x; +float sample39 = HOOKED_texOff(vec2(2.0, 2.0)).x; +float sample62 = HOOKED_texOff(vec2(3.0, 0.0)).x; +float sample55 = HOOKED_texOff(vec2(3.0, 1.0)).x; +float sample0 = ravu_int11_texOff(vec2(-4.0, 0.0)).x; +float sample16 = ravu_int11_texOff(vec2(-3.0, -1.0)).x; +float sample9 = ravu_int11_texOff(vec2(-3.0, 0.0)).x; +float sample2 = ravu_int11_texOff(vec2(-3.0, 1.0)).x; +float sample32 = ravu_int11_texOff(vec2(-2.0, -2.0)).x; +float sample25 = ravu_int11_texOff(vec2(-2.0, -1.0)).x; +float sample18 = ravu_int11_texOff(vec2(-2.0, 0.0)).x; +float sample11 = ravu_int11_texOff(vec2(-2.0, 1.0)).x; +float sample4 = ravu_int11_texOff(vec2(-2.0, 2.0)).x; +float sample48 = ravu_int11_texOff(vec2(-1.0, -3.0)).x; +float sample41 = ravu_int11_texOff(vec2(-1.0, -2.0)).x; +float sample34 = ravu_int11_texOff(vec2(-1.0, -1.0)).x; +float sample27 = ravu_int11_texOff(vec2(-1.0, 0.0)).x; +float sample20 = ravu_int11_texOff(vec2(-1.0, 1.0)).x; +float sample13 = ravu_int11_texOff(vec2(-1.0, 2.0)).x; +float sample6 = ravu_int11_texOff(vec2(-1.0, 3.0)).x; +float sample57 = ravu_int11_texOff(vec2(0.0, -3.0)).x; +float sample50 = ravu_int11_texOff(vec2(0.0, -2.0)).x; +float sample43 = ravu_int11_texOff(vec2(0.0, -1.0)).x; +float sample36 = ravu_int11_texOff(vec2(0.0, 0.0)).x; +float sample29 = ravu_int11_texOff(vec2(0.0, 1.0)).x; +float sample22 = ravu_int11_texOff(vec2(0.0, 2.0)).x; +float sample15 = ravu_int11_texOff(vec2(0.0, 3.0)).x; +float sample59 = ravu_int11_texOff(vec2(1.0, -2.0)).x; +float sample52 = ravu_int11_texOff(vec2(1.0, -1.0)).x; +float sample45 = ravu_int11_texOff(vec2(1.0, 0.0)).x; +float sample38 = ravu_int11_texOff(vec2(1.0, 1.0)).x; +float sample31 = ravu_int11_texOff(vec2(1.0, 2.0)).x; +float sample61 = ravu_int11_texOff(vec2(2.0, -1.0)).x; +float sample54 = ravu_int11_texOff(vec2(2.0, 0.0)).x; +float sample47 = ravu_int11_texOff(vec2(2.0, 1.0)).x; +float sample63 = ravu_int11_texOff(vec2(3.0, 0.0)).x; +vec3 abd = vec3(0.0); +float gx, gy; +gx = (sample17-sample1)/2.0; +gy = (sample10-sample8)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (sample18-sample2)/2.0; +gy = (-sample12+8.0*sample11-8.0*sample9+sample8)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample19-sample3)/2.0; +gy = (-sample13+8.0*sample12-8.0*sample10+sample9)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample20-sample4)/2.0; +gy = (-sample14+8.0*sample13-8.0*sample11+sample10)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample21-sample5)/2.0; +gy = (-sample15+8.0*sample14-8.0*sample12+sample11)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample22-sample6)/2.0; +gy = (sample15-sample13)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (-sample33+8.0*sample25-8.0*sample9+sample1)/12.0; +gy = (sample18-sample16)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample34+8.0*sample26-8.0*sample10+sample2)/12.0; +gy = (-sample20+8.0*sample19-8.0*sample17+sample16)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample35+8.0*sample27-8.0*sample11+sample3)/12.0; +gy = (-sample21+8.0*sample20-8.0*sample18+sample17)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample36+8.0*sample28-8.0*sample12+sample4)/12.0; +gy = (-sample22+8.0*sample21-8.0*sample19+sample18)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample37+8.0*sample29-8.0*sample13+sample5)/12.0; +gy = (-sample23+8.0*sample22-8.0*sample20+sample19)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample38+8.0*sample30-8.0*sample14+sample6)/12.0; +gy = (sample23-sample21)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample41+8.0*sample33-8.0*sample17+sample9)/12.0; +gy = (sample26-sample24)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample42+8.0*sample34-8.0*sample18+sample10)/12.0; +gy = (-sample28+8.0*sample27-8.0*sample25+sample24)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample43+8.0*sample35-8.0*sample19+sample11)/12.0; +gy = (-sample29+8.0*sample28-8.0*sample26+sample25)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample44+8.0*sample36-8.0*sample20+sample12)/12.0; +gy = (-sample30+8.0*sample29-8.0*sample27+sample26)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample45+8.0*sample37-8.0*sample21+sample13)/12.0; +gy = (-sample31+8.0*sample30-8.0*sample28+sample27)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample46+8.0*sample38-8.0*sample22+sample14)/12.0; +gy = (sample31-sample29)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample49+8.0*sample41-8.0*sample25+sample17)/12.0; +gy = (sample34-sample32)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample50+8.0*sample42-8.0*sample26+sample18)/12.0; +gy = (-sample36+8.0*sample35-8.0*sample33+sample32)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample51+8.0*sample43-8.0*sample27+sample19)/12.0; +gy = (-sample37+8.0*sample36-8.0*sample34+sample33)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample52+8.0*sample44-8.0*sample28+sample20)/12.0; +gy = (-sample38+8.0*sample37-8.0*sample35+sample34)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.04933151482066013; +gx = (-sample53+8.0*sample45-8.0*sample29+sample21)/12.0; +gy = (-sample39+8.0*sample38-8.0*sample36+sample35)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample54+8.0*sample46-8.0*sample30+sample22)/12.0; +gy = (sample39-sample37)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (-sample57+8.0*sample49-8.0*sample33+sample25)/12.0; +gy = (sample42-sample40)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (-sample58+8.0*sample50-8.0*sample34+sample26)/12.0; +gy = (-sample44+8.0*sample43-8.0*sample41+sample40)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample59+8.0*sample51-8.0*sample35+sample27)/12.0; +gy = (-sample45+8.0*sample44-8.0*sample42+sample41)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample60+8.0*sample52-8.0*sample36+sample28)/12.0; +gy = (-sample46+8.0*sample45-8.0*sample43+sample42)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.03841942237242872; +gx = (-sample61+8.0*sample53-8.0*sample37+sample29)/12.0; +gy = (-sample47+8.0*sample46-8.0*sample44+sample43)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.02992107622879854; +gx = (-sample62+8.0*sample54-8.0*sample38+sample30)/12.0; +gy = (sample47-sample45)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample57-sample41)/2.0; +gy = (sample50-sample48)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +gx = (sample58-sample42)/2.0; +gy = (-sample52+8.0*sample51-8.0*sample49+sample48)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample59-sample43)/2.0; +gy = (-sample53+8.0*sample52-8.0*sample50+sample49)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample60-sample44)/2.0; +gy = (-sample54+8.0*sample53-8.0*sample51+sample50)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.0233025575973275; +gx = (sample61-sample45)/2.0; +gy = (-sample55+8.0*sample54-8.0*sample52+sample51)/12.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.018148050104365175; +gx = (sample62-sample46)/2.0; +gy = (sample55-sample53)/2.0; +abd += vec3(gx * gx, gx * gy, gy * gy) * 0.011007348802298533; +float a = abd.x, b = abd.y, d = abd.z; +float T = a + d, D = a * d - b * b; +float delta = sqrt(max(T * T / 4.0 - D, 0.0)); +float L1 = T / 2.0 + delta, L2 = T / 2.0 - delta; +float sqrtL1 = sqrt(L1), sqrtL2 = sqrt(L2); +float theta = mix(mod(atan(L1 - a, b) + 3.141592653589793, 3.141592653589793), 0.0, abs(b) < 1.192092896e-7); +float lambda = sqrtL1; +float mu = mix((sqrtL1 - sqrtL2) / (sqrtL1 + sqrtL2), 0.0, sqrtL1 + sqrtL2 < 1.192092896e-7); +float angle = floor(theta * 24.0 / 3.141592653589793); +float strength = clamp(floor(log2(lambda * 2000.0 + 1.192092896e-7)), 0.0, 8.0); +float coherence = mix(mix(0.0, 1.0, mu >= 0.25), 2.0, mu >= 0.5); +float coord_y = ((angle * 9.0 + strength) * 3.0 + coherence + 0.5) / 648.0; +float res = 0.0; +vec4 w; +w = texture(ravu_lut4, vec2(0.0625, coord_y)); +res += (sample0 + sample63) * w[0]; +res += (sample1 + sample62) * w[1]; +res += (sample2 + sample61) * w[2]; +res += (sample3 + sample60) * w[3]; +w = texture(ravu_lut4, vec2(0.1875, coord_y)); +res += (sample4 + sample59) * w[0]; +res += (sample5 + sample58) * w[1]; +res += (sample6 + sample57) * w[2]; +res += (sample7 + sample56) * w[3]; +w = texture(ravu_lut4, vec2(0.3125, coord_y)); +res += (sample8 + sample55) * w[0]; +res += (sample9 + sample54) * w[1]; +res += (sample10 + sample53) * w[2]; +res += (sample11 + sample52) * w[3]; +w = texture(ravu_lut4, vec2(0.4375, coord_y)); +res += (sample12 + sample51) * w[0]; +res += (sample13 + sample50) * w[1]; +res += (sample14 + sample49) * w[2]; +res += (sample15 + sample48) * w[3]; +w = texture(ravu_lut4, vec2(0.5625, coord_y)); +res += (sample16 + sample47) * w[0]; +res += (sample17 + sample46) * w[1]; +res += (sample18 + sample45) * w[2]; +res += (sample19 + sample44) * w[3]; +w = texture(ravu_lut4, vec2(0.6875, coord_y)); +res += (sample20 + sample43) * w[0]; +res += (sample21 + sample42) * w[1]; +res += (sample22 + sample41) * w[2]; +res += (sample23 + sample40) * w[3]; +w = texture(ravu_lut4, vec2(0.8125, coord_y)); +res += (sample24 + sample39) * w[0]; +res += (sample25 + sample38) * w[1]; +res += (sample26 + sample37) * w[2]; +res += (sample27 + sample36) * w[3]; +w = texture(ravu_lut4, vec2(0.9375, coord_y)); +res += (sample28 + sample35) * w[0]; +res += (sample29 + sample34) * w[1]; +res += (sample30 + sample33) * w[2]; +res += (sample31 + sample32) * w[3]; +res = clamp(res, 0.0, 1.0); +return vec4(res, 0.0, 0.0, 0.0); +} +//!DESC RAVU (step4, luma, r4) +//!HOOK LUMA +//!BIND HOOKED +//!BIND ravu_int01 +//!BIND ravu_int10 +//!BIND ravu_int11 +//!WIDTH 2 HOOKED.w * +//!HEIGHT 2 HOOKED.h * +//!OFFSET -0.500000 -0.500000 +//!WHEN HOOKED.w OUTPUT.w / 0.707106 < HOOKED.h OUTPUT.h / 0.707106 < * +vec4 hook() { + vec2 dir = fract(HOOKED_pos * HOOKED_size) - 0.5; + if (dir.x < 0.0) { + if (dir.y < 0.0) + return HOOKED_texOff(-dir); + return ravu_int01_texOff(-dir); + } else { + if (dir.y < 0.0) + return ravu_int10_texOff(-dir); + return ravu_int11_texOff(-dir); + } +} +//!TEXTURE ravu_lut4 +//!SIZE 8 648 +//!FORMAT rgba16f +//!FILTER NEAREST +5a208039bd0191ba378758ba8133533a650f3f3af7ea66baefad8fba2eef8d39e21bbdbac109dc3bdb8f85bbdac6dd3aa917e93a864d88bb72dfdd3be610daba96dc6fba39d8d1bbf233283c5867ec3b62eac23bdf8c243c8dc0e3bbe8be43baf97e5d3a3304773b0c88833c6dec563e9275623e071ca53cd46e983bf401a73a45544639986f13ba5b7901bb09d0323b83f5073b23d4daba7112a4b9dbf13c39904bddba2680cd3bd8c7bbbba062e73b62fbac3be7fb10bcb45ca13b1374afbad1498bbbcef635bce4c9063c0f28d93ce259d33c0fb7a33b0ef589bcf04202bc3f38953bec62003c7be27e3c8aa3123e69293b3ec717793d96bc1d3d8a49723cc0054738729ba1380b358f39fa854a3bf610373bc29c8db9c14aa2b9aa15d6371814a738b1a57dbb21b981bb5c19f83c2a64cd3cb95c8cbc3b34adbc55b728bad213f9ba6ae95bbde8cd90bb1e92a23d22bdab3d2a284fbc01ad1fbd065a4abbdb0495ba5cb2cfbc100ba3bc2c7fba3df96ef63d89b3cb3d37a51f3e85db883cb615d93889b455baa2895e394aad0fba1c7341ba70e19339859f57ba6d19c9388b8ea3baf50e453b6f0d06bbba40683b5879803b296418bb56ba4c3bc8deb0baea5152b9e8784bbbd5cef33b7622a5bcb99eabbcc948f43b129648bb853d9eb837aafb390ddf593b5ac25abced1b8a3e698d8d3e714b50bc374c6f3b46f92a3ae2d31e3988cf17ba6e2952ba4b30e5384fdde438c01e6cbac63721ba589c2939451c0cbb781eb13bf20481bbc28be33a87eedf3a1f40a5bbe734b03bf2f529bbf44885bb7aa42abc0db8c13b694f223bb278163b3fe6ae3b095643bc17e086bb60e0f13a1b2fc93ba62dbc3c5ce1563e7efb673e1a21073d67ec403c77db8a3bfffe2039df1408bacaafa0ba6e74933a69423a3a6e2cd7ba44d54aba9a2b263978d11dbb33fa2a3b381afcbb9def153cd26a263c0595febbadb3543aa9df5bbb2b88d3bbe16450bc9e67a13b0051ed3c9648f53c9382983b45ad7bbc091008bc1bc0b43bb7ac183c4955bb3ce4f6193e511a253eb1d14b3d5b614c3dd340d43cf14f2139010322ba8d32083a3954b2ba3c0299ba867a2f38cf84f5b92a5ee438d4675cbae8434b3b423730bb35d4e03bf173e23bf1c006bb61dd443b8a7321bafffea4ba879b74bb2a55813bcd4216bd117b19bd3efa283b0a704fbb8a5f19bb9438abb9f568ef3bd62f06bdd7489c3e6e249f3e4f8e02bdb4e6f63b4a86a93a618a10392db0edb9e54dde3966d75aba61ef8bb9f42dd8b9fb89e1b881466c387164c3b926d03f3bc7bb81ba9133623b8d8cb03b19b104bb152d943b07c065ba7fb493bb3bb8fbbbba1c313ba38ee1bcaebaeabc596b99ba0cbd06bc196bccbb4d86003b03c67e3b627d15bc9a298c3efb5a943e6ab03bbbed5d003cd345b53b90bee438dc5814b949948bb99a92a939349e173a3584fdb97ea08037161bcc38380b1cbafd4b2e3b2ea139bb4a921d3b4d077b3b7487a0bb3dc55c3b40b79fba29c0febbfe6b4bbc744879bba4c130ba5151a7bad8630bbc6eae84bc8a493bbcb3f4f03a55ba7a3b903cdd3ce9f95c3ec4a96e3e16d3373dce12983c39d6673cc3a83639aed9cab9a7a52db9099efaba5aa3b2bac39478ba99c07eb9c592d33750b77fbafbcf993b007106bb8f02343c8bdc303c56fec1b9b871923bb393bdb95d617bbadc6c0dbb81b45bb9be0e4ebdf4bb51bd52f453bb49fa05bbf0e717bbf95f32bb21b84e3cd0834bbd9f8ba83e52d3ab3e850b45bd3c94673c14ae7aba18c544394d7f12bafd26ea39430f4cba298348baa8c4a6b97e24fbb90ce04439f105053908073f3bf5aeabba7958a73bc02fd83b76908f39aa1d9a3b7bf5e93a70ac05bbad58babbf181953a598915bdcdaa21bd97f1bcbb6bad1dbc212621bc537f5dbbafed803bc219f2bc3bba993ec212a23e467eb0bc5eb16a3ca2e6143cac5bcd388c242cb91e298b376f11c5b9cb4ee5b97e17c5b9d16e8ab816c62f39568df038f53ecb3a17d9b2b9ff85753b4081be3b7cb7bdb95b72a03b6559203bd28ec2bb48dff1bbafa069bb0cd2abbc4ed7bfbcc3dd39bc2eff80bced0093bc58dd12bbd3458db8e5a78aba51e9843e0c578f3e1692833caa368d3ca0a2a43c3c7c013734001cb918c03939d3c85bbb55d675bb96c5b5b940d14db9a2a068b99d08c5ba8a56723b131243ba9277663c596d793cf5400e3a093e933b8d3986ba28e1c8392981813a3e41f03a1f0873bda90c7ebd9960d6ba6c608f39e33f95baaadcd0bbcfab8f3c8c927fbd0031ae3ec175b23e06b772bd76b79e3c449280bb7e0ba63992b547ba9c95253aca5484badbcdcbba059e39b96580afba7f86d139f1f9a2b981e8013bcf8595bab884de3be9ae093cb40e323badacbf3b25b72b3bee3e083aa45ac7ba633fd73a26982cbde9c946bd65de14bc5d4f41bc14782fbc0fbaefbbb484683be06549bdacc1a13ee1f3ab3ee51408bd6497ae3ca4c9383cb7fa4b385f7882b8bebad6375d2525b918764eba64f21dba55098bb99150763977bf31b9a7bbf5ba069ac2ba2309ec398c8cbe3be72159b83a58063cbc740e3cd6e76e3bd5da4e3b352b333b5d94a1bcb734dfbc374e5cbcef7eb9bce61617bde31ecfbc9bda69bc9bd9d3bc2d9c8b3e5e949a3e6ef1e13a06a1093d5735443df6422abaf2e97abaeec3713b7c6cd0bbc1a9c3bbd000403b24d4debaa49cfeb939997ebb05d37bba7468cc3aeab3443c609e523ca7374a3b45475a3a266782bbe141283c51b2aab9228e873c781182bd990889bdd2893d3c2c4c5ab87eb2fa3bd4e55bbc59f6883c694586bd22fbac3e3572b33e6b3c7dbdd84b903cbd2b15bc736ce1391c19daba8b60243b810d0fbbb74d17bb22f33e3ab1c01dbb3358893934b3b1b867f2a5ba42bba43a3cac9f3b641b053ccc70053cdef6533b99f9643bc923103bde6798bab57e573c2e2142bd9dc86abde5acebbbfa9761bce1f316bc18a900bc8ae1b839290779bdb977a13e01e6b23e02a108bdec76ce3c0d45173c38c32cb9f8f6b238ac72e63848deca382d6d08ba711102bace3fc53979a8acba40153b3a3c9399bba7247fbb2b973bbb4066953bfc1ad5ba0aaa213cebbd973c619afc3bfd34873cf64a4d3c24b45dbc0e61d7bce440a6bc4e9defbc7cee73bd92b629bdc72e16bd695960bddc928a3e16f2a43eec32003b48546f3d11af953db98bc13993570fbb45aac63af02a91bbb33d9cbb48e18239afc524bb3181e3b784a294b97574083b7163873ac4877a3caf50933c51038f3bf861583b00501f3ab9bc023baed164bb548b023ccf4986bdfbeb92bdad8229ba51e572bbcda506ba38cee9bb8fc9af3cdd6699bd8e3fb13e60f3ba3ea44e8abd542ec73ccc7c90bb14a6b9b85cf277ba7120a13add7aa0ba5aefd0bafca66aba48d307bbbdfac7baf055c93aa0124a39ea9563ba3f71613bfddc303ca31af83b5b76e33b53e2ce3b25e91cbb0af6b2391759633cc7492abd1a7b70bdf79d8fbca82f64bc6cfa4ebce176afbbeba6f53bb8bba9bdf9a8a03e5216ba3e451c0abd847f0d3d0c40d23b3f4c34bae76bed39fde45c393c0a203adf6c9e3939b2453a8dfdb53a2d7cb0bb71501d3b3df4d7bb935baabbecc202bccc17823bc4d784bb0f8e023ce006f73c22873bb75698043de290c53c68d8853aadbce7bc41cfe1bc4e3402bdaa4ba3bdf6971fbd99de6dbd4c38d0bda735863e6096a93e7318fb3cc496a13d77ebb23da892dbb99a2b9abaed1b88b9140030bb3a281dbb8f3f1fbbecc6b3ba6d917bba68c2993aa000633ba585ed3a8deb423ca55b7d3c0871d23b7dfb923b8f820a3bb468e5ba91e874bb39c7e43ae7aa6abd1c1b89bd45f70ebc931d89bbe84459bbfa3163bbeda6ac3cc59594bd118aad3eb199bb3e522980bd06cdc53cd3243ebb6b103dba0aecccb986a3c53951116db93b30fbb977fd76bb1e66d4baf8d080bb06d3343b6b7e2b3ba3704dbb8595263bb3a9363cbc051d3c0abb163c82c5153c3158d9bb9bd6ca390792303ce0eff9bc488876bdcac8d7bc3d2c72bcc3775dbc1b5e15ba3ab5403ce593c0bd348f9b3ed1d7bf3e93d2e6bc82ab133da720883bee6fb8b968d7933a7be09b3a2d447a3aeb4cb73a0849133986fa2e3b204b33bc8a98a63a756fa7bb8eef54bca50cd4bb3a206f3b3600263b57e4f43a60cf203dd546cebb1c3d213d486c113ddd9dfc3bf7090abdaa8349bda97fcdbc35c7a5bd3951babcaf8682bd8d7514be9b46803e09d3b63e63ed473d5073ca3d1c908c3db23430bbe066b43af60ec0bb5214debb01a62bbc6e247dbb11b259ba762cb9baf636023b64ecab3b05bf333b3406fe3cb062093d19e9a43b91310b3c4724263a54ae85bb0253f6bb6e5f2e3c6a64a4bd10e2babdbde2273b179b16bcc98a94bad2f4ecbb8499023d871aacbd8748b53e69d8c13e0ee598bdf9bbeb3c3a9baebb8d3435bb532d62bb92680abb738355bb1aebfebbcd1bf9bbe53846bbeaf58bbba49c0f3ca617d03b7ccd913b109a2f3cce3eb73c0725a13c9151143c23de4f3c11012ebc18a60fbce8b51b39264c0cbdee2090bda51c00bd42b68cbc2ec439bc6276993be053803c316798bd6ab8943e4d94bc3eb4cb1ebbac58a23ca7a2e43a97907a3acb88f73aed53cc3a6cc7853babd8bb39947636bb29172ebba2837cbc0acae9bb39e2d53930d7ffbbd3d81bbc4ef7833bcf97733c15e11e3bd4e5283d6506a43b9f33c53b12ef3d3d34401b3d4b6ceabcc009cabd56152bbd3cf828bd98ff073b7e9c45bd466b46be40462d3eec02c23e60292b3eee03d43d9c891d3cd818a539ff019fbaba1b42baa396093ad15aa43921d707bada6ea6bafc1bbf3987bcdbba4dc8ea3bb9024bbb1ba5b23891e6363aa7a056bb85a3ea3b79a81dbb14da4ebad71bbabbb0d2493c5b1a9c3b0481823963eb273c11cef9bba35fe239284d7bb93434da3a26e23c3c543a4c3ef09e773e7177cd3ccd2d763b96681d3adcac9e398373dab93394d2baa38ce43a26334d3adf3f77ba0e9378ba437a8e39ea2319bb32e2123cfaad0abb65aa8e3b1947433af57c09bc7d11043c457140bbac6b76bbb47223bce967293c2d91a03cb5bb9e3cd59f013b0480cfbc0082d1bbe9eb37bb2a29203bdc4de439f37fbe3d37c4533e8db0fc3d79d95e3db86b333cff511c37918e813811db77bae9e1803bba0a73ba83e702bbf09936ba2ceb4db6ea16b9bae120093c51ff3fbc0e01363c4e35ae3c9f6191bcdaa1a8bb22bb9fbb09fe8eba1006d2ba68f3a63be33c033c8e67ca3ce072b13cba72a1bcfb7152bce27d3cbc7e0b0ebc106efdbc60f6753d65a8b23db4bf063eecf74c3e94e9463dc4cee938682d54ba103c1b3a81fb4aba27cd03ba554826b8c5e345ba59f5983880ceafbaf4be413bf65411bbe54b663bf38a833b7e151dbb97e0603b6043bdbadbead637c01741bb0c45033c84b5a7bccc2cb7bc4049fc3b15d44fbb79b380b82db62cb92204513b98ec79bc7661873eb5a9913efda74bbc98ce6c3b1083823ae28445397d813bbacf775dbacaae983854242a39364445ba2c5f83ba99545d39fb91e1ba6f16ce3bae9855bb7e01473afe95203a52d8e0bbcbf8d23bca0d66bbea774fbb542211bc77cd233ceed6e2ba6dd8d9ba9595173c451c5ebc0adb00bbe4b99cba1e530e39e39d523cd690473e40c67f3e0b3d323d2aa9543cb2a32e3babecb03968477ebadc9d29bb35c1233b4cac673aab9059bb72cd9eba46ed4339f41333bb494ffb3b9aece8bb7924da3bee8fbf3b59bb35bc21468f3b31ebc3bb6a53b3bbed1311bc1a587f3c4fee8c3c9d43ab3c2673013c6512b9bcb77841bc89b439bc7720f1bbdbd45f3c7286093e9562233e386cc03d057da23d2444013df1e577392bad69baf858943aa48af3ba95dd3cba318e2eba025466b9e47c1c38a23095bab837653b770381bbfc14f63bd82ae93bfa22d1ba3b222d3b1ae106ba236d01ba4e4e83bb129cbf3bdcb016bde75a1fbd6106ee3a64ee1fbb13cd02bb657ea4ba0e19f03b024410bd69419a3e3081a23e50d502bdaa8ef23bff9fb13aa71f983971139bba742dfb3ab75921bbe180963ad20fe9ba98e2223ac547b9b822beb5b6b5a8a73ab73c22b9fd7eb23a30b5063c20ae97bbf8ede03b4eac27bb87e41eba2e55febb59891c3c0bd1febcc21705bdd1ec4ebbe352d8bbc93c9fbbe06d02bb5b914f3a69eaa0bc5ff6863efa43a03e3434c0ba3bc2143c2e3a9d3bc337a739048fa7baca5ca73af45ef8baefe9223b8b8f06bb82da973afdf087b9301e853ab221e539e581113bd1628dbba449d13b9b1a44bc0854233c32a0c4bb4942f1ba678c3fbc26cf283c149218bc0fe3a2bb4f5de2bb8a965dbc4acd16bcd837dcbbfc662abcfb7a0c3c8786513edfda853e08eb6b3df659bf3c275b373c160b8539646522ba4913ce398257fbba3fe9c9baba3cbdba12fb8fb9f92b5cb85a3e91bab908963bc60f64bb352d413cace9383c5bcf943a2ce5873bff2dc23920477539867d2fbb5ab3323bc94750bd7c735abd4e8eadbbeded10bb145354bba23482bbb0d2433c8a4f56bd5b61a63e3791af3eebad42bd0a99733cb8f68b39f4dc9a39657e6bba13d7ea3ad9d0d8ba91c92e396d3506bb53372cb752678c36e5a662bab4a4e13a2d7559bbecc69c3ba1cd173c7391d63a0dc7d13bce0c0b3be6df773b2bf7a5bb27a53c3ccba025bd12fb37bd5bf461bcbc6826bcf4b342bcd9de1ebc872166ba30bd32bd9291943ef602af3e2d87a2bc52ecb13c7cee423c7439a639160eaeba0b761f3baabc17bb5ebdc33a43c430bbc85a8d39648754394716ad3a322b91bbcda2a33bec1ec0bbf4e7823c0a0a03bcc7796b3c08d0e9bac5399f3ba9811ebc98ba9f3c189a16bdfbe3d9bc3645ccbc48bc0abc8ec997bcd25f39bc8f194cbc88fdcdbcb0df7c3e77e9a53e41f99e3c1071de3c7f5c8b3c5a6b3439d83db3b9ca16b439d5ce43bb044674bbb3428eba96f051bae3babe3700567cbad18f633b401a04bbdc786b3cb0388a3c80bff13a54adba3bf443d7b943382e39a9dbc6399b74583bd5c86fbd8f2d85bd8cdab9bb374eaaba878b34bbf41ac6bbbc26883c251486bd669fab3e955ab73ee8ba6ebd0211ab3c676605bb91ac5b39b21234ba718d8c3ac52e0eb924ced2ba70e187ba244c1dbb2296b938311e12ba3dc3053b4069c8bb184ec23bd54a163c0300d73b154b1a3c05e6b93b4809363b87ef053b0f7f6c3c56ae1fbd1f5e61bdcbc2a2bcaf5fa0bc1d6c8bbc57fd5cbcc29d75bba3b18ebd8968993e8958b83ee8beaebcfdaf0b3d24e2933cf42d1d39612022baa6b14b3a330da93964a08c3aa611aaba433295ba171615ba2a2f003ac2f195ba133062bb5d0cadbbbb98cf3b3eea9eba1d0e513c5737513c0646603bc31bba3b9330c43cdf83a9bc0f1a10bd6149c8bc7682debcf4312fbd688fc8bc0b53d6bce3e17cbd5c33823e2aa9b13e6425423cee36543d85fc363dd62eb9b752511dba0e19983a0e5884bba58aa0bb6a44acba4c95cfba2a98e9b976d132ba602f3d3bd1f329bbae627d3c1b03ab3cb5d62e3b3211da3b31194f3ab072e03ad8389ebabd401e3ce09080bd5ff393bdeb80c9bb9b671cbb73fd5cbb687909bc551ba13c806699bd73a8ab3e597cbe3e924384bd2f2dd83c39fe47bb7ac8b139b6f7ceba380dfe3a83bf6dba987b96b9acd704bbe3ad20bb8401e3ba8d645e3a1b24e83aa936d4bb11c3343b43751a3c8971103cebc34d3c522b1a3c085d82baf67d323b0d37cb3c6c6708bde03d73bd2d0cf8bce6b4cbbc4abaa5bca40e08bcde51b6bb1017c4bdfdee933e1e4bc33efe944ebcb5bd3c3d011f743c269a86390e1325ba0c022ab953ac0dba4d67173aeaa8eb3a7ff1053b1fc78ebb5a76973a60eaeb3ac7ce1abbfeee92bb14ae6ebb23edfbbbf10a943b463ee83c7e8cbabb655c003c9d81f33c5bc33f3ac3729cbc4671c1bc7ede0fbd2b8286bd097e3bbc958c38bd7a9ec4bd0e4d683e300db53e54d4073dc2c2a73d6ddf513d2895ab38f879b5baef405f3a9dba4fbb6bcd96bbf3e338bb772015bb6e1447ba6fa4993a41f2743b3d3d41bb51e2733c54deb93c98cbd03b0ce4dc3bb193693b7539e1ba63bb32bbb3a0303c06977bbd46679ebd8ea455bc1dee6fbbab31d0bb794fa5bbd1e1a63cc15da7bdc0faa93e7f33c53e69fb83bd7d67f13c70da1ebbe66aceb8acb18fbab90d363aa5c19cb84f65a53ac5e71bbb822710bb1acd8fbb0cdc1e3b36def93a6f0585bbfb6a9fbbda92243cc981f23b3815883c8ce7603c4c03c9bbb5d680395b53fb3c0b0492bc110b66bde10e40bdd695d1bc2c9cd4bc05810fbbfa05073b4a2e00be89a2873ed3f3cd3ec386b93bcd085d3d9a02383c54b1173a82aa3bba46e4f4b96b68fbbab5aa14b9dfd4203b4787943b9e51cfbbc57aa73a35f32c3b21dd663bdd8477bb771990bb489c86bcd85d8fbb75a8183d834b4bbc0ad33f3be459d63c66b98f3c0cb62f3b31afcbbce59907bd2fdaa6bd5ed32c3c93da4ebd5f6305bee87d413e04dfb03e5ef2a13daeead43d86492a3d928702391deed3ba9ab7a53a00fed3bae71648bb487285bbc5bf00bb7d72dbba8767523a3ec9793b94b021bb3c2e183c70f9953cafc6343c2482ba3b40e3723b870918bb647e91bb6926283cc14f48bd16ae9abdfade9cbcee62a3bb18a281bb5552bfbafdad9d3c0ad4a1bd733f9f3effd6c93e734461bdf091e13c7d36a7bbcbb79fb9b129a9ba56ed003a5d71223a763ed33ae1f256bb6078d2ba4a92eabba206723bc003613b89f495bb5bd6b7bb9da3d43bdfc6503c96126d3cdc808a3c272c28bcd7ce45bbfc5ef03c28a01e3ac1fa81bd091b5abde5e0c9bc7892d7bc5cf16c3ba610263cfe560bbeacb26e3e2dacd83e4a67d93c899c353da9221c3ca0bf383a73a7b338a55befba3d2822bbac2b073aa4c69f3a933c013c54d619bc796ddf396e8da73b8bd77a3b930a3ebbad9591bb0e1678bc66d650bc8d8b333d570983bc33a9a2397a69d23c60aad73c8d47b73b009019bd5615a7bcf26dafbd1d38c43c1f9426bd212728bebaed2d3e1ce8b73e92a4cd3ddcb2e23df603e33c4d5a94b9f3738dba8d0b34bb4008a6bb285847bcebb6c8bb099009bbf689feb950d9943aa23d233cc3a68aba42b3ce3c4ebf063d86a3693cd529063cdb604239e7eb39bb55f71ebc03f1f03b422a73bde7d4ccbd8c2457bc930c26bb7d8e58bb658dd7bb126f073d89439fbd9495a03e99d3ce3ed1d284bd863ff13c5f2c05bce43eb8ba291084ba988b2e39cfce8a390d5a68bb8d8dd6bbb158bebb385d09bce637c63bcea6e73bedab25bba63ec53a4d11d03bd072d93cbd6b953c0018893ce9b531bcc5df50bcdd69833cf2a5203c0f228fbde93186bd9dd474bc9e3fccbcd333403b41c3e03c82cbdebd39ac223ece41e93ef578883d9fced93b1b6a243c4e7a2c3ad2a8d0b97115c5bac9d338bbebac403aa2b0073b832fd43bdeb442bce56eba3a54d1c33b2a89823b3e765cb945a4b3bb0c231fbc55f4b4bc17af5d3d6be144bcf34b65bcbcd4943c2bc8133df655853bb0cc1cbd64903abc80b4b2bd0758df3c9dbd053b1b873fbedb5ab93d52e6b83ea8b7473ee958b03d51e2063c039ab839aa2bb3baf43023baa403233aa9f1613982f3e9b97cd2c3baa52fee39f9fee3bad402f43b587755bba69fb1b94e7ed939322e69bb7895f33b27ad33bb6fe252baa7d5a3bb8464633cab26903b692f1cbb9a38353cc36ee9bb662bb63a4e072fb9b0a2743991aafc3bd867423ea9a5843ea39dc93cce28163bfbfecfb94b45cf39728d46ba1051f3ba86edc23a69d0a93aeea9fdba3f42ddbaaefd003a936c26bb7e31363c3af28dbb048d1a3b37229fba238bc8bbbe99313cfdaafebb128412bb1f19b1bbcf04743c8677583cf0a6f43bfebde6ba108fb4bc518f3b3ce21593bbb267c23a313e5e3a4dde963d5e12873ef8cf113e2aa2263c273654bb5d114d38f918973916faf5ba70d8963ab9aa61ba27d6923a24bb08bba8550138407b38bb2eae4c3c6ea30abca7915a3b8901e4394fa8f3bb57338f3c2f11efbb4f1c563b45d252bc0435c43c1d6f33bb67e05abc93c4193da22cfbbc3ebfd63ac99e99bb051e11bcc38b03bd771f9e3ce5e1453e8d53953e1e71823c2e89583c35590839e4fb6aba6793313aaed377bad52ef6b91c8325b914b654ba9bf9993810ed94bafac63e3b478717bb0ee8733b8d568e3bac502ebbf6f8653b59f5aebab25b063983643cbb8d73083ca69eabbcef07c4bcb3f6093cb2bb42bb06205f3919871cba76184c3b40eb8dbcc33a853ee629963e2fd666bc3c126a3bff8b553a51d16d3904f65dba8cb284bad6e33639e4be063995df3dba3631afbaefbf8d396679d7baa84a013c5ad869bb85e21d391e235d39602813bcd703013c840c9dbb3d900dbbb9f9f6bbfa91773c612df1bbdf5301bce656603c07485ebc569d0d3b046f30bb4adf89bbeb57273b04183b3e045f8f3e7fac453d564beb3b560d99b946ffd539221aa0ba4100c6bafe85ce391ee8773a595e2ebbf5490cbb57af4c39108e3abb8ab3453c26adeabb0a64a43b7a6ddeba85ab39bcc168013ccefc19bcd1b2a1ba617d21bc5224c83caa16cd3a2cc1b33b28b2663c95b286bc39f5213c011720bc070454bc3a8f993b7f98073e9370473eb949193e06fab73cba477a3bc0a78f39a66386ba8925f23ab5ca26bb305cadb9fb10a4ba7c22aeb83ade3ab89f52c1ba4ad8853b1529a1bba256003c46faf03b2b769dbabf831f3b1227bdb9e9de203a5e429dbb8382e63b506c17bd06a124bd4cbef03a31fad2ba2a0406bbb8031fbb9343073c52f318bdfe8f983ef8e3a53e1bc008bdca3ae13b25b0cf3a3754d739a80af7ba02626f3b9a4796bb176a403b60d375bbab71df3a6bf49db971b9a1b8fb733e3a47e723baa9beb93a1d05263c2ca5cdbb1048f23b566d77bbc98c0f3bd20b0dbc77ad7f3c612611bd714a15bd36c24cbb90996abb78e732bb649276bb3e4d033b6d36f8bc2e28833ed8e9ab3eef24a6bb20f6003c07791a3b1334013a97e93abbc709583bbe68aabbe58bb13beb2085bbc0200d3b8ba504ba12993e3bcbb514bb25efe03be91816bc471b173ce5f798bcbf80613c466a30bc90a60b3b090759bc6665bd3c3373a4bc73db13bcf7ffdfbaac8fc0bb6dc087b8875fb8bb3cc850bc6271dcbb67f0423ec8ef943ebb20823d11138a3ca60a20bb097fc039eb196dba45375a3aa5a50fbb8911c8ba6a6d04bb0af58a38940cdfb854deacba6f43a13b848098bbff3d4f3c8fbf3e3c3643183b697a5a3b77b7c139a8b6a43a228f88bb627fb83b3bb255bdb2af5fbd4922dbbb3d1acebac1bf3fbb2a7695bb69fe553c8acb60bdb265a43e3577b33e5a5f48bd4d0b773c3612ab38b5b4ec3916ecb7ba71c3443b2c4f35bb763bb83a580d8bbb57ae743a1e718cb9377384ba0ee5d63a5cf5a2bb4c2bc53b707c2d3c81d48d3b4149983b83c1403ac183b63ba6ce0abc246fab3c216f3fbd3bf048bd04b49cbc5377a6bbed32dabb4b8a00bc0536393b69565ebd5efd903e8e16ba3e50abb9bcb661a83cbcce8d3b3a2dc73922e31bbb8099793b7fbe34bb341ec5b9d754003a36d376bba9800f3bc2be523b163b20bc8dda393cacbb4ebc5f1fc03ca91428bcfa8c583c728abcbb87d5353cde90b4bca55c2f3d548b6cbdbd9092bc6a5c2bbdbdcf1e3c9b6921bc11d8e1bb7b0af9bb3cdb1fbd521e6a3e3648bb3e6454c03be689063de75f8bbb9e7f9d395f87eeb9d04a023aca2a32bb91d273bb911efeba3f534cbae12cc1379fbd6eba96bb5c3b749c47bb8bd86c3cceab953cba94453b934eb83b20391eb90450e2390b7150ba97cdb73b294970bd9ef288bdfda508bce0ccd9ba98d01fbbb00eaabbc42a853cb7be88bde837a93e7048bb3e65c86ebdf8ffaa3c69ec14bb8478ed39abbe88baf210993aa35827b8298150ba30731dbb768d58bb330cffb8b00a6cbad89d803b752b08bca7efdd3bff84063c744c5a3c6e471b3c4e84863b9867083b5fc86cbbbc0cbc3c99fb20bd41bc7abdaf25f9bcc8ed90bcd28205bcc562d7bbdcbf573b13cfa5bd0e5e923ef01cc43e648777bc29fef63c75dea73bbbc42b39a30617ba4ee935370d3dfa3a0c21a1b94b09723acf8cd1bb59dc133a3bd4cd39b400b03823e788bb19cd8fbbb28ce83b449b323c9f58303c9e4a933b1c72823b53b904bcf2d9223d3a5e0abd758426bd6db541bd29548ebc244b3abc5680babb35fc3abc4a239cbd2bfd723ec7eac53e8dd9893c4794323d8af21f3be0cb6f39a50d8eba4ffea03ae1e56cbb9d9f91bbdacd53bbae7fdeba6bc1eab976da63392a25533b8df95abbd9c6723c338fc03cd2e18f3b14410b3c211dd33a49037a39a10920bb7e903b3cc8a07dbd0a0799bd775b60bc06260abb02a4b7bb862cd3bb97599f3c0cfc9ebd3096a73e53b2c43eeb2b81bdeb40e23c720b22bb08f14a3ad18ef8ba00969c3a39d1aabaa260003b50eb49bb9ae080bbd93811bba8f3193a7a75743bf21b8ebbfe0f60ba59c8063c0fe94a3cb59b993cfca1ea3b0580efba3f59f7bb1200f43c7001c8bcf21371bd3e9851bd8bdcd6bc0a1324bcf42b033924130a3cd9c8e1bd2cdf853ea51fd13efe47873b250e2e3df37be0bac4f2a239597edfb9bfd0e9b92ce58fba1819083b5e53f13ac58602bb73307ebba4489ab912039d3be25995bba159d3b858750abc0968003c7d11723cb23b643c60612ebba803d1bb71bde53cb9afc53a2e4602bda97663bd32063bbd717744bc9aa6d53b2af626bc1fd8d7bd1cfb4e3e5ee4c73e6bb4903d4c09513d2748a4bb5d87a4394598d0ba6338963a498310bb010b98bb4a0193bb667920bb3ecc6bba4c366a3a6540913bc4f0aebbd14b5d3cb017c63cbfe01e3c5767ff3b4692653b1c94d5badaf07bbb99a3763cb1bd69bde9eba7bd51eea2bc52ba34bb43dcd1bbb5d97fbb5f8ca23ca092abbd27bca13e2638ce3ea5b881bdd99f003dad188abb9c3a793a1515bfbaa52048b8444ff0bab0605b3b43db12bb27a801bbba7abcbb3221fc3973608d3b387c6a39dfe5cdbb3c6f833b462a2e3c8f2daf3c67993d3c38e637bb3c2162bcbc3fdc3c28212eba3e2650bdc6448cbd3e4500bd55d73bbc1e46263b4c83c23c819a04be97735a3e6e04e13ecd3ee03c551c393dc3e9e5bb0c256b393da3183960b82dba1ec5cebabb6220ba2a4d5a3b80fb233b26ace2bb99eb44b93c5c443bdd2b663af976023b54ec1dbcf7cb9abb0e5a493cd7a2b73c69af1fbbe1f40bbc33991f3c1f82b93c1de0e7bb06b16cbddc3e83bd702a64bcc7061a3cd328c73b105aeebd84a1143ed233c53e50560a3e3def3f3d6a484abc1e5ff13938d92cbbe667043bb9c31cbad91e62bbc55ea8bb16c269bb83da20ba4bf3793ac0aca23b553ba8bb6d94043ca75b9c3ca2797d3c4185e63b92ca3e3b61b01cbbb596edbb26b1843ca72731bdd100a6bd765ce5bc883b6bbbe06261bb93146639ff179d3ce06ca3bde297923ea9a8d63e050058bd524ee23c40e8e9bb6ca46d3a1c047fbaaba6a0bac0e3aebad02d1f3b12de51ba0b5a67ba50af07bcf83896b82787b83b2ac5a93a1ae9a0bbec8256bb1b56663c29ed9f3c0b9d673cb12426bbd6c591bc3641993ce8eaad3c702b53bda4cf92bd926e18bd40ae30bc336f173bfeed073db9cf02be36a0253eae20ef3e5e83493d96d10c3dff7c9abb2a63c0380f488c3ac5379eba9fa500bb14caf2ba3b8b3c3b2b82c73b20261bbc7e15c6b90f80dd3a6244ac3b50663d3a3ec1c7bb44da41bc3c7c353ca6d5ce3c4a3c9bba87a93fbc79731d3b9a97fe3ceead9e3b93fd84bd6f8f6abd880cb1bc4d88d93b1883c23ccc3405be245cee3d560cc73eb948293ebd3a0c3d085102bcdfd810ba4ca5a6ba63aaabba87993cbbcef97abc784640bb75fa9dbb2724633aff91573ad1bf353c011142bb7caea23cd157043d5cf7aa3c7e70e63bdbc12dbb31c993bbdb332ebcdf65e13be13135bd099bdbbd57879fbc62e7b9ba15a56c39d7d5eebaa149ff3c463498bdffcb8e3ecd1ddf3ed9b783bd5ecaf53ca65a57bced9a873aad3d19bbbd1b09bbcb31b03a327906bbc0bd33bbae1988bbcc2911bc8e10003b5348093cd92b933bb50667bb642a75bbc081b83c80e7bf3cd4c23a3c58478fbb41c2a0bcc351403b849d043d341046bda92a99bd0c7c19bd3ec30ebc1f4447ba502a2a3d909fcbbdfbfea53d5b78013fa0089d3dbc52ee3b6475623ae72d173ad8e5393a4dc6d0ba95f495ba0787d6ba73cb543a8e43e83b0e4b36bc1b3b98ba5212e63a64714c3bf4a39d3bfa3a2fbbaa9d4ebc1c15883bf271f43ca8e62f3b4d2011bcde422fbc03c9db3c2809883cafdf5bbd339262bd5b1a00bda3e0d9bb71f6543d866de5bd27d4183d9c7bc43ef58d773eee43c5bb0bff2e3b7ac3b9390a0ac4ba272a20ba67b4183a4837e338ab9423ba35eddcba622c143af6cae2ba6cbef63b971a69bba3945bba5304b53901a182bb4c01fc3bc48c2bbb347964ba32ac85bb1fa96d3ce95f793b52afa2bbe816693c698bd1bb2cf7b93a87f6a2375f616aba0d62bb3b16453a3e398f8d3e6b469d3c6499563abfa072ba4a070c3add7883baf7b71dbbf825ac3a8f533c3a4e1711bb31e3c4ba1c401e3abc6858bb4941623c0c4ac0bb9dc652b907b101bba19e7eba00e8aa3be18d04bcc9c74bbbb7fd75bb5fb2b03ca83b043c7cc7c0bbaf899b3a3c6e0ebc28ee8e3c11e13abbd6e2a9bba3605d3b6b66893d0d30a43e5a1bde3d896905bcb2eaa0bbd483e838b337183bbf7e01bcd1d9613b0788b3bb02f8c93b6690debbd4e30539ece909bcd3b2f93cc8709ebcac04b13bd8d9eabb80cd8cbb543eec3caf1e76bc3406f8ba872c4cbc148b453d25e7b1bccaf74cbd20fa383d0d2222bd1b344a3d1313f43b4cb2cbbc682572bcd0f1843d7b39933e26133e3e772e5fbc754841bc4e811639bdab83ba1e1e7b3af6148cba1d72adb9be4c65b9e3bd56ba761fe638cefe97bab545563b17ce35bb27216f3be1b9953bcd8c41bbf83d7e3b9033b2bad68ee5390a9340bbd68d0d3cfd78adbc1ff2d1bc076c243c477f4abbf4899139238e71babc08573bbf159dbc333b833e549a9a3e142d8cbcb121653b13eb3a3ab6558739a9496fba9fa18fbab113b33838bb86b96c7a1cb99eb0f4ba10a4d839b9a0eaba438b0c3cc0c369bbf9beabb92812173954a021bcc3eb083cc55faebbab8bcaba42c0dabb7e81a03cb30249bcdc6485bc5650a93cb9212ebc2057543b36f710bb6225c0bb2550b5bbd4dd343e81e6a03ef2aa053d9135183b163985ba554ae039586730ba545281bb4d22843acf1f69b96e5612ba470d85bbd5281b3a1b9c8cbb8393923cb72ee0bb18ff6ab8b633edbae72e59bc06f80f3cca692abc454f5abb31681cbca2421f3dad264abcbac430bcf4e0ef3c6711773b7ef7653cc5355fbb54f48dbcb4b5ccba15370f3e68c9873e8535a83db8a1273c8911fcbb7568c639f182b5ba0246133b7b4a40bb71013739fda303bb703e66395754d0b82582e0bad9d0943bebbec2bb90070c3c4c56f33be6f97aba904d0a3b50913ab87072da3aae53b1bbd0af0a3c27c219bdf2eb29bdd9600b3b814c15ba54d30dbb520367bbe985173c49841fbdcb0a973e7e12a93eed2211bdeef5c43bcc3be83a14f5f239c95df3ba2b70803b8831afbb9097513bdd5b90bb4017103b3c6cd5b964728dbaa5c9423bb20a8abbbc22ab3b2f92093c6d2a95bbc94b913bbf5127bba331513bb8f70dbc82d7963cdd081abd6c6b2cbd47e2133b28f429bbad85b8bab9a7a0bb8b9bbf3b497a1bbd8871813efa49b53e101c66bcb793973be8bcd73a588993390dcfc1ba342733b9a66c11bb5d98213bf49867ba8ebd03ba43f1ff39c96e173ad1408d3b6e3ac739e8b45ebb6af1eb3a149681bc3a550a3cba3e21bcb0f52d3ac4f910bceeaccf3cda959ebc9073b4bcebd9b23c4e70a3bbf435bd3babee81bba16c17bcc76b80bcbde03c3e1236a43e2df02d3d3d35873bd850bbbb0e96fd3920ac9fbafc84b03ac34225bb5e8e8cba783b47bb2e452d3a0ddf7ab92668b9ba6feaae3b69a7b9bb82ed573c0ff0423cc2fe353ba88a253b1873313aee92d73a3368b0bb666df73b51d758bdb20b65bd0a8ad0bb169659b927cf4ebb43ca9dbb6e116a3cb27563bdd2c1a23ea590b63e272652bdd0045d3c8657fb39d1a40c3a1fc0afbab6e0423bca5f5fbb48ecec3a03f3bfbbb67d2e3bce9b2dbaf308e1ba36a4813be72d08bc0e612f3ce096123c9943083ca92e84ba01b64339e8fdab3b083c32bcb023c43cb42d4cbda46564bd1b8d7cbc267bbbb81adab6ba730fcabbf1ca383ce7d375bd363b8f3e176dc23ef09efabc782f543cbb040bba5c36d6387cafd4b9bcb71e399bcc973a170ca1bb342bfd3ac04816baec46af3a5dd6aa39c08d17bb890fe6b9a63d2d3b0969043ccc10a03bbe2aeabb17232abbf6e7233c40daa0bc20222d3d49955bbdde590dbd173d95bc3786db3b8481623b63bcd9bb8e999b3bb34643bdbb47663e09ebc63ef5d128bc9885943c125729bc15a3e339845a73ba475a923ae43755bb11c151bb1c4d27bbc6aa52bad5be943995ca69ba3c18693bde9966bb078f703c4b70973c28d58c3b6a8d9a3b7225b8b95a8b133a74350bbbd9a7f13bc3466fbd98088dbdee9018bc3bc12db957580bbb6caa8ebbfbe3863cfa1788bdfd42a63e0d4ebf3ead6976bd4a42a33cd1ca37bb5ed7133a2dd28dbab9d6a83a568a29ba8e0f7fb5c50e9cbb6c0600bb8e5d89395c9fc1bae7799c3b9e700fbc1dfb093cc903113c0b60983ce4a28c3b5bb4343a4255413b48461fbce19cd73cb28e2cbdbbb68abdc0c407bd8d9df0bb576de438560455bbbeb56c3cdceba5bda3ab8c3e6e4acf3e4376bdbc2787973ca6c167bb1b0b94b8c54d1d3a1c50e6ba1374943b6c6f78bb39c0e0ba9dd927bbca0bad3a5e3948ba8128de3ad67be3bb373b6f3bdabf603b8582d53cccb4e6bb72aab6ba3e94ce3b657b8fbcf3862e3defaf29bd2dcd59bd7d852fbd6b637e3a4a43f93be1bc9bba0701143c921191bde233663e86f4d73e9ec109bcf261af3c2fa66bbc3f0be1393bfdbfbaaf37e83afcd47ebbf6c87fbbe77a98bb4421a6bac68fc2b9df24ac37d6be743bb0128dbbc1b0703c029cc63cd944ca3bcabb093c1daaa63a68b80c3abcf58bbb8a2d5f3c3d657abd9b379cbd169c8ebc9242ffb9549babbb4aa2b3bbb45aa33c7a589dbd55eba23e2809ca3e982d83bda790dc3c58ef67bb8564893a8f810fbb2799143be3fb77bbb845ad3be17d03bc9e8f7dbb4647ddb9ddecbcb91be3413b3652bfba7d2f22bb1a953c3caa769b3c13ce9a3ca6420dba5f3ee03a21354fbc67bad43c6a7bb5bc346f8bbdb7407bbdc28d57bc6c84263a92ec97ba26dab93c1181ccbdde73753e7be5df3e4005dcba9775b53c9c6401bc08b2bdb8d0c24c3a0ed5c2ba9089d539d8a2443b838f32bbee92a6bb9760043ae31e8dbaa587503ba1308dbbcc7a223be70412bc6cc1f43c2525243cf1c764bb03a2663bf19772bc9e82e03cfa672bbc74674bbdb94a96bd178e3dbc6359443c5035b13a4abb8a3c876fa3bdd70d3a3ea1c9e33e5c12183dbeb9b53bd4f762bc76e19439331be1bab51e883a6365bebaaadf9fbbd97eadbb122926bb4bc81eb93934ee394839af3b5d04cbbb13c24c3c99f3cd3cb1a03a3c4de6003cef350b3b4a296aba713fbfbb333b8c3c653c62bdf066abbd6e06cabc155bc7395ce9b6bbaf0949bb287aa63c16b8a5bd2ee89a3e8d72d53e549786bd3e28f83c6865c0bb40f53e3a515766baad12e3390d172cbbb2277b3bcce741bbcf06cebb0b0111bb23e114baf1ca243b252de33a05d57ebb1c1ee23aa3c2a53c9f8ec33c03be153bb854373b39f270bcf43d813c6104793b4b7169bdc94baebd4ec289bcb7500b3ae52a48bb97a50c3df8dcd1bd9a23373eb6e0f43e34ce833cdfdcad3c348b2bbcf824adb981cbb73a6c02eaba3679063ad90902ba93cb8e3b644de7bb4d95cfba1d5663bab998dd3a2d24b2ba20f9a73b6a947fbc068a983c8032ba3c7c3f50382e6c443b316326bc40ee0c3c2ad3383c17eeeabc9f57c2bd45bab5bcfde31a3c4262a7ba1dd3bf3c748892bdd59af93d2c79ea3e83b9bc3d57b38ebce0eae4bbba668e39d10e26bb70dbda3ac3aabd38ff5562bb084cc3bb4bf386bb5117023a9ce54f3a3b95b73bbd50c2bbb840e93bcb22a33c6b0f933c5786df3b17a7f43a80a8e1bafc6c14bc0fda8b3c33b521bd55a0acbdd7fa07bd425dda39fa2364bb94d9a23a0d9b9c3c314997bd64e3883ed89ae03e2e7e6abd814dd73cc3fa09bc23d95e3a65bfefb942dcbeb904652cbbae951c3b94f7e1b915bdb8bb2165acbb726dbaba0ca0533bff861a3be9772cb930a2c4bb924fb33c2d52c83c47f3913bd3cc6e3bf3996fbc2f77813b15b0ae3c63c051bd78cabbbd0828c9bc81a16d3bb33759bbb497123dd608b1bd9141fa3dc240023f29bef93cdb517c3ca0272ebc51455e39dfe3a638ef2c123afe3229bb2d55923a1176823beb9150bb9544b6bb173c4fba86b87c3a65b0443a079d243be69536bc5902803b2337fa3cd225813b910fc73a10312abbfa04e3bb2494ea3ccd91aebcc0bac5bdb932ffbc686c893b86719cbbfd6ae83cdbe196bdd5ddbb3d548eeb3eb1ad013ebcad00bd1f7bfd3aeaf78d3af1941cbba979c9ba386355b939f081bc90c08cbb25b291bb00cae03a7e3886b98c65433cdc846abbb8278b3c21e6043dddc4b63cd5b3ac3b81ed74bb5a339ebbc74829bc317fed3b44c81bbddb03ddbd5d3ddabc56709b3b32021e3acab5703aac63e93cf44889bda168813ee387ec3ecf7292bd21c6f63cb90183bc8f16493a22cda6b7baf008bbbb4801bb6d75433a222ec7bab73ed8bb0138e6bbbb5bdab9f862683b807ec03b5d42dc3a473eefbb1b55c23c7d9dc53cc129a33bd1f7d03ae7482dbcb93e00bc9123e43c628e19bda6e0bebdea87e6bc15db973bf671ccbb0a5e003d0c4c59bd56bf2f3df8d70b3fab86373df64f733b8149a6bb20e6bd39c73ded39ffdfe0b9cba927ba6ce113baf2c4223b43a8103ae01b15bc751297ba9834613a08a9daba415dc23bdd92f3bbd60484bbc1eae93c0bb1223c9dacf13adadb063b25d741bc92e6a43c24f6ec390078b1bd6cfa47bde37ed73ae869d8bb679aa73c13f20bbdf221fa3bc5bdfb3ec5d1193eaf1322bdc644f33b8a61c9396e52d6ba5e94f9b9defc243abc6989b9ec45d6b9af8e00bba4c33a3a02a8e7ba417afa3be75772bb5d79afbaf24723b500029abb037d0a3c21b623bb6de11eba2fe585bba6bb6f3c7b7f773b5858b8bbdef4933c8745c5bbae7b4c3a9cc1063a9cadbebaefa78f3bb881343e0c02953efd36293cfb8d16376bfa8cbaab001b3aedd790ba703e36bbfef8a73ac14915ba85481dbb6ecb17b9eb64913913e535bb9743563c41459bbb574a83bb8e8c7f3a4b3862bbc5ae1b3badc93c35cb8962bbe42f89bb043ec03c68ffd83b92d15ebc875f6c3ccefbb03b9174d33ad96c9639bacccfbb3461613bdc94923db4d8be3e9957283d9686e2bbe67c36bb0ce73f39b2488339534cc2bb66e4a9b89491ac3af3ef0bbb41582d3b01d4e3b7e3c689bb8670bc3c2149b4bbf94e2bbcce8a5ebbe8cc56bb0f2640bb510f4e3c083c16bc3b477cbbd328263dab57fa3a70c31cbd39d1913c64dfa43cf526c4bb08cfa83ac751c6bc6b95483b23c4593d7b5fd93ebae46b3ca3a5943b001f00bb5a9923395ec986ba6314883a18c394baea72a8b9426607b9ccd57dba4f861039b82995bac02c5e3b533d3fbb4e566f3bd00b9f3bee476bbb57af943b1dcda2bac904273aae3e47bb05ce103ccaeeacbc2c2dddbcab6b463ca18262bb58387e39085187ba6529523bc59aa4bc0a47813eccbd9e3e913ab0bc8a957d3b6de8043a29549239712088ba3fc788ba3449fcb941540fbad431af390efe1fbbe7880d3a11e8c7ba82b8073cc5dc6bbba23888ba4befb83ae41634bcf11e183c20ab85bb22e49aba43bbb5bb393ea83cd83467bc97debabcd146f53c18fc31bc7dcce73a6cd0c8ba598892bb78e129bc9401313e1d92b13e7bb2a33b3b68c03acfd35dba48cc043ac920b8baff098cbb109c18b95586c0baa7f71eba9e2d9fbb12d6293ac63d47bbb9be993c2a3c8fbbc402bbbbe1c18cbb6db53cbc1c070b3c5d2d893b58e0a0bbb1ce13bc4080343d0a333bbcb2b696bc28172a3d9ca4f73bb7f561bb63d312bbd57d48bce84e8cba6078013e31edb03e35472f3caf458a3b5baa06bc7cffe6391bbad9baf289393b00c376bb2f004a3aea322cbb9ac6373a5fb672b9984600bba017a83bb7b2d7bbc3131e3c2e4be33bbcc610ba452bee3aabb2b03959e6153b3a97cdbb3276193cdaeb1bbd79e92bbd2fdf363b694c94b7d65630bb5d5686bb47a8223cbf2620bdea9e953ea773ab3e08781cbd82cabd3bb07efc3a6e72143a47d0e8ba527b863b11e8cbbb8ff16e3b6cc5a4bb8280133b0fcc11bab14215bb6562b53ba3b0f7bbda40163cdf9dd93bc64e5cbb8c3b1f3b10883bb92c20863b6b9918bc72ea9a3cc43d1fbd11b83fbdf4c3163cc78922bb2a573cbba69ad1bb398f233c1ecd26bd9668803e5f3ebd3e8d86e8bca5602e3b0640523b21d4aa39f89f3dbaf121bbbadbe0e2ba9804093b1396be398bde5dbbd92d963a1d8bbcbaed3e0d3c15b487bb192511ba34312abb3f7a89bc0e1b0b3c28daadbb02e01eb90d8adbbb2b30ce3c35ce91bc886ceebc8d5f413d1eb12dbc8e8aba3a6b782abb06e6cabb2c3493bcc19d373eaba3b23e50dc363c994e89bb984558ba06611d3a31daebba7fe4153bec7e52bb09e993b97b5785bba6f2923a024bb9b96166c1baa4bdd13b1cb1e9bbb0ae5d3c5269403c543f4f3bc8dc303bf823323ae60be03a66b7e3bb9226173cc66258bdb58a68bd2c4fbfbb9ce50a3a9dd071bb36d79ebb1bcc7c3cde4364bd534ea13e66e4b83ef13c5cbd32ba4b3c0784863ac1d44e3a0bf3d6ba92a7673b70c194bb24b02e3b8198f8bba4468d3b2f41a2ba6e3029bb06c4c33b764c2cbcfd5d613c3183093cb974073c6e5f80bb88a9053be494a43b089145bc8bf3c13ca4d750bd319478bd975fffbbafd6753b874b6fbb8c13e0bba7b08d3cfae475bdbabb8e3e9f0ec83e569b32bd6f96df3b9810f43a23e0e039ad5bb9381a02063ae9fc78bb682a623b8288a5bb7918cc3bbb180bbb5ff133bbe15ab53b836116bc75a73b3c3f410f3bf9e889ba8031eebbd65efb38bcf9b33ba92c2fbc50e3e73ceebb23bdcd6f61bd016a863c66693fbae51d0a3b2817d9bb2137153ce52342bd704f6e3ed1aec83ec850bfbcd339b0ba81f58b39c8ee393a4f5bbbbad1f3ac3a512f3dbb1d0b64bbfe2325bb3c9242ba7ed5c639468aa1babfd9903b7a6493bbad90723c71a2973c88e7943b9648873b404d26ba482d853a89c771bbc529123cb06f71bd4ac48dbd773c13bc353b7f3a1a53e5ba0b6c86bb14c5873cf4e283bd4017a43e4a12c23e6e1882bd01189d3cfaf642bb64f4683a192bb8baa8f7033bbf3507bbe0c28d3a4de9f4bbc392c53ac6cbeab81d7624bb8060c23bac5c1cbcffc3363c2c1d1f3c8e1da53c386d85bb839b963ab6f5903bd2aa47bc6117c33c7e8935bd2af195bd2ebde2bc548ad13b5ab4ebba4ab7b8bb1ba6b23ca11491bd6aa0873e307ed93efc8d37bd9a69173c1af2a9bae6179c3912a8f539ed288cb93cd589ba861e613bd2a141bc0d93213c963225bbef931fbb2a178a3b0dc10ebc16720c3cfb11ef3b36458a3c88ed86bc58b7fc3a15dcc03b495060bc2a1ff83cfa1c17bd44f094bd56d74ebcb940643c6703153a9b53bdbb14de923c3b1d72bd6cff673ea507df3e666e16bdf15460baceba05bbc2ed843a628112bb0c9c173b49c792bbb2ef60bb8feabbbb9a102eba66e8d1b7f8f083ba46d3a93b5238b6bb3e217b3ca4f5cf3c77c4d53b9ec5013c3ae669399ab5c33a8cf7c8bbfd6a7d3cde0680bdcc909ebdcf568dbcb92a663a75119abbd664b3bb5764a23ce10697bd71ca9f3ea2facd3e51be8cbda587dc3c309076bbb760a63ab34308bbb866553b97f7a6bb2f15cb3b951f45bc22af2bba4ed4c23a4393ffbaabc21a3bedc1e0ba14945eba87fe583cbcd0de3c20dd963bc6e179bb56afa43bfdfc43bc113eb33c498bc2bcea24a3bd988666bde741133c2ca06a3aba32babb2da7cb3ca0959ebdb6a8643efa68ed3e4192eabcf916d73b64ea53bb52605739cfe9c639037f80371dacf9ba25ebd63b7c6f55bcbae4a13ba42f32b9f47fdcba1bd4013b857b49bbed455c3a0a11863b893cfe3cd87f4fbc3f542dbab5ee8f3bcc051fbc392e923c001454bcf5799bbdfd0d53bd20d8de3c62b647bb2d9db3bb1b36983c547e55bd8ac9363e6d13f53e69acb0bcbdfa44bc7bb6153b2077403a323a0dbb048daa3abdc3e4baabb0adbbdcd3bfbb334100bbd8b93d3af1e205baefcbcc3b14c4dabb719b553c6838da3cf69e413ce744da3bbde24839a0b058395ef8f7bb1961913ce15d66bdedc2aebda6cfccbc0fdb7e3b6c0797bba1f73ebb5147a43c4be398bdb556963e5dd3da3e7c6f94bde348ee3c679cd0bb7c41fd39f23f1bba21ce153a25e30abbb4976e3b67ace2bb3edfcdbbd7da183bda1b8eba354d0c3b635a5d38d5a92eba3a5e6b3be2650b3db24d233c9ab16abbe41b623b07640cbcb095053c6e4182ba3aac97bdaf47adbd6a854a3c4c9d53ba5032bcbb90f7dc3c4c7c88bd8334293e13e6023f996dcabccb76f73b030393bbbbb7ed3891f7dc39d21817394fe708bb3e14b13bae91d6bb2c0940bb4ebebf3a3540aaba68989a3a34f5e8bab7faf13a4f3dc4bb0144103d7f2ee1ba07b2eabada70483bbd0d91bb65f1a73b143fc53b74d983bd45fcaabd7e9df23cd0a2cebba3aab9bb6ed1793cc2a41fbddbb6003e5152023f14c1b83adf45a5bc3ac3d53bd29b5a3ae35c37bbb044ac3ad5c9f5392c3b89bbedb6debb5cc949bbb293df3afd491bba73b5e03bc271d1bb0bd4003c8023ae3c6652983cdb57aa3bbc600bba0878b8b85eac27bc625c843c334624bd3d7eaebd8eae10bd1eb4c53b0f2558bb17340f3a5ee0923c13ea83bde788823e740ae83e645288bd73afca3c53f503bc09085c3a985387baced781b84d971bbbf1f9303b92b267bbb0cb1abc39d20d3bf3739bba3d66453bd3a6793a913d123b13e552bb0ae30c3d85cd863cd033b6bb64ef213b459edfbb41098dba3215313c503385bde19acabd4ad3043cd584483b4c1c61bb997bb53c24a646bd6409f03d645e0a3f937379bc5617833b960fb8bbb5bebe39ff669cb9dddd893ab07027bb20ad623b3f46eeb88fa4febb3530ce3a0fc65bba80bf4c399bb018b91036a43a60a527bc7518f03c7a9c3a3c3b145ebbb968e13a4a102bb92a1074bb80ba9d3c415b58bd1eaacabdad60a13c867e8abb73cca7bbad2b633c17f80ebddadfb53da758073f8bf7933c49d4a1bc3607cf3b5ff95c3ac3bde3ba657620bbbe71e43ad09478bce0d794bb76d5a4bbf41d6e3b97b48fba96db393c9fdaa6bb4ea48d3c3814023d9a0da43c27c38d3b222abdbb045485bbb05b18bcf1d6ea3b5b1a17bd1886dabd29b3debc9083213c842d1e3a2bab383bebf8c33ce3416cbd6502753e6d77f43eb2e1a9bd2194fd3c6c368ebc9b93053a863133ba18d99bbaf144d3b9638e43b9e75fabbae0363ebca94a4a3a131b47bae477d23ac1017c3bc076e43ae91d85bb5338f33ce0619a3ccb24b1bbdf23083b9f31a2bb5e89bbbbc9c2943cd80a45bda9abd2bd7ef9b73bf01f523b4f645fbbe184723c1440e7bce31c683d9f3b113ff7ef8cbb92db843a5e6e2fbb2db4e339f21f3cb9d4fadc39922881bab0147f3ad50c2f3bc73adcbbccb521bba6f669ba3cc7383a9f3cf2ba01d3933b13ce58bc34a79a3cec91af3c5fd377badda84e3a7749923a1537abbbdacb8e3c43c2c2bccc53dabd6be89eb9cf0b40ba91e2efbabb12b73b31ff65bcc0eba93cd66f103f896de43cc25d2dbcd30d293b8314df39872fe8ba9e8cc7b9470a283ae5a605bad3fe84b9d91110bb195d4f3ae5b3e7ba79feff3b22617ebbe089faba0f29773941e6b9bbf956163cca831fbbc277eeb99ca67cbb35a86e3ca2628e3b677072bbecb9aa3c9476c5bbfc625a37f9cc1a3a0345e4babb338e3bfd0c303e45a1993e8ecdeb3a454b02b8801b7ebada490c3a4d64d1baffabf9ba652f8f3a5a4fd3bafaf2f2ba55bda0bae0d20d3a4a1efdba99323e3c7c8c8fbbfc8caebbc35bd23a0f82cabb4812f63bdf37a73aba333fbbf1049fbbe751af3c4135923bb6521bbca1f4033dfeaa7dbb2f1e27bb7341c93a0150a7bbc64b293b584d9d3d3435c73e16e69b3b1aaf34ba275bc8ba370c0e3986c83eb9748a45bb05688b3a0628c9baea9c803790f2c1ba69e838b8b4866eba1d55163c90ae0cbbb5af25bcc587773972e15abb599c9d3bc3a2e33b65e289bba54a7cba8d06ca3c52bf183b401005bce529ea3c14948dbb52b71bbb58a8ce3924db17bc605b0fbbf58be73cc05be83ebe8abdbba8449a3aa85ad5bad17a533905e5a4ba475f963a7bd0acba9365413984a0c8b9391586ba2013303975f49fba2ae1773b933955bbe2e5733b9f15953bf37b7ebbc5eda93b249e82ba34346e3aaf9b51bbdfe0163c46c9abbc8245debc8bfc603c36f87fbb4c7260b9c93094ba30d4653bddc9a9bcbfa67f3eef81a13ec31bcfbc5185833b36ccfb39cd729e39962b8aba19275abace355cbac8caefb92735243a5c6c58bbc07d503aee6ba8ba34b7ff3b674081bb6583bfbaa69a263bd01555bc980b403ce09d6dbba1a38abae77092bb0987973ceb365abcfa68d0bc66a9183d517957bccbb08c3a412b83ba0b7819bb33cb42bc56952b3e8daebd3e952c93bce627163bda0607ba43896839c8aa17ba367e83bbdcdb21388bd603bbebe25fb9c7348fbbb460913a1d579bba9bae4d3c42a936bba2b6dbbb597817bb3d2b46bca3f0703c2a8fb2ba48ac93bb3bc152bb64c8e43c340787bb354f8ebc773c683dc4f42bbc36b18dba980616ba1561d6bbdd2047bbb769bc3dd00fcc3e773936bce31c9cba276c3fbb85e7083a423b02bba0cd4f3b35788bbb273bc53ad57256bb976f463a00f286b961fe0bbb2c02be3ba2aef2bb06d4263cdb4bcf3bfd5149b9f3dd093bdddd323ace37473bf5b1ebbb65e22a3c83351ebdb6282cbd5ddf7a3b05aed936b04559bbc21196bb485c2d3cf78f1fbdc5c5943ed3d8ac3ef6bc26bdfde9c03b9817fd3a81f84c3aa0491abbb7df9d3bf126f6bbcc519e3b4bc4cabba319253be5805cba06e03cbb922fed3b19e91fbcb71d3c3ca5dcb23b7f5449bb250b263b1939003b028ba13b611622bc4c6c983c47051fbd54b248bdea946e3c31363abb7d2cbcbbbc12ffbb7346433cc61421bd54637d3e7b5fc33eee3132bd4ded723b368ca83bce8aa3394b124bbadf55b2ba4148a3bafb81913a21b1693a1d94b9bb5f63103b56479aba9f42013c444f85bb16ace8baae23a0ba61278dbca2635e3c91a0b7bbb0f559ba6f3e94bb639eb03ce12e80bcdf89ffbc156d633ded5786bc36100e3aeb33edba8d6a60bb9f3777bc0798253e9a80c53e8baeb0bc3a50ceba4c5e923a17c5333a1768fdba9f55243b68a481bb42361f3abba792bbf16e613a5a6a9eb95befe4ba015ff63bc0a009bc18106e3c209b3e3c034b033bc57d663ba6936c3a94eb043b38f40bbc7d21303ccfbd5bbdb3ac68bdad9082bba707663a291092bb195295bb58717d3c42cd5ebd608fa03e00c2b93eaece65bdd2513e3cfc72b73afb389f3a2d7d34bb4f389a3b79c0cebb8962a73b3b9517bcf5199a3b571bf3babf4c4dbbde16103ca13057bc73be803cd5adf93b6e04c33b93f851bbf134a13bd02ba33b061365bcbac7be3cab2453bd2a3b7fbd6b239bb750629e3b98f617bcf98bfdbb6385993c1db060bdd51b8e3e452fcb3e47ca6cbde355c43baf8fcb3b3151843acb1ba2bafdc70a3bd845bebbd892bb3b694ca9bb2e1e4b3b07ff01bbb2c960bbd3bef03b0dcf0fbcce31213c52d2253ba443f9bbfa1e993adaa4543b8b03893b781c15bcf047b83cf94318bd2a365fbd8f79fc3c159ccbbbe344bbbb153dddbb3bbd1a3ce08a1ebd4ea6683e0b81cd3eb4e93bbd5a20573997a2cc3bcfa2723aef88deba9516a83aeac153bb0a4f3ebb16f931bbc14616ba2593da396071f4bab44ec23b784eb7bb794b7b3c30379f3cd5292d3ba23b8f3b36cf34ba00e8ca3aa41ac2bbd9943a3ca97e79bd55c18ebd0802d4bb88b5d23adeb518bbc9c382bb4b6f893c64a27fbdf6ada23ed638c43e1a8b8bbd89299c3c8d7b27bb1865c83a43b050bb14e8943b5d949fbb860e923bb7462fbc1a31a93ba8a601bbb00055bb917d063cd3883bbcd4da4b3c0cdc2c3c9c027f3cfdc8edbbfcc8ab3b8ac8a73b451353bc20b2a83c49083abd5d2d98bdbe3a8abc6fe5483cde7922bc58d602bcdcef9e3c64af60bdc303843eb2cede3e328a8abdd35a0d3c25aabf3b58359d3aa22028baf379e33a9a039bbb1528b73b1a4c21bc8ff60c3cb90988bbe6ae83bb777ca13b258ce9bb737e003cc154313cdb60173bdf5615bc499b063c0cd0cc3b66ef15bc1a1cb03cce2b18bd0a7599bd50153f3c915cae3b8e3128bcec9f0ebcf8863e3c23f22cbd2c31683e8c97e13e137287bdba70b73bd2dbf93b1095c93a674c38bbaa141e3bce1c80bb0ad193bbfc9faabb93c8f539d61512baef3c28bb193a163c4d242fbc2766893c77fbf93c26412d39014d0d3c74599c39273e1c3b6c9936bc2fbbcd3c88338ebd5cf6a6bd9127e5bb4e1b02bbc6658fbbacdd92bb50a59a3c30c697bdafd9a03e7698cf3e9d289fbd3a3ffc3c57239bbbf973213b882270bbacfeb33bf824b7bb5568a83be2a35dbc1e26db3b007bd2ba61a589bb98188a3b93c3e9bb2283053bd969973ce7f0ba3c518a45bcd4707b3bad1cec3b8d8135bcd9afe53ce67216bd6189aebd5c9dfdbcda1b9c3c68d400bcc635ebbb4bc74f3c8f2b61bd2154633e7e06f33e23ed8abdb3043d3c4003563b56b0653a01d455b9045f893ab6af16bbbec35c3b76be21bc39d3093c44fe61bb92f535bb4310be3aebae06bb911ec8b9e199913cc7a1103c4cbf49bcee51de3bf40b9c3b138aa4bb3c394d3cc6b0a3bc8b65babd83dc43bbb269563c532a19bc5481d2bbc00ef43b22be01bd8b88433eb798f73e705997bd0d2fd53b6961ce3b549ae43a87394abb64e1b53a84c078ba16d0f3bbfa2ea0bbada4f0b96b7e6e39ec4c2dbb6a6b1f3c7a122abc7250753cff68043da1e9b23b57aee03be76bd0b819abc13a86a536bc0abbc03c7eb482bde059b5bd3ff981bc5fec113b13cc83bb2bf5ebba037b913cf3f48fbd4740963e49a2dd3eb152acbde3b2083df71c00bcc1e2043b7dd320bbbc65ab3af7a7c0bac6dc223bdf5d62bcc9f0983b636575baf14b55bbfa80c53b30929dbbf73d973ac864853c6db3073d89af22bc9156693b7ec85f3b78d408bc1a1e823ca8f3acbc63eeb7bd258e68bd2cbccf3c23be23bcee6c77bb36d8413cae4730bdc535393eccb3043f06cd95bdebd4873c261492b9ce646c3a367fcdb9e5626c3a395304bbdd5a873bcc6133bcffdde43b0cbd3bbb258908bb39821e3ac1d1b1b9733f34bb6ad76a3c247fa03cb8b153bcd7a2cb3b3cf6623bb59c23bbe342d13bf80ff4bb4b28bbbd8c01d5bca15d923ca85513bc4c96a7bbee87b23bea65bcbccc821c3ef7b8043f06ca90bd8629d13bf63fa23b3cb5b93a811c37bbc039813a3cf5323abf9bc9bb5412c0bbadc515bb4a5d263b18a50cbb1bdbff3b82c0f4bb55aa223cf827cb3c10be823c715b4c3bf066e5bae417803af1941dbcb98a843c25683ebdeb0cadbd2e560cbd3959393ce15382bbc08f153aefd0663c427960bdb47d803ec9f9eb3e59a29fbd4b88d03cb2bbf9bb0669d13a50d302bbf6eca63825ff30b96d08db3a6f8729bceddf06bb8555403b007908bbe5a98d3be607ecba67fbfa3957741d3ce7891c3dc44344bb751105bbbcaaaf3a0c9b8abb0753a63b3324edbb3bf2a8bd9124a7bdfda9f33c43ecfdbb5d3c91ba6a8cef3ba322ddbc25360c3e51270d3ff61789bddc1d463c4f2376bab8d2d23a6eb7b6ba50068e3ab8e80abbbe0f943b474a10bc7193143b62d720ba6e0014bb221ec03a5bd8bab9b9a84dbb432fef3b13b2da3ce40507bcd4c8393b2428103be79fa0ba80257b3b133eec3a5647a9bd80f749bd0cb3a03c2656e2bb035653bbace4383b43d98dbc61f1ee3d0f600b3f59e779bd746eca3b31cb543bbe9e7b3ab1635abba6bdde391d954d3a3e7586bc2dc0c5bad26a9fbb74e86a3b371979bb3743683c152d1fbc0c52af3c60fe053d9ec1893c83e2f03af817b6bb6165d0b90d8f46bc7ca51c3c3d883ebdae26d8bda8e7b9bc5aae623cb2d0ce39f56ac63adb03cd3c67df63bd5224803e1f80f43e4dc3c5bd6132003d433d8fbc5e50b83ad87b13bb7df444ba003b423bd89541bbf59a04bc1e60a3bb7256993b4e4b08bb3f8f8b3b3ead9fba6e25afba4345483ca508073d29f390b898ef9ebb2198c93a9a5ea3bbe446b33b36e8a8b92d37a1bddd259fbde519de3c4a43c7bb08d003b83d24e03be625c6bc2658e33d0ded0f3f16db80bdfc3b7a3ccc8390bb7b37b73a5f76c0bac5a1433aa85739baa22c003baa3455bbc08146bb0a6d853ae917e1baf1e2e83a3bea4cba4aec07bb88ba5e39b593bd3c0c047a3a50ea5bbaf18da63a95837fbabe18233bfb24e53bad6a59bd0aa88dbd5a14593c5f8e5abbfe37afbac4508a3aa4ef2fbc1b237b3db001103f2af105bdc69d893b29676d3a0ab3de39b7b0e7bae880e8b9ecef213a82d580ba854b0137867c1fbb48da4e3aac36e8ba98fdfe3b71a77cbbfc1ee0ba8dbeefb72a15c6bb0d61163c7c0c10bb5a10c2b9466b7ebb75d26d3c62438e3bfb43e73a14a6aa3cad94babb5d0e88b95af62e3acbccf5ba438d8e3b2a2a303e739d993e437774bb43307739603609ba2f5f0c3abea4fcba94953fbb4bdbc73a5809c6bafe2a28bbc692a63ab7030e3ac4f2d0ba4cd13d3cbacb9dbb9672a7bbb69131baa4fa7cbbcc20f73b869aa1bab103fabab9578ebb860caf3c4c77293b94b99d3bb1d6033de9b3cabb1e11f5ba5ca38d3a348caebbaa2b923b7c6d9d3dfa1fc73e27b71abc23aed23a34d8d0ba21b8e7383c103aba12b38ebb9dd6163a4e2ce4ba353019bbef0fcb3bd862ff38d33094b89ca5133c3f8d64ba4ac018bc3b749c3a4b66a9bb24eece3bc7d9f1bae98b50bb0d1508bb1d08ca3c793f0ebb7383c7bbf9e1ef3cc64872bbb5785839b2499c3a76b828bc27a71c3b9b23e73cd473e83ec69d05bc1b78a63972f8dfba326d533959f19fbab3336e3ac43594ba88cefb395a7160b9b99d82ba370e3039c3e1a4ba8adf773b509851bbf5db653bca85833b54f87fbb2ceea93bc21486ba235f963ae03655bba0de163c80caa9bceb1acfbc1afb603c1c7c7ebb43a0c8b954d5acba48ec733bd6c9abbc43a67f3e1b82a13eaa44debc8216953b2a684139b2859e39976ca8ba83b18abac81f83ba3f0607ba65ba8c3a349f6dbb637e503ac32e8abaeebbff3bea7292bbd47719bb5832163b287a57bc4d09403c016e58bb5d3f5aba3a4381bb4288973cdcd142bc742e93bc0aa9183d781655bc9f45243a92225cba4581bfba103d5abc76962b3e76aebd3e3c6ad0bc81a5263b14c9efb97407643964f698baae9694bbc3070aba2c3141bb992085ba4fc3d2ba3c709f3a156814ba573a4d3c104e50bb0599d7bb5e0295ba3b3430bcf817793c9bd295bbe04484bb116534bb355ee43ca12142bb4f6e39bca478693dd0eb49bcc4c810b9134f9f380693ddbb771884bb7810bc3dcb30cc3e9bcc8fbc222212bb04ea06bbdce4083a6dfd0bbb9f37473bb81196bb8217fd3aeb4559bba4de323ab3f286b93b3a02bb3301be3bbdb1ebbb6d5c2d3cc9e9c03b7474da3695dd093b5970463a64cd4f3b67aef2bb7ce22a3cfd8f1fbde9bc26bdddde7a3be24b49b90e7356bb2a788bbb29d4263c89351ebdc2c5943ed4d8ac3eaa282cbda84bcf3b113bc53a6cf94c3aabdf3cbb7f8aa13b1512ffbb118ca83ba52cbcbb4b39003b44815cbac3491abb1a2fed3b0e1622bc2f46433cb3ed723bf4353abbb70a263bd619253b63df9d3bcde81fbc496c983cd01421bdcc3132bdcc946e3c285449bb72c4cabb5c26f6bb6e1d3c3c53051fbd4a637d3e7a5fc33e33b248bdd0dcb23ba9519e3bb9cba239c03d99ba04085cba30f4ebbaa1c8903ace2b153aa63ab9bbf532123be07a4abab91e013c37ed93bbdc4461bb9633cbba81c386bcc1ab5f3c5f14bbbb854fb3baecfe84bba581b03cb3d476bcdc09b1bc99a8633dde8e8dbcd5a3703a8d07a2bae882eababef67fbc788d253e5487c53e11e4ffbc65e69cba56e38f3a0ac5333afaeee4bac5eb043b6f5295bb3274b73a671092bbd7946c3a566b9eb9e967fdba615ef63bd6f30bbc92717d3ca2513e3c040a663a327d663b3c70613ad555243b55a009bc4f20303c32cd5ebdadce65bdd19082bb6b4b033beba792bbc7a481bb50106e3cbcbd5bbd608fa03effc1b93eaeac68bdf49a3e3c0c381f3afb389f3abf4c4dbbd02ba33bf98bfdbbaf8fcb3b98f617bcf134a13b571bf3ba2d7d34bbde16103c061365bc6385993ce355c43b50629e3b93f851bbf5199a3b4f389a3ba13057bcbac7be3c1db060bd47ca6cbd6b239bb76e04c33b3b9517bc79c0cebb73be803cab2453bdd51b8e3e452fcb3e2a3b7fbdd5adf93b8962a73b4709843ad28a60bba0bc883badfadcbbdd70cc3bca01bbbbea09543b2cad01bbba9ea1ba5b91f03b49ff14bc11a11a3c6a8e5e396ff6cbbb8ee79a3a7a8c4a3b1e6f0a3bafb00fbc663ab83c66831ebd47f33bbdf88ffc3c0999f9bb430ea9bb74f8bdbb5012213c823c18bdf4a3683e5c82cd3ea53f5fbdce47263b0151bb3bafa4723a6273f4ba83eaca3a6bc482bb5b7927bb41b818bbe0c734ba818bda39ea8adebaaa4fc23b9a1bc2bb536f893c0b299c3c0dbdd23a493a8f3b7e3f16baf918a83a584fb7bbb8943a3ccda17fbdfb8a8bbd4e05d4bb6d2d2d3b5cfb31bbf6c253bb6c4b7b3c157e79bdaeada23eff38c43e3cc18ebdc4369f3c0e4d3ebb1865c83ab20055bb8bc8a73b58d602bc22aabf3bde7922bcfcc8ab3baaa601bb41b050bb907d063c431353bcdcef9e3cd65a0d3c70e5483cfcc8edbb1d31a93b15e8943bd4883bbc1eb2a83c64af60bd328a8abdbe3a8abc9d027f3cb8462fbc5a949fbbd7da4b3c49083abdc303843eb2cede3e5d2d98bd0bdc2c3c800e923b29279d3aea9983bb9194cc3b646f0ebc9b7ff93bad1128bcc686063cc8f787bb7e2c28ba026ca13bfdd615bc4d643e3ca3b1b73b0826ae3bdd3c15bc9ae00c3c5357e33a6c6ce9bb1e0fb03c15eb2cbd5a7587bdcf2c3f3c8ff0163b052521bc54cb9abb305d003cb02418bd972f683e4e98e13e3e7899bddf79313cbfc8b63b1095c93aef3c28bb273e1c3bacdd92bb57239bbbc6658fbb74599c39d61512ba674c38bb193a163c6c9936bc50a59a3c3a3ffc3c4e1b02bb014d0d3c93c8f539aa141e3b4d242fbc2fbbcd3c30c697bd9d289fbd9127e5bb26412d39fc9faabbce1c80bb2766893c88338ebdafd9a03e7698cf3e5cf6a6bd77fbf93c0ad193bbf973213b61a589bbad1cec3bc635ebbb4003563b68d400bcd4707b3b007bd2ba882270bb98188a3b8d8135bc4bc74f3cb3043d3cda1b9c3c518a45bc1e26db3bacfeb33b93c3e9bbd9afe53c8f2b61bd23ed8abd5c9dfdbce7f0ba3ce2a35dbcf824b7bb2283053be67216bd2154633e7e06f33e6189aebdd969973c5568a83bfcc3653a6ded35bbd0f49b3bb54bd2bba1f3cd3b53db18bc0ebcdd3ba06d61bbf5b256b9e013be3ae678a4bb76dcf33b7a9bd53bc412563ce45949bc7694093c0473893a7b9d06bb81264d3ccbb401bd856097bd1dbf42bbff53103c518921bce19616bbc95ecab9799da3bc1485433eb09af73ec36cbabdbdaf913c925b5c3b4b9ae43af04c2dbbf5aac13af4f4ebbaf91c00bc10cc83bb216cd0b8a27e6e398a394abb776b1f3c8ea536bc057b913ce2b2083d63ec113b56aee03bbda4f0b93ee1b53a82122abc06bbc03cf2f48fbdb152acbd3ff981bca4e9b23bf72ea0bb12c078ba7750753c7db482bd4740963e49a2dd3ee159b5bdfe68043d1bd0f3bbc1e2043bf14b55bb7ec85f3bee6c77bb261492b923be23bc9156693b636575ba7dd320bbfa80c53b78d408bc36d8413cebd4873c2cbccf3c89af22bcc9f0983bbc65ab3a30929dbb1a1e823cae4730bd06cd95bd258e68bd6db3073ddf5d62bcf7a7c0baf73d973aa8f3acbcc535393eccb3043f63eeb7bdc864853cc6dc223b805a6c3afe8308bb47e7623bf588a7bba52ca23b7e4a13bc5b8ecb3b50a73bbb6e7ccdb97b861e3a3d9723bb1c80b23b1838d13bf857923cf3a453bc05cde43b095a6c3a0cb2b1b9cf3cd13b5f63bcbcecca90bd3cfdd4bc3a7aa03cb35933bc0a4804bbff4c34bb9a04f4bb4d821c3e1ab9043f3229bbbdf6dd6a3c844f873b3cb5b93a18a50cbbe417803ac08f153ab2bbf9bbe15382bbf066e5ba4a5d263b811c37bb1bdbff3bf1941dbcefd0663c4b88d03c3959393c715b4c3badc515bbc039813a82c0f4bbb98a843c427960bd59a29fbd2e560cbd10be823c5412c0bb3cf5323a55aa223c25683ebdb47d803ec9f9eb3eeb0cadbdf827cb3cbf9bc9bb0669d13a007908bbbcaaaf3a5d3c91ba4f2376ba43ecfdbb751105bb8555403b50d302bbe5a98d3b0c9b8abb6a8cef3bdc1d463cfda9f33cc44344bbeddf06bbf6eca638e607ecba0753a63ba322ddbcf61789bd9124a7bde7891c3d6f8729bc25ff30b967fbfa393324edbb25360c3e51270d3f3bf2a8bd57741d3c6d08db3a02cfd23a41fe13bbcc23103b144e53bbb8bc543bc04ce2bb62b8393b8ab120ba45b5b6ba841ec03a2c9fa0ba9de1383b0873ca3b37b1a03c870107bcf984143b75038e3a5ec8bab9c9207b3b4bd88dbce9e779bdd4f649bd68b0da3c454710bc5fe50abbb3ac4dbb3050ec3af7f0ee3d1d600b3fa847a9bdd732ef3b7e0c943bcf937b3ae21479bb3463d0b9226ec63a1a3d8fbcfae0ce39b018b6bb3bef6a3b855f5abb9c41683c348f46bc9803cd3c4232003d2bae623c79dbf03aa26b9fbbfabdde392e2d1fbccda51c3c64df63bd4bc3c5bd96e7b9bc87c1893c7bbcc5bab29a4d3acd51af3c3e883ebd5124803e1d80f43eac26d8bd42fe053d207586bc5e50b83a4e4b08bb2198c93a08d003b8cc8390bb4a43c7bb98ef9ebb7256993bd87b13bb3f8f8b3b9a5ea3bb3d24e03bfc3b7a3ce519de3c29f390b81e60a3bb7df444ba3ead9fbae446b33be625c6bc16db80bddd259fbda508073df59a04bc003b423b6e25afba36e8a8b92658e33d0ded0f3f2d37a1bd4345483cd89541bba62cb73a640de1ba2485a63ab731afba5d516d3a47885abb34095cbad178853ad56ac0ba24dbe83aac7b7fba6f4e8a3abe9e893b4c13593ca61d7a3a3d8746bbb489433a14db4cbaf715233b26ef2fbc6ef105bdf3a78dbd2893bd3ca32f55bbdc4439bacaee07bbfc26e53bd2227b3db601103fd16a59bdd2f15e392b29003b8861c939eaa7e7ba9fe11ebaf7c1063a79fa8cbac47b4c3a19b623bba7c33a3a8e52d6ba447afa3b25e585bbb2adbeba8a8716378845c5bb057d0a3cb08e00bb1394f9b9015872bba6bb6f3ce7a78f3b0137293cddf4933c01029abbb445d6b9e6fc243a4979afba787f773bb981343e0c02953e5858b8bb8c2d23b5d56989b9ab001b3a13e535bbcb8962bbd96c9639e67c36bb9174d33ad2c93c35eb649139edd790ba9743563ce42f89bbbacccfbb9686e2bbcefbb03bc5ae1b3b6dcb17b9703e36bb41459bbb043ec03c3461613b9957283d875f6c3c4c3862bb85481dbbfef8a73a574a83bb68ffd83bdc94923db4d8be3e92d15ebc8f8c7f3ac04915ba0ce73f39e3c689bb083c16bc08cfa83a001f00bbf526c4bb510f4e3c02d4e3b7b14883398670bc3c3b477cbbc751c6bca3a5943b63dfa43c0f2640bb41582d3b534cc2bb2149b4bbd328263d6b95483bbae46b3c39d1913ce7cc56bbf3ef0bbb67e4a9b8f94e2bbcac57fa3a23c4593d7b5fd93e70c31cbdce8a5ebb9491ac3a5a992339b82995baca04273a085187ba6de8043a57387e391dcda2ba4f8610395ec986bac02c5e3bae3e47bb6529523b8a957d3ba18262bb57af943bccd57dba6314883a523d3fbb05ce103cc59aa4bc913ab0bcab6b463cee476bbb426607b918c394ba4e566f3bcaeeacbc0a47813eccbd9e3e2c2dddbcd00b9f3beb72a8b92554923909e8c7ba35e49aba6fd0c8ba3dd35dba4bcce73a19ab85bbee880d3a772088ba85b8073c42bbb5bb668892bb6868c03a12fc31bcfa1e183c21fe1fbb41c788bad1dc6bbb3b3ea83c7ae129bc65b2a33bd846f53cf61634bce531af391d49fcb9b53888bad83467bc9401313e1d92b13e97debabc7fefb83a4f540fba48cc043ac63d47bb58e0a0bb63d312bb5baa06bcb7f561bb5d2d893b12d6293ac920b8bab9be993cb1ce13bcd57d48bcaf458a3b9ca4f73b1c070b3c9e2d9fbbff098cbb2a3c8fbb4080343de74e8cba35472f3c28172a3d6db53cbca8f71eba0b9c18b9c402bbbb0a333bbc6078013e31edb03eb2b696bce1c18cbb5586c0ba7cffe639984600bb59e6153b5d5686bbb07efc3ad65630bbabb2b0395fb672b91bbad9baa017a83b3a97cdbb47a8223c82cabd3b664c94b7452bee3a9ac6373af289393bb7b2d7bb3276193cbf2620bd08781cbd2fdf363bbcc610baea322cbb00c376bbc3131e3cdaeb1bbdea9e953ea773ab3e79e92bbd2e4be33b2f004a3a6e72143ab14215bb2c20863ba69ad1bb0640523b2a573cbb10883bb90fcc11ba47d0e8ba6562b53b6b9918bc398f233ca5602e3bc78922bb8c3b1f3b8280133b527b863ba3b0f7bb72ea9a3c1ecd26bd8d86e8bcf4c3163cc64e5cbb6cc5a4bb11e8cbbbda40163cc43d1fbd9668803e5f3ebd3e11b83fbddf9dd93b8ff16e3b21d4aa391d8bbcba03e01eb96b782abb984558ba8f8aba3a29daadbbd92d963af89f3dbaed3e0d3c0d8adbbb06e6cabb994e89bb1eb12dbc0e1b0b3c8bde5dbbf121bbba15b487bb2b30ce3c2c3493bc50dc363c8d5f413d3f7a89bc1296be39dbe0e2ba1a2511ba35ce91bcc19d373eaba3b23e886ceebc34312abb9904093b03611d3a8366c1baf60be03a3dd79ebbce83863a7fd071bbd823323add4ab9b921daebbaa6bdd13b58b7e3bb19cc7c3c36ba4b3c32e50a3adcdc303b89f2923a82e4153b28b1e9bb8f26173cde4364bdf03c5cbd2f4fbfbb6c3f4f3b7b5785bbe67e52bbb2ae5d3cc86258bd534ea13e66e4b83eb68a68bd5169403cb1e893b9c1d44e3a6e3029bbe494a43b8c13e0bb9810f43a874b6fbb88a9053b2f41a2ba0bf3d6ba06c4c33b089145bca7b08d3c6f96df3bafd6753b6e5f80bba4468d3b92a7673b764c2cbc8bf3c13cfae475bd569b32bd975fffbbb974073c8198f8bb70c194bbfd5d613ca4d750bdbabb8e3e9f0ec83e319478bd3183093c24b02e3b23e0e0395ff133bbbcf9b33b2817d9bb81f58b39e51d0a3bd45efb38bb180bbbad5bb938e15ab53ba92c2fbc2137153cd339b0ba65693fba8031eebb7918cc3b1a02063a836116bc50e3e73ce52342bdc850bfbc016a863cf9e889ba8288a5bbe9fc78bb75a73b3ceebb23bd704f6e3ed1aec83ecd6f61bd3f410f3b682a623bc8ee393a468aa1ba482d853a0b6c86bbfaf642bb1a53e5ba404d26ba7ed5c6394f5bbbbabfd9903b89c771bb14c5873c01189d3c353b7f3a9648873b3c9242bad1f3ac3a7a6493bbc529123cf4e283bd6e1882bd773c13bc88e7943bfe2325bb512f3dbbad90723cb06f71bd4017a43e4a12c23e4ac48dbd71a2973c1d0b64bb64f4683a197624bbb3f5903b4cb7b8bb02f2a9ba57b4ebba849b963a66cbeab81e2bb8ba8260c23bd5aa47bc1ca6b23c9569173c518ad13b396d85bbad92c53aa5f7033bab5c1cbc6317c33ca21491bdfc8d37bd2dbde2bc8d1da53c49e9f4bbc73507bbfcc3363c7e8935bd6aa0873e307ed93e2af195bd2f1d1f3cffc28d3aea179c39f2931fbb13dcc03b9a53bdbbcbba05bb6d03153a55b7fc3a9c3225bb19a8f5392a178a3b475060bc14de923cd05460bab740643c87ed86bc0d93213cc9288cb90dc10ebc2b1ff83c3b1d72bd666e16bd58d74ebc35458a3cd1a141bc3dd589ba12720c3cfb1c17bd6cff673ea507df3e43f094bdfe11ef3b8c1e613bc2ed843af8f083ba9ab5c33ad664b3bb309076bb75119abb3ae6693966e8d1b7628112bb46d3a93b8cf7c8bb5764a23ca587dc3cb92a663a9ec5013c9a102eba0c9c173b5238b6bbfd6a7d3ce10697bd51be8cbdcf568dbc77c4d53b8feabbbb49c792bb3e217b3cde0680bd71ca9f3ea2facd3ecc909ebda4f5cf3cb2ef60bbb760a63a4393ffba56afa43bba32babb64ea53bb2ca06a3ac6e179bb4ed4c23ab34308bbabc21a3bfdfc43bc2da7cb3cf916d73be741133c20dd963b22af2bbab866553bedc1e0ba113eb33ca0959ebd4192eabc988666bdbcd0de3c951f45bc97f7a6bb14945eba498bc2bcb6a8643efa68ed3eea24a3bd87fe583c2f15cb3b52605739f47fdcbab5ee8f3b2d9db3bb7bb6153b62b647bb3f542dbaa42f32b9cfe9c6391bd4013bcc051fbc1b36983cbdfa44bc20d8de3cd87f4fbcbae4a13b037f8037857b49bb392e923c547e55bd69acb0bcfd0d53bd893cfe3c7c6f55bc1dacf9baed455c3a001454bc8ac9363e6d13f53ef5799bbd0a11863b25ebd63b2077403af1e205baa0b05839a1f73ebb679cd0bb6c0797bbbde24839d8b93d3a323a0dbbefcbcc3b5ef8f7bb5147a43ce348ee3c0fdb7e3be744da3b334100bb048daa3a14c4dabb1961913c4be398bd7c6f94bda6cfccbcf69e413cdcd3bfbbbdc3e4ba719b553ce15d66bdb556963e5dd3da3eedc2aebd6838da3cabb0adbb7c41fd39da1b8ebae41b623b5032bcbb030393bb4c9d53ba9ab16abbd7da183bf23f1bba354d0c3b07640cbc90f7dc3ccb76f73b6a854a3cb24d233c3edfcdbb21ce153a635a5d38b095053c4c7c88bd996dcabcaf47adbde2650b3d67ace2bb25e30abbd5a92eba6e4182ba8334293e13e6023f3aac97bd3a5e6b3bb4976e3bc1b7ed383440aabad970483ba9aab9bb3dc3d53bcaa2cebb04b2eaba4bbebf3a87f7dc3969989a3ab80d91bb6bd1793ce245a5bc7e9df23c7e2ee1ba330940bbc71817393bf5e8ba6af1a73bc2a41fbd1bc1b83a45fcaabd0144103dab91d6bb4ce708bba6faf13a143fc53bdbb6003e5152023f74d983bd4b3dc4bb3d14b13bd29b5a3afd491bba0878b8b817340f3a53f503bc0f2558bbbc600bbab293df3ae35c37bb73b5e03b5eac27bc5ee0923c73afca3c1eb4c53bdb57aa3b5cc949bbb044ac3ac271d1bb625c843c13ea83bd645288bd8eae10bd6652983cedb6debbd5c9f5390bd4003c334624bde788823e740ae83e3d7eaebd8023ae3c2c3b89bb09085c3af3739bba64ef213b4c1c61bb960fb8bbd584483bd033b6bb39d20d3b985387ba3d66453b459edfbb997bb53c5617833b4ad3043c85cd863cb0cb1abcced781b8d3a6793a41098dba24a646bd937379bce19acabd0ae30c3d92b267bb4d971bbb913d123b3215313c6409f03d645e0a3f503385bd13e552bbf1f9303bb5bebe390fc65bbab968e13a73cca7bb3607cf3b867e8abb3b145ebb3530ce3aff669cb980bf4c394a102bb9ad2b633c49d4a1bcad60a13c7a9c3a3c8fa4febbdddd893a9bb018b92a1074bb17f80ebd8bf7933c1eaacabd7518f03c3f46eeb8b07027bb1036a43a80ba9d3cdadfb53da758073f415b58bd60a527bc20ad623b5ff95c3a97b48fba045485bb2bab383b6c368ebc842d1e3a222abdbbf41d6e3bc3bde3ba96db393cb05b18bcebf8c33c2194fd3c9083213c27c38d3b76d5a4bb657620bb9fdaa6bbf1d6ea3be3416cbdb2e1a9bd29b3debc9a0da43ce0d794bbbe71e43a4ea48d3c5b1a17bd6502753e6d77f43e1886dabd3814023dd09478bc9b93053a131b47badf23083b4f645fbb5e6e2fbbf01f523bcb24b1bba94a4a3a863133bae477d23a9f31a2bbe184723c92db843a7ef9b73be0619a3ce0363ebc18d99bbac1017c3b5e89bbbb1440e7bcf7ef8cbba9abd2bd5338f33ce75fabbaf144d3b9c076e43ac9c2943ce31c683d9f3b113fd80a45bde91d85bb638e43b92db4e339a6f669badda84e3a91e2efbad30d293bcf0b40ba5fd377baccb521bbf21f3cb93cc7383a7749923abb12b73bc25d2dbc6be89eb9ec91af3cc73adcbbd4fadc399f3cf2ba1537abbb31ff65bc896de43ccc53dabd34a79a3cd50c2f3b922881ba01d3933bdacb8e3cc0eba93cd66f103f43c2c2bc13ce58bcb0147f3aa3c3b939a8cbe2ba5d7a64ba0701a3378da072baf4f6b93adb8c2bbb422c143a100ac4ba77bef63bcdab85bbe2626aba2499563a458bd1bb1501fc3bbaeddcba9d2a20baf21a69bb83a96d3cf061bb3b64469d3ca116693c45a082bb3a9523bacab4183a71965bba9d5f793b12453a3e3d8f8d3e76afa2bb3b02b539583de3384a070c3abc6858bbc8c74bbb10e13abbb2eaa0bb28ee8e3ce18d04bc1c401e3add7883ba4841623cb8fd75bbd6e2a9bb896905bc3c6e0ebc00e8aa3b32e3c4baf7b71dbb0c4ac0bb5fb2b03ca3605d3b5a1bde3dae899b3aa19e7eba4e1711bbf925ac3a97c652b9a83b043c6b66893d0d30a43e7cc7c0bb08b101bb8f533c3ad483e838ece909bc3506f8ba1313f43b754841bc1b344a3daf1e76bcd4e30539b337183bd3b2f93c872c4cbc4cb2cbbc772e5fbc0d2222bd543eec3c6690debbbf7e01bcc8709ebc148b453d682572bc26133e3e20fa383d81cd8cbb02f8c93bd1d9613bab04b13b25e7b1bcd0f1843d7b39933ecaf74cbdd9d9eabb0788b3bb4e811639cefe97bad58ee539238e71ba13eb3a3af48991399033b2ba761fe638bdab83bab545563b0a9340bbbc08573bb121653b477f4abbf83d7e3be3bd56ba1e1e7b3a17ce35bbd68d0d3cbf159dbc142d8cbc076c243ccd8c41bbbf4c65b9f6148cba27216f3bfd78adbc333b833e549a9a3e1ff2d1bce1b9953b1c72adb9ba558739c0a0eaba978bcaba35f710bb5f3985ba3d57543bcc5faebbf8a3d839a0496fba408b0c3c43c0dabb5525c0bb7d35183bbf212ebcb8eb083c79b0f4ba9ea18fbab4c369bb7d81a03c2150b5bbf5aa053d4f50a93c3fa021bca67a1cb95613b338b2beabb9b30249bcd5dd343e81e6a03eda6485bc4d10173920bb86b9554ae0391b9c8cbb464f5abbc4355fbb8911fcbb7ef7653cca692abcd5281b3a586730ba8393923c31681cbc54f48dbcb8a1273c6711773b06f80f3c470d85bb545281bbb72ee0bba2421f3db4b5ccba8535a83df4e0ef3ce72e59bc6f5612ba4c22843a28ff6ab8ad264abc15370f3e68c9873eb9c430bcb533edbacd1f69b97168c6392582e0ba7072da3a520367bbcc3be83a54d30dbb36913ab87454d0b8f182b5badad0943bae53b1bbe985173ceef5c43b814c15ba904d0a3b763e66390246133beabec2bbd0af0a3c49841fbded2211bdd9600b3be6f97abafda303bb7b4a40bb90070c3c27c219bdcb0a973e7e12a93ef2eb29bd4c56f33b7101373914f5f23963728dbaa331513bb9a7a0bbe8bcd73aad85b8babf5127bb3c6cd5b9c95df3baa5c9423bb8f70dbc8b9bbf3bb793973b28f429bbc94b913b4017103b2b70803bb20a8abb82d7963c497a1bbd101c66bc47e2133b6d2a95bbdd5b90bb8831afbbbc22ab3bdd081abd8871813efa49b53e6c6b2cbd2f92093c9097513b55899339ca6e173aaff52d3aacee81bbd950bbbbf435bd3bba3e21bc6ff1ff3909cfc1bad0408d3bc4f910bca16c17bc3d35873b4d70a3bb3a550a3ca4bd03ba452733b9703ac739eeaccf3cc76b80bc2df02d3debd9b23c149681bcf09867baa66c11bbe8b45ebbda959ebcbde03c3e1236a43e9073b4bc6af1eb3a5d98213b0e96fd392668b9baee92d73a43ca9dbb8657fb3927cf4ebb1873313a0ddf7ab920ac9fba6feaae3b3368b0bb6e116a3cd0045d3c169659b9a88a253b2e452d3afc84b03a69a7b9bb666df73bb27563bd272652bd0a8ad0bbc2fe353b783b47bbc34225bb82ed573c51d758bdd2c1a23ea590b63eb20b65bd0ff0423c5e8e8cbad1a40c3af308e1bae8fdab3b730fcabbbb040bba1adab6ba01b64339ce9b2dba1fc0afba36a4813b083c32bcf1ca383c782f543c267bbbb8a92e84bab67d2e3bb6e0423be72d08bcb023c43ce7d375bdf09efabc1b8d7cbc9943083c03f3bfbbca5f5fbb0e612f3cb42d4cbd363b8f3e176dc23ea46564bde096123c48ecec3a5c36d6385dd6aa39f6e7233c63bcd9bb125729bc8481623b17232abbec46af3a7cafd4b9c08d17bb40daa0bc8e999b3b9885943c3786db3bbe2aeabbc04816babcb71e39890fe6b920222d3db34643bdf5d128bc173d95bccc10a03b342bfd3a9bcc973aa63d2d3b49955bbdbb47663e09ebc63ede590dbd0969043c170ca1bb15a3e33995ca69ba5a8b133a6caa8ebbd1ca37bb57580bbb7225b8b9d5be9439845a73ba3c18693b74350bbbfbe3863c4a42a33c3bc12db96a8d9a3bc6aa52ba475a923ade9966bbd9a7f13bfa1788bdad6976bdee9018bc28d58c3b1c4d27bbe43755bb078f703cc3466fbdfd42a63e0d4ebf3e98088dbd4b70973c11c151bb5ed7133a5c9fc1ba4255413b560455bba6c167bb576de4385bb4343a8e5d89392dd28dbae7799c3b48461fbcbeb56c3c2787973c8d9df0bbe4a28c3b6c0600bbb9d6a83a9e700fbce19cd73cdceba5bd4376bdbcc0c407bd0b60983cc50e9cbb568a29ba1dfb093cb28e2cbda3ab8c3e6e4acf3ebbb68abdc903113c9c0f7fb5310b94b84c3948ba4194ce3beabc9bba32a66bbc4643f93b67aab6badb0bad3ac44d1d3a8328de3a677b8fbc0601143cf161af3cb0637e3ad0b4e6bb9ed927bb2650e6bad87be3bbf2862e3d921191bd9fc109bc7c852fbd8682d53c44c0e0ba1474943b4d3b6f3beeaf29bde233663e86f4d73e2ecd59bdd3bf603b736f78bb3f0be139df24ac3768b80c3a4aa2b3bb58ef67bb549babbb1daaa63ac68fc2b93bfdbfbad6be743bbcf58bbbb45aa33ca790dc3c9242ffb9cabb093c4421a6baaf37e83ab0128dbb8a2d5f3c7a589dbd982d83bd169c8ebcd944ca3be77a98bbfcd47ebbc1b0703c3d657abd55eba23e2809ca3e9b379cbd029cc63cf6c87fbb8564893addecbcb95f3ee03a92ec97ba9c6401bc6c84263aa6420dba4647ddb98f810fbb1be3413b21354fbc26dab93c9775b53cc28d57bc13ce9a3c9e8f7dbb2799143b3652bfba67bad43c1181ccbd4005dcbab7407bbdaa769b3ce17d03bce3fb77bb7d2f22bb6a7bb5bcde73753e7be5df3e346f8bbd1a953c3cb845ad3b08b2bdb8e31e8dba03a2663b5035b13ad4f762bc6359443cf1c764bb9760043ad0c24c3aa587503bf19772bc4abb8a3cbeb9b53b178e3dbc2525243cee92a6bb0dd5c2baa1308dbb9e82e03c876fa3bd5c12183db94a96bd6cc1f43c838f32bb9089d539cc7a223bfb672bbcd70d3a3ea1c9e33e74674bbde70412bcd8a2443b76e194393934ee394a296abaaf0949bb6865c0bb5ce9b6bbef350b3b4bc81eb9331be1ba4839af3b713fbfbb287aa63c3e28f83c155bc7394de6003c122926bbb51e883a5d04cbbb333b8c3c16b8a5bd549786bd6e06cabcb1a03a3cd97eadbb6365beba13c24c3c653c62bd2ee89a3e8d72d53ef066abbd99f3cd3caadf9fbb40f53e3a23e114bab854373be52a48bb348b2bbcb7500b3a03be153b0b0111bb515766baf1ca243b39f270bc97a50c3ddfdcad3c4ec289bc9f8ec33ccf06cebbad12e339252de33af43d813cf8dcd1bd34ce833cc94baebda3c2a53ccce741bb0d172cbb05d57ebb6104793b9a23373eb6e0f43e4b7169bd1c1ee23ab2277b3bfc24adb91a5663ba2f6c443b2362a7bae3eae4bbf9e31a3c1d3e50384a95cfba83cbb73ab898dd3a346326bc1ed3bf3c54b38ebc45bab5bc8032ba3c5f4de7bb6a02eaba2c24b2ba3eee0c3c748892bd83b9bc3d9e57c2bd068a983c8dcb8e3b1c79063a28f9a73b2ad3383cd59af93d2c79ea3e16eeeabc6e947fbcbd0902baba668e399ce54f3a80a8e1ba94d9a23ac3fa09bcfa2364bb17a7f43a5117023ad10e26bb3b95b73bfc6c14bc0d9b9c3c814dd73c425dda395786df3b4bf386bb70dbda3abd50c2bb0fda8b3c314997bd2e7e6abdd7fa07bd6b0f933c084cc3bbc3aabd38b840e93b33b521bd64e3883ed89ae03e55a0acbdcb22a33cff5562bb23d95e3a726dbabad3cc6e3bb33759bba0272ebc81a16d3b47f3913b2165acbb65bfefb90ca0533bf3996fbcb497123ddb517c3c0828c9bc2d52c83c15bdb8bb42dcbeb9ff861a3b2f77813bd608b1bd29bef93c78cabbbd924fb33c94f7e1b904652cbbe9772cb915b0ae3c9141fa3dc240023f63c051bd30a2c4bbae951c3b51455e39173c4fba910fc73a86719cbb1f7bfd3a686c893bd225813b9544b6bbdfe3a63886b87c3a10312abbfd6ae83cbcad00bdb932ffbc2337fa3ceb9150bbef2c123a65b0443afa04e3bbdbe196bdb1ad013ec0bac5bd5902803b1176823bfe3229bb079d243b2494ea3cd5ddbb3d548eeb3ecd91aebce69536bc2d55923aeaf78d3a7e3886b95a339ebbcab5703ab90183bc32021e3a81ed74bb00cae03af1941cbb8c65433cc74829bcac63e93c21c6f63c56709b3bd5b3ac3b25b291bba979c9badc846abb317fed3bf44889bdcf7292bd5d3ddabcddc4b63c90c08cbb386355b9b8278b3c44c81bbda168813ee387ec3edb03ddbd21e6043d39f081bc8f16493abb5bdab9d1f7d03af671ccbb8149a6bb15db973bc129a33b0138e6bb22cda6b7f862683be7482dbc0a5e003df64f733bea87e6bc7d9dc53cb73ed8bbbaf008bb807ec03bb93e00bc0c4c59bdab86373da6e0bebd1b55c23c222ec7babb4801bb5d42dc3a9123e43c56bf2f3df8d70b3f628e19bd473eefbb6d75433a20e6bd39751297ba9dacf13ae869d8bbc644f33be37ed73a0bb1223ce01b15bcc73ded399834613adadb063b679aa73caf1322bd6cfa47bdc1eae93c43a8103affdfe0b908a9daba25d741bc13f20bbdc5d1193e0078b1bdd60484bbf2c4223bcba927ba415dc23b92e6a43cf221fa3bc5bdfb3e24f6ec39dd92f3bb6ce113bad999b83949fee3bafae052ba170a2fb93bffcfb98c2bb63a16ad33bbd52fee39812bb3bac302f43b19d6a3bbe3a77439ef28163bea6ee9bbb395f33bf9d1c3ba923023bae97655bb2464633cbcaafc3ba79dc93ce738353cac2f69bbeff2e9b90e03233ad49cb1b9db26903bdd67423ea5a5843e2d2f1cbb0d80d939c7ef61394b45cf39936c26bb128412bbe21593bb283654bb518f3b3cfcaafebbaffd003a728d46ba7e31363c1f19b1bbb367c23a2aa2263c108fb4bcbe99313c4042ddba1151f3ba3af28dbbcf04743c2e3e5e3af8cf113efebde6ba238bc8bbeda9fdba87edc23a048d1a3b8677583c4dde963d5e12873ef0a6f43b37229fba69d0a93a5d114d38407b38bb4f1c563bc99e99bb2e89583c3ebfd63a2f11efbba8550138fa1897392eae4c3c45d252bc051e11bc1e71823ca22cfbbc57338f3c25bb08bb15faf5ba6ea30abc0335c43cc38b03bd8d53953e93c4193d4fa8f3bb28d6923a70d8963aa7915a3b1d6f33bb771f9e3ce5e1453e67e05abc8b01e439baaa61ba3559083910ed94bab15b063919871cbaff8b553a05205f3959f5aeba9bf99938e3fb6abafac63e3b83643cbb76184c3b3c126a3bb2bb42bbf6f8653b14b654ba6793313a478717bb8d73083c40eb8dbc2fd666bcb3f6093cac502ebb1c8325b9aed377ba0ee8733ba69eabbcc33a853ee629963eef07c4bc8d568e3bd52ef6b952d16d396479d7ba3e900dbb046f30bb4e0d99b9559d0d3b840c9dbbefbf8d3905f65dbaa94a013cb9f9f6bb4adf89bb574beb3b07485ebcd703013c3531afba8db284ba58d869bbfa91773ce957273b7fac453de656603c602813bc9ddf3dbac0e336397fe21d39622df1bb04183b3e045f8f3edf5301bc24235d39e5be063948ffd539108e3abbd1b2a1ba011720bcba477a3b38f5213cd0fc19bc49af4c39271aa0ba89b3453c627d21bc060454bc07fab73c95b286bcc268013cf4490cbb3700c6ba23adeabb5324c83c3d8f993bb949193e26b2663c84ab39bc5a5e2ebb0f86ce390464a43ba716cd3a7f98073e9370473e2cc1b33b786ddeba18e8773ac0a78f399f52c1bae9de203ab8031fbb25b0cf3a2a0406bb1227bdb93ade3ab8a66386ba4ad8853b5e429dbb9343073cca3ae13b31fad2babf831f3b7c22aeb88925f23a1529a1bb8382e63b52f318bd1bc008bd4cbef03a2b769dbafb10a4bab5ca26bba256003c506c17bdfe8f983ef8e3a53e06a124bd46faf03b305cadb93754d73972b9a1b8c98c0f3b649276bb07791a3b77e732bb566d77bb6bf49db9a80af7bafb733e3ad20b0dbc3e4d033b20f6003c90996abb1048f23bab71df3a02626f3b47e723ba77ad7f3c6d36f8bcef24a6bb36c24cbb2ca5cdbb60d375bb9a4796bba9beb93a612611bd2e28833ed8e9ab3e714a15bd1d05263c176a403b1334013a12993e3b90a60b3b875fb8bba60a20bb71c087b8466a30bc8ba504ba97e93abbcbb514bb090759bc3cc850bc11138a3cac8fc0bbbf80613cc0200d3bc709583b25efe03b6665bd3c6271dcbbbb20823df7ffdfbae5f798bceb2085bbbe68aabbe91816bc3373a4bc67f0423ec8ef943e73db13bc471b173ce58bb13b097fc03954deacbaa8b6a43a2a7695bb3612ab38c1bf3fbb77b7c139940cdfb8eb196dba6f43a13b228f88bb69fe553c4d0b773c3d1aceba697a5a3b0af58a3845375a3a848098bb627fb83b8acb60bd5a5f48bd4922dbbb3643183b6a6d04bba5a50fbbff3d4f3c3bb255bdb265a43e3577b33eb2af5fbd8fbf3e3c8911c8bab5b4ec39377384bac183b63b4b8a00bcbcce8d3bed32dabb83c1403a1e718cb916ecb7ba0ee5d63aa6ce0abc0536393bb661a83c5377a6bb4149983b57ae743a71c3443b5cf5a2bb246fab3c69565ebd50abb9bc04b49cbc81d48d3b580d8bbb2c4f35bb4c2bc53b216f3fbd5efd903e8e16ba3e3bf048bd707c2d3c763bb83a3a2dc739c2be523b87d5353c11d8e1bbe75f8bbb9b6921bc728abcbba9800f3b22e31bbb163b20bcde90b4bc7b0af9bbe689063dbdcf1e3cfa8c583c36d376bb8099793b8dda393ca55c2f3d3cdb1fbd6454c03b6a5c2bbda91428bcd754003a7fbe34bbacbb4ebc548b6cbd521e6a3e3648bb3ebd9092bc5f1fc03c341ec5b99e7f9d399fbd6eba0450e239b00eaabb69ec14bb98d01fbb20391eb9e12cc1375f87eeb996bb5c3b0b7150bac42a853cf8ffaa3ce0ccd9ba934eb83b3f534cbad04a023a749c47bb97cdb73bb7be88bd65c86ebdfda508bcba94453b911efebaca2a32bb8bd86c3c294970bde837a93e7048bb3e9ef288bdceab953c91d273bb8478ed39b00a6cba9867083bc562d7bb75dea73bd28205bc4e84863b330cffb8abbe88bad89d803b5fc86cbbdcbf573b29fef63cc8ed90bc6e471b3c768d58bbf210993a752b08bcbc0cbc3c13cfa5bd648777bcaf25f9bc744c5a3c30731dbba35827b8a7efdd3b99fb20bd0e5e923ef01cc43e41bc7abdff84063c298150babbc42b393bd4cd391c72823b5680babb8af21f3b244b3abc9e4a933b59dc133aa30617bab400b03853b904bc35fc3abc4794323d29548ebc9f58303ccf8cd1bb50e9353723e788bbf2d9223d4a239cbd8dd9893c6db541bd449b323c4b09723a0d3dfa3a19cd8fbb3a5e0abd2bfd723ec7eac53e758426bdb28ce83b0c21a1b9e0cb6f3976da633949037a39862cd3bb720b22bb02a4b7bb211dd33a6bc1eab9a50d8eba2a25533ba10920bb97599f3ceb40e23c06260abb14410b3cae7fdeba4ffea03a8df95abb7e903b3c0cfc9ebdeb2b81bd775b60bcd2e18f3bdacd53bbe1e56cbbd9c6723cc8a07dbd3096a73e53b2c43e0a0799bd338fc03c9d9f91bb08f14a3aa8f3193a0580efbaf42b0339f37be0ba0a1324bcfca1ea3bd93811bbd18ef8ba7a75743b3f59f7bb24130a3c250e2e3d8bdcd6bcb59b993c9ae080bb00969c3af21b8ebb1200f43cd9c8e1bdfe47873b3e9851bd0fe94a3c50eb49bb39d1aabafe0f60ba7001c8bc2cdf853ea51fd13ef21371bd59c8063ca260003bc4f2a239a4489ab960612ebb9aa6d53b2748a4bb717744bcb23b643c73307ebb587edfb912039d3ba803d1bb2af626bc4c09513d32063bbd7d11723cc58602bbbfd0e9b9e25995bb71bde53c1fd8d7bd6bb4903da97663bd0968003c5e53f13a2ce58fbaa159d3b8b9afc53a1cfb4e3e5ee4c73e2e4602bd58750abc1819083b5d87a4394c366a3a1c94d5bab5d97fbbad188abb43dcd1bb4692653b3ecc6bba4598d0ba6540913bdaf07bbb5f8ca23cd99f003d52ba34bb5767ff3b667920bb6338963ac4f0aebb99a3763ca092abbda5b881bd51eea2bcbfe01e3c4a0193bb498310bbd14b5d3cb1bd69bd27bca13e2638ce3ee9eba7bdb017c63c010b98bb9c3a793a3221fc3938e637bb1e46263bc3e9e5bb55d73bbc67993d3cba7abcbb1515bfba73608d3b3c2162bc4c83c23c551c393d3e4500bd8f2daf3c27a801bba52048b8387c6a39bc3fdc3c819a04becd3ee03cc6448cbd462a2e3c43db12bb444ff0badfe5cdbb28212eba97735a3e6e04e13e3e2650bd3c6f833bb0605b3b0c256b3999eb44b969af1fbbc7061a3c6a484abc702a64bcd7a2b73c26ace2bb3da318393c5c443be1f40bbcd328c73b3def3f3ddc3e83bd0e5a493c80fb233b60b82dbadd2b663a33991f3c105aeebd50560a3e06b16cbdf7cb9abb2a4d5a3b1ec5cebaf976023b1f82b93c84a1143ed233c53e1de0e7bb54ec1dbcbb6220ba1e5ff1394bf3793a61b01cbb9314663940e8e9bbe06261bb92ca3e3b83da20ba38d92cbbc0aca23bb596edbbff179d3c524ee23c883b6bbb4185e63b16c269bbe667043b553ba8bb26b1843ce06ca3bd050058bd765ce5bca2797d3cc55ea8bbb9c31cba6d94043ca72731bde297923ea9a8d63ed100a6bda75b9c3cd91e62bb6ca46d3af83896b8b12426bb336f173bff7c9abb40ae30bc0b9d673c50af07bc1c047fba2787b83bd6c591bcfeed073d96d10c3d926e18bd29ed9f3c0b5a67baaba6a0ba2ac5a93a3641993cb9cf02be5e83493da4cf92bd1b56663c12de51bac0e3aeba1ae9a0bbe8eaad3c36a0253eae20ef3e702b53bdec8256bbd02d1f3b2a63c0387e15c6b94a3c9bba4d88d93b085102bc880cb1bca6d5ce3c20261bbc0f488c3a0f80dd3a87a93fbc1883c23cbd3a0c3d6f8f6abd3c7c353c2b82c73bc5379eba6244ac3b79731d3bcc3405beb948293e93fd84bd44da41bc3b8b3c3b9fa500bb50663d3a9a97fe3c245cee3d560cc73eeead9e3b3ec1c7bb14caf2badfd810baff91573a31c993bbd7d5eebaa65a57bc15a56c39dbc12dbb2724633a4ca5a6bad1bf353cdb332ebca149ff3c5ecaf53c62e7b9ba7e70e63b75fa9dbb63aaabba011142bbdf65e13b463498bdd9b783bd57879fbc5cf7aa3c784640bb87993cbb7caea23ce13135bdffcb8e3ecd1ddf3e099bdbbdd157043dcef97abced9a873a8e10003b58478fbb1f4447ba6475623a3ec30ebcd4c23a3ccc2911bcad3d19bb5348093c41c2a0bc502a2a3dbc52ee3b0c7c19bd80e7bf3cae1988bbbd1b09bbd92b933bc351403b909fcbbda0089d3da92a99bdc081b83cc0bd33bbcb31b03ab50667bb849d043dfbfea53d5b78013f341046bd642a75bb327906bbe72d173a1b3b98baa8e62f3ba3e0d9bb0bff2e3b5b1a00bdf271f43c0e4b36bcd8e5393a5212e63a4d2011bc71f6543dee43c5bb339262bd1c15883b8e43e83b4dc6d0ba64714c3bde422fbc866de5bdf58d773eafdf5bbdaa9d4ebc73cb543a95f495baf4a39d3b03c9db3c27d4183d9c7bc43e2809883cfa3a2fbb0787d6bad818a53987bcdbba14da4eba264d7bb994681d3aa45fe23979a81dbbfc1bbf39ff019fba4dc8ea3bd71bbabb3434da3acd2d763b11cef9bb85a3ea3bda6ea6baba1b42bab9024bbbb0d2493c26e23c3c7177cd3c63eb273ca6a056bb21d707baa396093a1ba5b2385b1a9c3b543a4c3ef09e773e058182398fe6363ad15aa439dcac9e39ea2319bbac6b76bbe9eb37bbb86b333c0082d1bb457140bb437a8e398273dab932e2123cb37223bc2a29203b79d95e3d0480cfbc7d11043c0e9378ba3394d2baf8ad0abbe967293cdd4de4398db0fc3dd59f013bf57c09bcdf3f77baa38ce43a65aa8e3b2d91a03cf37fbe3d37c4533eb5bb9e3c1947433a26334d3a56521c37ee16b9bad5fd8ebae77d3cbc94e9463dfc7152bc25bb9fbbbde94db6bd8e8138e020093cb905d2ba800b0ebcecf74c3eb972a1bce2a1a8bbf19936ba12db77ba56ff3fbca3f3a63b0f6efdbcb3bf063edf72b13ca06191bc83e702bbeae1803b0a01363cc63c033c61f6753d65a8b23d8d67ca3c4f35ae3cb90a73bac4cee93880ceafbadbead6372db62cb91083823a7bb380b86043bdba59f59838682d54baf4be413bc01741bb2204513b98ce6c3b15d44fbb96e0603bc5e345ba103c1b3af65411bb0c45033c98ec79bcfda74bbc4049fc3b7e151dbb534826b881fb4abae54b663b84b5a7bc7661873eb5a9913ecc2cb7bcf38a833b27cd03bae2844539fb91e1bae9774fbbe5b99cbab2a32e3b0adb00bbca0d66bb99545d397d813bba6f16ce3b542211bc23530e392aa9543c451c5ebccaf8d23b2b5f83bad0775dbaad9855bb77cd233ce39d523c0b3d323d9595173c52d8e0bb364445babdae98387f01473aedd6e2bad690473e40c67f3e6dd8d9bafd95203a55242a399fecb039f41333bb6b53b3bb85b439bc2444013db47841bc19ebc3bb7aed433933477eba544ffb3be61311bc8520f1bb047da23d6812b9bc11468f3b7acd9ebaf39d29bbb2ece8bb0f587f3cd4d45f3c396cc03d3473013c5ebb35bcaa9059bb2dc1233b9b24da3b4fee8c3c7286093e9562233e9c43ab3ce78fbf3b71ac673af1e57739a23095ba236d01ba657ea4baff9fb13a13cd02bb1ae106bae47c1c382bad69bab837653b4e4e83bb0e19f03baa8ef23b64ee1fbb3b222d3b025466b9f858943a770381bb129cbf3b024410bd50d502bd6106ee3afa22d1ba318e2ebaa48af3bafc14f63bdcb016bd69419a3e3081a23ee75a1fbdd82ae93b95dd3cbaa71f98393bbeb5b687e41ebae06d02bb2e3a9d3bc93c9fbb4eac27bbc547b9b871139bbab6a8a73a2e55febb5b914f3a3bc2143ce352d8bbf8ede03b98e2223a742dfb3ab63c22b959891c3c69eaa0bc3434c0bad1ec4ebb20ae97bbd20fe9bab75921bbfd7eb23a0bd1febc5ff6863efa43a03ec21705bd30b5063ce180963ac337a739301e853a4942f1bad837dcbb275b373c4acd16bc32a0c4bbfdf087b9048fa7bab321e539678c3fbcfc662abcf659bf3c8a965dbc0854233c82da973aca5ca73ae581113b26cf283cfb7a0c3c08eb6b3d4f5de2bb9b1a44bc8b8f06bbf45ef8bad1628dbb149218bc8786513edfda853e0fe3a2bba449d13befe9223b6e0b8539d93d91ba024675399a3482bb25f78b391f5354bb182fc239c52c5cb8306622baad08963b8a7d2fbb9ed2433c1299733cd0ed10bb13e5873b00fb8fb95b13ce39261064bb98b3323b874f56bdefad42bd5e8eadbb8ecf943ae93cbdba3957fbba392d413cc64750bd5b61a63e3791af3e7d735abdb9e9383c1be9c9baf4dc9a39e5a662bae6df773bd9de1ebc7cee423cf4b342bcce0c0b3b53678c36657e6bbab4a4e13a2bf7a5bb872166ba52ecb13cbc6826bc0dc7d13b54372cb713d7ea3a2d7559bb27a53c3c30bd32bd2d87a2bc5bf461bc7391d63a6d3506bbd9d0d8baecc69c3bcba025bd9291943ef602af3e12fb37bda1cd173c91c92e397439a6394716ad3ac5399f3bd25f39bc7f5c8b3c8ec997bc08d0e9ba64875439160eaeba322b91bba9811ebc8f194cbc1071de3c48bc0abcc7796b3cc85a8d390b761f3bcda2a33b98ba9f3c88fdcdbc41f99e3c3645ccbc0a0a03bc43c430bbaabc17bbec1ec0bb189a16bdb0df7c3e77e9a53efbe3d9bcf4e7823c5ebdc33a5a6b343900567cba43382e39f41ac6bb676605bb878b34bbf443d7b9e3babe37d83db3b9d18f633ba9dbc639bc26883c0211ab3c374eaaba54adba3b96f051baca16b439401a04bb9b74583b251486bde8ba6ebd8cdab9bb80bff13ab3428ebad5ce43bbdc786b3cd5c86fbd669fab3e955ab73e8f2d85bdb0388a3c044674bb91ac5b39311e12ba4809363b57fd5cbc24e2933c1d6c8bbc05e6b93b2296b938b21234ba3dc3053b87ef053bc29d75bbfdaf0b3daf5fa0bc154b1a3c244c1dbb718d8c3a4069c8bb0f7f6c3ca3b18ebde8beaebccbc2a2bc0300d73b70e187bac52e0eb9184ec23b56ae1fbd8968993e8958b83e1f5e61bdd54a163c24ced2baf42d1d392a2f003a0646603b688fc8bc85fc363df4312fbd5737513c171615ba612022bac2f195bac31bba3b0b53d6bcee36543d7682debc1d0e513c433295baa6b14b3a133062bb9330c43ce3e17cbd6425423c6149c8bc3eea9ebaa611aaba330da9395d0cadbbdf83a9bc5c33823e2aa9b13e0f1a10bdbb98cf3b64a08c3ad62eb9b776d132bab072e03a687909bc39fe47bb73fd5cbb31194f3a2a98e9b952511dba602f3d3bd8389eba551ba13c2f2dd83c9b671cbb3211da3b4c95cfba0e19983ad1f329bbbd401e3c806699bd924384bdeb80c9bbb5d62e3b6a44acba0e5884bbae627d3ce09080bd73a8ab3e597cbe3e5ff393bd1b03ab3ca58aa0bb7ac8b1398d645e3a085d82baa40e08bc011f743c4abaa5bc522b1a3c8401e3bab6f7ceba1b24e83af67d323bde51b6bbb5bd3c3de6b4cbbcebc34d3ce3ad20bb380dfe3aa936d4bb0d37cb3c1017c4bdfe944ebc2d0cf8bc8971103cacd704bb83bf6dba11c3343b6c6708bdfdee933e1e4bc33ee03d73bd43751a3c987b96b9269a86395a76973a7e8cbabb097e3bbc6ddf513d2b8286bd463ee83c1fc78ebb0e1325ba60eaeb3a655c003c958c38bdc2c2a73d7ede0fbdf10a943b7ff1053b0c022ab9c7ce1abb9d81f33c7a9ec4bd54d4073d4671c1bc23edfbbbeaa8eb3a53ac0dbafeee92bb5ac33f3a0e4d683e300db53ec3729cbc14ae6ebb4d67173a2895ab386fa4993a7539e1ba794fa5bb70da1ebbab31d0bbb193693b6e1447baf879b5ba41f2743b63bb32bbd1e1a63c7d67f13c1dee6fbb0ce4dc3b772015bbef405f3a3d3d41bbb3a0303cc15da7bd69fb83bd8ea455bc98cbd03bf3e338bb9dba4fbb51e2733c06977bbdc0faa93e7f33c53e46679ebd54deb93c6bcd96bbe66aceb80cdc1e3b4c03c9bb05810fbb9a02383c2c9cd4bc8ce7603c1acd8fbbacb18fba36def93ab5d68039fa05073bcd085d3dd695d1bc3815883c822710bbb90d363a6f0585bb5b53fb3c4a2e00bec386b93be10e40bdc981f23bc5e71bbba5c19cb8fb6a9fbb0b0492bc89a2873ed3f3cd3e110b66bdda92243c4f65a53a54b1173ac57aa73a834b4bbc5ed32c3c86492a3d2fdaa6bd75a8183d9e51cfbb82aa3bba35f32c3b0ad33f3b93da4ebdaeead43de59907bdd85d8fbb4787943b46e4f4b921dd663be459d63c5f6305be5ef2a13d31afcbbc489c86bcdfd4203b6b68fbbadd8477bb66b98f3ce87d413e04dfb03e0cb62f3b771990bbb5aa14b9928702398767523a870918bb5552bfba7d36a7bb18a281bb40e3723b7d72dbba1deed3ba3ec9793b647e91bbfdad9d3cf091e13cee62a3bb2482ba3bc5bf00bb9ab7a53a94b021bb6926283c0ad4a1bd734461bdfade9cbcafc6343c487285bb00fed3ba3c2e183cc14f48bd733f9f3effd6c93e16ae9abd70f9953ce71648bbcbb79fb9a206723b272c28bc5cf16c3ba9221c3c7892d7bcdc808a3c4a92eabbb129a9bac003613bd7ce45bba610263c899c353de5e0c9bc96126d3c6078d2ba56ed003a89f495bbfc5ef03cfe560bbe4a67d93c091b5abddfc6503ce1f256bb5d71223a5bd6b7bb28a01e3aacb26e3e2dacd83ec1fa81bd9da3d43b763ed33aa0bf383a796ddf39570983bc1d38c43cf603e33cf26dafbd8d8b333d54d619bc73a7b3386e8da73b33a9a2391f9426bddcb2e23d5615a7bc66d650bc933c013ca55befba8bd77a3b7a69d23c212728be92a4cd3d009019bd0e1678bca4c69f3a3d2822bb930a3ebb60aad73cbaed2d3e1ce8b73e8d47b73bad9591bbac2b073a4d5a94b950d9943ae7eb39bb658dd7bb5f2c05bc7d8e58bbdb604239f689feb9f3738dbaa23d233c55f71ebc126f073d863ff13c930c26bbd529063c099009bb8d0b34bbc3a68aba03f1f03b89439fbdd1d284bd8c2457bc86a3693cebb6c8bb4008a6bb42b3ce3c422a73bd9495a03e99d3ce3ee7d4ccbd4ebf063d285847bce43eb8bae637c63be9b531bcd333403b1b6a243c9e3fccbc0018893c385d09bc291084bacea6e73bc5df50bc41c3e03c9fced93b9dd474bcbd6b953cb158bebb988b2e39edab25bbdd69833c82cbdebdf578883de93186bdd072d93c8d8dd6bbcfce8a39a63ec53af2a5203c39ac223ece41e93e0f228fbd4d11d03b0d5a68bb4e7a2c3ae56eba3a6be144bc0758df3c51e2063c80b4b2bd17af5d3ddeb442bcd2a8d0b954d1c33bf34b65bc9dbd053be958b03d64903abc55f4b4bc832fd43b7115c5ba2a89823bbcd4943c1b873fbea8b7473eb0cc1cbd0c231fbca2b0073bc9d338bb3e765cb92bc8133ddb5ab93d52e6b83ef655853b45a4b3bbebac403aa7059639ee63e8ba667757ba1372d339f07f823a65381eba3e3b09bb3521af3975bd9eba8b51e73b49afd9bbfa94643b112d8c3b0516f7bb12a8e93b93c49fba91e613baf61752bb4578393cf866833cceb3af3cd90d303c302351bbf8c022bac2e3e239f2f8123a7003993bbf52573edd3d673e792e383b305e883a8cfdb539125c7939ca5714bbfeaca5bb3047833b71da823c85b11bbc5b5efbba0340743956fddbb9bf84f03b109a2cbcaa13f93b7966263d44d58bbc9ac7bc3b9f9d40b985eaceba58f96cbbaf914d3cc9559b3c18348a3d7943123c0782e2bbce3f93ba6cd5f03a172c7b3b4480ba3c57fd0b3ee4cc373ebab7b53cdd4c1c3b9973a73a4d67ed38ee0400bb5f5035bc22bbd6bb3364b93da07fb9bb70e4fabb454be637f412033a9e3a2f3c2388cdbc8400b8ba1e4c0e3e5cdd87bcca63ebbbad6455bad2c2f8b9ca56b8b7a48bd23b4c963e3a94aad43d081255bb5d985abc94db76bab1f3263b968b6c3c953e4f3d4b93203d711d983d488c633d64504a3c5f19a03ae553d538ff1ea7ba1e8c5eb91253053a879d353a1f7eb0b8c917b5ba60b5c238b06c54ba9cce453bb2b64dbb6294593b662b6d3b35ae4abb1fba4d3bc2f855babff16a392dc904bb049ef53b9ec257bcdf9d4cbc5abdf53b2d6a17bb8c2f9a39f5e514baf176673b4a92a6bc69ff893ebea28d3ead7fadbce9a0813befde48baec001c3986c70ebbee6887bb991bec3addf08a3b0d4f89bbe48c2dbbab02263993f710ba74d0b33bc72329bc80fac93bb033423ce0a642bc4626b33bb4161aba319d43ba349570bb9d87cc3b1507bf3c0d27093d1516b93bfd979cbb4eb15aba0cb0b5370e4ebb3ad342013b676a563e16db673e5092ec3a3015bc3aa45217385a401439128298bbf53424bc530c1e3cec3e213d176359bc4ad5cdbb0642e238f474b8b920fc803bc3bd43bc675dfb3bd0d1363df6987abc71270c3b36fa44baa272a7ba843decbb3223b33bf8babf3c6667483d10a9a73b3395f1bb29a5dfba411a9d3a14ba0d3ccc92ea3c6aa2193e8cd1243e2df8f13c2b6c223c20622c3adc5c2139c2b95dba2162a6ba05a3a9b933d7ac3ad4221bbb211122ba763fe338792722baa8714c3b6faa75bb45e6ef3b1039f73b2ce04fbb1202463b23aaf4b975950a3ac4c230bb4ac7813ba02206bd9d7502bd8b9f283bf2c306bbac2e4038ae53b3ba1cf0e03bb96116bd05449c3ecb299f3e8ea819bd20bde23bcecd99bafbee113966e5c8b94a7494bb9bd8ff3ad6bbb53b06b4cdbb02586dba68b4683880e6efb98cde403be79afbbbc54e7d3b2125003c9a9e06bca163953bcc9cdeb886f5ea39c5fb71badd36393b26b313bc3b4c33bb4e618cba807c00bb511eccb9a22c61ba83485d3b3d83e2bc4e1a8c3e8c55943ebeadebbc3f97ae3b1d3d95b9a0c5b738f739a2ba35700fbc48c6e73a8698753c2c8050bc404a0ebb4ff643380d7284b815da5e3bcb923fbcb019843bd82d973cba347cbcf1688f3bc51dda382a702cb970d901bb3d5839bb3db8e53c0ab93b3d447af6bb848c83bb9476abb92a721139f0e5c73aa66adeba5ed15b3e388e6d3e7aca15bb8eab423b00fbe5393e3338390a977fba7f3f7bba2a0833bbe0ff7bba152a18bbed4abcb97968de374506cbb9b0e4993b32090dbbdce94e3c66cc673c8b7805bb9b7d923bc6367eb982482ab9eb5906bbfe6e6db9937c4bbd6cff44bd4da355bbc2babeb9625f78ba7a3cfbba4b04343cc1074ebde788a83e45d3ab3e14b751bd37da303c9306b3ba07b0443964df0439a97606bb53dd5dbbf42b153ce59621bce235ea3afb1045394d6a12ba490f3f3bf7fab9bb60a7803b73b16a3cca821dbc49399a3bdc3ffbb9a314eb3941e6a8babb8d993a87f4f1bc6c54b0bcec29bcbbf1589b39f881a5b9eeb54cba3a9ca63ba5a415bdd6b6993e2f12a23e74c921bd8491d73b24f248badb03c0388731c1b83006d1bb010523bb116da93cb8e59abcd528163bbadd2939cfef12b98196ef3addbee2bb37cab438c4e08b3ce86a76bc5c2eaa3b835f6bb878432938b0a1d7b7596c4dbb692124ba9950863cdd9c31bcbba197b8dc99aab9dce7e0b9d4285c3bb129afbc0aa5843e8f158f3ef931c3bc46cdb13be866fab9800cc33675a9c4bab672c53915afd0bb935580bb124d96babdc685ba1af46ab9d7ca17b99d36723bf49b813aa1a18f3cfcae9e3cb8ef8f39ef2e933ba53a49b93e543339ebe042baea27f13aa78d7fbde6af72bda8cdd5ba9f960e3a193db9b94d685bbb215f663cc90573bda22fae3e4775b23e070c7ebd8e5b793ce87675bbbb1aa639f511a3b99ff3083a2fe5efbbb1ce383cab7a2fbcffb92b3bbec1d1398bf347ba11b6013b5458c7ba8b91683bea9cae3c1e5541bcb29bbf3bd1b6afba6947263ab0cc94bac2bbd73a8d6149bd6d0e08bdd4d514bcc67a323bc1a836b95b9184ba0169de3b4c9b2cbdadc0a13ea0f3ab3e5cce46bddda1093c4506ccbaf1313838f23233b9ec376c3b67a5d4bc418d493d78f01bbd5f20123cef0c833988fa5ab8f6abf3ba8b815c3b460664bc7e86063d2ca6b2bcc0c9053c7ab196b94cc9ae37b581adbad704343b51edd0bc14bed43a1f6156bc24b39db8906517ba275123b9ea2a7539e1f0a1bc77728b3eee849a3e5611e1bc277abb3b635554ba44b92abad6737ebb934a283cefe65bbc1c2a15bc3cbffa3b085382bb218bffb949437aba28757dba3790abb9a0f3883c5e49903c4f8f60b89fa8583abe81deba34be713be0aacc3af891873cbc4386bded387dbde68e3d3c4a594a3beef83f3b6967d0bb48ae443ccf1082bd92faac3e0d72b33e2e0889bd239a523cc6a3c3bb2b93e139b7bbb1b89b1d103b21ab00bc544a173cd9f816bca3fd643b0d7989398a26dabaa4efa5bac08098ba347eb8395376ce3c249c61bc51fa533b90c81dbb4665243bbaeca43a798f573c150579bd4a9e08bdc393ebbb3578053cc9fc3e3a10120fbb379e9f3b7d2342bd4577a13eebe5b23e4dcb6abdcb16053c704d17bb17de33b95360403a9910ff3b608f2dbd3503993d8dda79bd31429b3c3ac2acba51a2ce38ab5e9cbb81f5873c4b9813bd4ce0693df47be5bc7bd51b3c93b5bb390e59d938087269bb94694d3c76925dbd5bd2fc3a01cba1bc7323ccba75f7eeb9812fcf3896284fbb014a5fbc404c8a3ef0e8a43ec727dbbcfd90923b10850fba6ff2c0394cda93b983a0023b30c7e9bb497690bbb92207ba6dbc1f3aed2feeb7e83b0fbb1364083b78b664bb6ccbaf3c5930c73c6dc672bb6751583b9ca824bbeb70c63a5a7b873a1a81023c386899bd13508abd1c3e2abab10a8f3b14ee8139412391bbb4877a3c964986bdc33fb13ecbf3ba3e1aec92bd5d51933cc2369cbbf530bab8b973c93a42ee1cbb7f82afbb193bd23bf2fd4ebc08eace3bddffc7baf3d577bac1204839fabbb33988b4f53be9800d3dfa2764bc6168e33b30d007bbc223a13a300763bafe59633cc0bca9bdd71d0abdb29e8fbcfc2bf83b709f6abaa18aa0bacb60613ba34a2abd0ea9a03e7e16ba3e2f7c70bd25d9303c7ef4d0ba4a1435ba3e491c3b44f122b9782921bda275b43d1300a5bd2715f83cfb4eb0bb9e39f8399283d4bbd63f063db9ce6bbd575fa03d178cfbbc4844023ca068b53a70a64839f0a4a9bb5910c43cc5efcfbd5d4bfa3c65fee1bc31b086bbe27c4a3a2377203a447a04bc8300763ae911863e6b93a93e55dde9bc0fab803bf44193396494dbb9c5b2993ad65de5baa03563bbc3283ebbea3f59bbc57a0a3b07907bbafa379aba620c633bcaeb74bbbda6ac3ccbccc53c861f89bb3002933b79d5b3ba1def87b98280ed3a2aa9e43a589594bdcd2880bdfbfb0ebcb66fd23b793a1fbbe70130bb50eb423c0aaa6abd008aad3ea399bb3e911a89bd005b7d3c50291dbbc2ee3cba55cd343be458d9bba57315ba3420883bf0785dbcecc4153ca3cc80bb9a39cdb9107a2b3bf0feca3993b4403c4aab133d8b2a72bc4fb9163c1e7fd4ba5fc7c53959664dbbbd91303c7593c0bd71d0e6bc4ac9d7bc7d081d3cb6f876bb98266db93390263b80eff9bc1e8f9b3ebed7bf3e2f8876bd35a9363cc639fbb9be88c4b93ef3983a2c1dd6bb9d47bcbc129b8c3dff8aa6bdb074203d37d233bc98fba13afbb49ebbb483233d2f6e81bd07f1ca3d01cec7bc651f083bd819353bd14e963a5b7153bcb7f6113d6a3414be3bfc483deee148bd518f2e3b35c9083909a96e3a7f46dcbb0388ed3bf1fb7f3e9490b63e73f40bbd3d4e5e3b9851b13a533530bbba36023b34ae85bb3ef5ecbba79baebbba8a94bab223263a6b2db9ba1866b43ad5ebab3b6f52f6bba699023d3fbceb3cd89a16bc49310b3c2cb459bac20ec0bb97bf333b505f2e3c9a1aacbd20e598bd75e2273b8de9a43b02247dbb8a14debb6206fe3c7364a4bd8a48b53e6cd8c13e1ae2babdc462093d20a62bbcee3035bb849c0f3c47012ebc3c76993b6fa4e43a84c439bcd5dd4f3cfaf38bbb782f62bbe013d03b5aa30fbc0154803c8058a23c03b58cbc1650143c983b46bbcc670abb24d1913b0f5d1a39366798bd3fcb1ebbc21d00bd1c26a13ca51bf9bb608455bb239a2f3c714b0cbd66b8943e5194bc3ea12090bd3f3eb73ccdeafebbb8be803af94febbb81ef9e3bc5d4fc3a547c1b3ce24f29bd35fe283d50637cbc2563003ba23b013abaefc63ba98645bd2704d43d5c2a2bbd8b0f1e3bd2832bbb8cf3d83a6235eabb6504453d224944be783b2d3e74bac6bdb88e7c3ccfac30bb76ce7a3bb55528bc8760143d95472b3ec308c13eb585f6bcdf33693b5b2491393521af393f3b09bb65381ebaf17f823a1072d339667757baee63e8baa705963992c49fba12a8e93b0416f7bb112d8c3bfb94643b49afd9bb8b51e73b75bd9ebaf9c022ba302351bbd90d303cceb3af3cf866833c4678393cf61752bb91e613ba8cfdb539305e883a792e383bdd3d673ebf52573e7003993bf2f8123ac3e3e239044074395c5efbba85b11bbc71da823c3147833bfeaca5bbcb5714bb115c7939a09d40b99ac7bc3b44d58bbc7a66263da913f93b109a2cbcbf84f03b54fddbb9ce3f93ba0682e2bb7943123c18348a3dc9559b3caf914d3c58f96cbb85eaceba9973a73add4c1c3bbab7b53ce4cc373e57fd0b3e4480ba3c162c7b3b6cd5f03a414be6376fe4fabba07fb9bb3364b93d20bbd6bb605035bcee0400bb4b67ed38af6455bac963ebbb5cdd87bc1e4c0e3e7c00b8ba2588cdbc9f3a2f3cf412033a94db76ba5d985abc071255bb94aad43d56963e3a888bd23b5f57b8b7cbc2f8b96119a03a62504a3c4a8c633d711d983d4b93203d983e4f3d978b6c3cb0f3263b60b5c238c917b5ba1c7eb0b8879d353a1253053a1e8c5eb9ff1ea7bae553d538c2f855ba1fba4d3b35ae4abb662b6d3b6294593bb2b64dbb9cce453bb06c54ba8c2f9a392d6a17bb5abdf53bdf9d4cbc9ec257bc049ef53b2dc904bbbff16a39efde48bae9a0813bad7fadbcbea28d3e69ff893e4a92a6bcf176673bf5e514baac022639e48c2dbb0d4f89bbddf08a3b991bec3aee6887bb86c70ebbec001c39b4161aba4626b33be0a642bcb033423c80fac93bc72329bc74d0b33b93f710ba4db15abafd979cbb1516b93b0d27093d1507bf3c9d87cc3b349570bb319d43ba9d5217383015bc3a5192ec3a16db673e676a563ed342013b0e4ebb3a0cb0b5370542e2384ad5cdbb176359bcec3e213d530c1e3cf53424bc128298bb5a40143936fa44ba72270c3bf6987abcd0d1363d675dfb3bc3bd43bc20fc803bf374b8b92aa5dfba3495f1bb10a9a73b6667483df8babf3c3223b33b843decbba272a7ba20622c3a2b6c223c2df8f13c8cd1243e6aa2193ecc92ea3c14ba0d3c411a9d3a773fe338211122bad4221bbb33d7ac3a04a3a9b92162a6bac2b95dbadc5c213923aaf4b91202463b2ce04fbb1039f73b45e6ef3b6faa75bba8714c3b792722baab2e4038f2c306bb8b9f283b9d7502bda02206bd4ac7813bc4c230bb75950a3acecd99ba20bde23b8ea819bdcb299f3e05449c3eb96116bd1cf0e03bae53b3ba68b4683802586dba06b4cdbbd6bbb53b9bd8ff3a4a7494bb66e5c8b9fbee1139cb9cdeb8a163953b9a9e06bc2125003cc54e7d3be79afbbb8cde403b80e6efb9511eccb9807c00bb4e618cba3b4c33bb26b313bcdd36393bc6fb71ba86f5ea391d3d95b93f97ae3bbeadebbc8c55943e4e1a8c3e3d83e2bc83485d3ba22c61ba50f64338404a0ebb2c8050bc8698753c49c6e73a35700fbcf639a2baa0c5b738c41dda38f1688f3bba347cbcd82d973cb019843bcb923fbc15da5e3b0d7284b89576abb9848c83bb447af6bb0ab93b3d3db8e53c3d5839bb70d901bb2a702cb901fbe5398eab423b7aca15bb388e6d3e5ed15b3ea66adebaefe5c73a2a721139ea66de37e949bcb91f2a18bbafff7bba190833bbc53f7bba0c967fbaf333383995367eb9837d923b717805bb6ecc673ccbe94e3c3a090dbba3e4993bbe07cbb9b75f78ba06babeb973a355bb6fff44bd907c4bbd116b6db94a5a06bb7a482ab97206b3ba43da303c14b751bd45d3ab3ee788a83ebe074ebd5004343c3a3cfbbafb104539e135ea3ae59621bcf42b153c53dd5dbba97606bb64df043907b04439dc3ffbb949399a3bca821dbc73b16a3c60a7803bf7fab9bb490f3f3b4d6a12baf881a5b9f1589b39ec29bcbb6c54b0bc87f4f1bcbb8d993a41e6a8baa314eb3924f248ba8491d73b74c921bd2f12a23ed6b6993ea5a415bd3a9ca63beeb54cbabadd2939d528163bb8e59abc116da93c010523bb3006d1bb8631c1b8db03c038835f6bb85c2eaa3be86a76bcc4e08b3c36cab438ddbee2bb8196ef3acfef12b9dc99aab9bba197b8dd9c31bc9950863c692124ba596c4dbbaca1d7b778432938e866fab946cdb13bf931c3bc8f158f3e0aa5843eb129afbcd4285c3bdce7e0b91af46ab9bdc685ba124d96ba935580bb15afd0bbb672c53975a9c4ba800cc336a53a49b9ef2e933bb8ef8f39fcae9e3ca1a18f3cf49b813a9d36723bd7ca17b9193db9b99f960e3aa8cdd5bae6af72bda78d7fbdea27f13aebe042ba3e543339e87675bb8e5b793c070c7ebd4775b23ea22fae3ec90573bd215f663c4d685bbbbec1d139ffb92b3bab7a2fbcb1ce383c2fe5efbb9ff3083af511a3b9bb1aa639d1b6afbab29bbf3b1e5541bcea9cae3c8b91683b5458c7ba11b6013b8bf347bac1a836b9c67a323bd4d514bc6d0e08bd8d6149bdc2bbd73ab0cc94ba6947263a4506ccbadda1093c5cce46bda0f3ab3eadc0a13e4c9b2cbd0169de3b5b9184baef0c83395f20123c78f01bbd418d493d67a5d4bcec376c3bf23233b9f13138387ab196b9c0c9053c2ca6b2bc7e86063d460664bc8b815c3bf6abf3ba88fa5ab8906517ba23b39db81f6156bc14bed43a51edd0bcd704343bb581adba4dc9ae37635554ba277abb3b5611e1bcee849a3e77728b3ee1f0a1bcea2a7539275123b9218bffb9085382bb3cbffa3b1c2a15bcefe65bbc934a283cd6737ebb44b92ababe81deba9fa8583a4f8f60b85e49903ca0f3883c3790abb928757dba49437abaeef83f3b4a594a3be68e3d3ced387dbdbc4386bdf891873ce0aacc3a34be713bc6a3c3bb239a523c2e0889bd0d72b33e92faac3ecf1082bd48ae443c6967d0bb0d798939a3fd643bd9f816bc544a173c21ab00bc9b1d103bb7bbb1b82b93e13990c81dbb51fa533b249c61bc5376ce3c347eb839c08098baa4efa5ba8a26dabac9fc3e3a3578053cc393ebbb4a9e08bd150579bd798f573cbaeca43a4665243b704d17bbcb16053c4dcb6abdebe5b23e4577a13e7d2342bd379e9f3b10120fbb3ac2acba31429b3c8dda79bd3503993d608f2dbd9910ff3b5360403a17de33b993b5bb397bd51b3cf47be5bc4ce0693d4b9813bd81f5873cab5e9cbb51a2ce3875f7eeb97323ccba01cba1bc5bd2fc3a76925dbd94694d3c087269bb0e59d93810850fbafd90923bc727dbbcf0e8a43e404c8a3e014a5fbc96284fbb812fcf38ed2feeb76dbc1f3ab92207ba497690bb30c7e9bb83a0023b4cda93b96ff2c0399ca824bb6751583b6dc672bb5930c73c6ccbaf3c78b664bb1364083be83b0fbb14ee8139b10a8f3b1c3e2aba13508abd386899bd1a81023c5a7b873aeb70c63ac2369cbb5d51933c1aec92bdcbf3ba3ec33fb13e964986bdb4877a3c412391bbddffc7ba08eace3bf2fd4ebc193bd23b7f82afbb42ee1cbbb973c93af530bab830d007bb6168e33bfa2764bce9800d3d88b4f53bfabbb339c1204839f3d577ba709f6abafc2bf83bb29e8fbcd71d0abdc0bca9bdfe59633c300763bac223a13a7ef4d0ba25d9303c2f7c70bd7e16ba3e0ea9a03ea34a2abdcb60613ba18aa0bafb4eb0bb2715f83c1300a5bda275b43d782921bd44f122b93e491c3b4a1435baa068b53a4844023c178cfbbc575fa03db9ce6bbdd63f063d9283d4bb9e39f839e27c4a3a31b086bb65fee1bc5d4bfa3cc5efcfbd5910c43cf0a4a9bb70a64839f44193390fab803b55dde9bc6b93a93ee911863e8300763a447a04bc2377203a07907bbac57a0a3bea3f59bbc3283ebba03563bbd65de5bac5b2993a6494dbb979d5b3ba3002933b861f89bbcbccc53cbda6ac3ccaeb74bb620c633bfa379aba793a1fbbb66fd23bfbfb0ebccd2880bd589594bd2aa9e43a8280ed3a1def87b950291dbb005b7d3c911a89bda399bb3e008aad3e0aaa6abd50eb423ce70130bba3cc80bbecc4153cf0785dbc3420883ba57315bae458d9bb55cd343bc2ee3cba1e7fd4ba4fb9163c8b2a72bc4aab133d93b4403cf0feca39107a2b3b9a39cdb9b6f876bb7d081d3c4ac9d7bc71d0e6bc7593c0bdbd91303c59664dbb5fc7c539c639fbb935a9363c2f8876bdbed7bf3e1e8f9b3e80eff9bc3390263b98266db937d233bcb074203dff8aa6bd129b8c3d9d47bcbc2c1dd6bb3ef3983abe88c4b9d819353b651f083b01cec7bc07f1ca3d2f6e81bdb483233dfbb49ebb98fba13a35c90839518f2e3beee148bd3bfc483d6a3414beb7f6113d5b7153bcd14e963a9851b13a3d4e5e3b73f40bbd9490b63ef1fb7f3e0388ed3b7f46dcbb09a96e3a6b2db9bab223263aba8a94baa79baebb3ef5ecbb34ae85bbba36023b533530bb2cb459ba49310b3cd89a16bc3fbceb3ca699023d6f52f6bbd5ebab3b1866b43a02247dbb8de9a43b75e2273b20e598bd9a1aacbd505f2e3c97bf333bc20ec0bb20a62bbcc462093d1ae2babd6cd8c13e8a48b53e7364a4bd6206fe3c8a14debbfaf38bbbd5dd4f3c84c439bc6fa4e43a3c76993b47012ebc849c0f3cee3035bb983b46bb1650143c03b58cbc8058a23c0154803c5aa30fbce013d03b782f62bba51bf9bb1c26a13cc21d00bd3fcb1ebb366798bd0f5d1a3924d1913bcc670abbcdeafebb3f3eb73ca12090bd5194bc3e66b8943e714b0cbd239a2f3c608455bb50637cbc35fe283de24f29bd547c1b3cc5d4fc3a81ef9e3bf94febbbb8be803ad2832bbb8b0f1e3b5c2a2bbd2704d43da98645bdbaefc63ba23b013a2563003bcfac30bbb88e7c3c74bac6bd783b2d3e224944be6504453d6235eabb8cf3d83a5b249139df33693bb585f6bcc308c13e95472b3e8760143db55528bc76ce7a3bfc1bbf3979a81dbba25fe23994681d3a224d7bb913da4eba87bcdbbad818a539db6ea6ba85a3ea3b11cef9bbcd2d763b3434da3ad71bbabb4dc8ea3bff019fba21d707baa6a056bb64eb273c7177cd3c26e23c3cb0d2493cb8024bbbbb1b42bad55aa4398ee6363a00818239f09e773e543a4c3e5b1a9c3b07a5b238a296093a447a8e39457140bb0082d1bbb86b333ce9eb37bbac6b76bbea2319bbdcac9e390e9378ba7d11043c0480cfbc79d95e3d2a29203bb47223bc32e2123c7f73dab9dd3f77baf57c09bcd49f013b8db0fc3dde4de439e967293cf8ad0abb3394d2ba25334d3a1847433ab5bb9e3c37c4533ef37fbe3d2d91a03c65aa8e3ba28ce43a2eeb4db622bb9fbbfb7152bc94e9463de27d3cbc09fe8ebaeb16b9baff511c37f09936badaa1a8bbba72a1bcecf74c3e7e0b0ebc0f06d2bae220093c958e813883e702bb9f6191bce072b13cb4bf063e106efdbc68f3a63b51ff3fbc11db77babb0a73ba4d35ae3c8e67ca3c65a8b23d60f6753de23c033c0e01363ce9e1803b59f598386043bdba79b380b81083823a2db62cb9daead63780ceafbac4cee938c5e345ba96e0603b15d44fbb98ce6c3b2204513bc01741bbf4be413b682d54ba564826b87e151dbb4049fc3bfda74bbc98ec79bc0c45033cf65411bb0f3c1b3a27cd03baf38a833bcc2cb7bcb5a9913e7661873e84b5a7bce54b663b81fb4aba99545d39ca0d66bb0bdb00bbb2a32e3be4b99cbaea774fbbfb91e1bae28445392c5f83bacaf8d23b451c5ebc2aa9543c1a530e39542211bc6f16ce3b7d813bba374445ba52d8e0bb9595173c0b3d323de39d523c77cd233cae9855bbcf775dba55242a390096203a6dd8d9ba40c67f3ed690473eedd6e2ba7d01473acbae983845ed433931ebc3bbb77841bc2444013d89b439bc6a53b3bbf41333bbabecb03972cd9eba21468f3b6512b9bc057da23d7720f1bbed1311bc494ffb3b68477ebaab9059bb59bb35bc2673013c386cc03ddbd45f3c1a587f3c99ece8bbdc9d29bb4cac673aee8fbf3b9d43ab3c9562233e7286093e4fee8c3c7724da3b35c1233be47c1c381ae106ba13cd02bbff9fb13a657ea4ba236d01baa23095baf1e57739025466b93b222d3b64ee1fbbaa8ef23b0e19f03b4e4e83bbb837653b2bad69ba318e2ebafa22d1ba6106ee3a50d502bd024410bd129cbf3b770381bbf858943a95dd3cbad82ae93be75a1fbd3081a23e69419a3edcb016bdfc14f63ba48af3bac547b9b84eac27bbc93c9fbb2e3a9d3be06d02bb87e41eba36beb5b6a71f983998e2223af8ede03be352d8bb3bc2143c5c914f3a2e55febbb6a8a73a71139bbad20fe9ba20ae97bbd1ec4ebb3434c0ba69eaa0bc59891c3cb63c22b9742dfb3ae180963a30b5063cc21705bdfa43a03e5ff6863e0bd1febcfd7eb23ab75921bbfdf087b932a0c4bb4acd16bc275b373cd837dcbb4942f1ba301e853ac337a73982da973a0854233c8a965dbcf659bf3cfc662abc678c3fbcb221e539048fa7ba8b8f06bb9b1a44bc4f5de2bb08eb6b3dfc7a0c3c26cf283ce581113bca5ca73aefe9223ba449d13b0fe3a2bbdfda853e8786513e149218bcd1628dbbf45ef8baf92b5cb8ff2dc239145354bbb8f68b39a23482bb214775395a3e91ba160b853912fb8fb92ce5873beded10bb0a99733cb0d2433c867d2fbbb908963b646522baba3cbdba5bcf943a4e8eadbbebad42bd8a4f56bd5ab3323bc60f64bb4913ce393fe9c9baace9383c7c735abd3791af3e5b61a63ec94750bd352d413c8257fbba52678c36ce0c0b3bf4b342bc7cee423cd9de1ebce6df773be5a662baf4dc9a3953372cb70dc7d13bbc6826bc52ecb13c872166ba2bf7a5bbb4a4e13a657e6bba6d3506bb7391d63a5bf461bc2d87a2bc30bd32bd27a53c3c2d7559bb13d7ea3a91c92e39a1cd173c12fb37bdf602af3e9291943ecba025bdecc69c3bd9d0d8ba6587543908d0e9ba8ec997bc7f5c8b3cd25f39bcc5399f3b4716ad3a7439a639c85a8d39c7796b3c48bc0abc1071de3c8f194cbca9811ebc322b91bb160eaeba43c430bb0a0a03bc3645ccbc41f99e3c88fdcdbc98ba9f3ccda2a33b0b761f3b5ebdc33af4e7823cfbe3d9bc77e9a53eb0df7c3e189a16bdec1ec0bbaabc17bbe3babe37f443d7b9878b34bb676605bbf41ac6bb43382e3900567cba5a6b343996f051ba54adba3b374eaaba0211ab3cbc26883ca9dbc639d18f633bd83db3b9b3428eba80bff13a8cdab9bbe8ba6ebd251486bd9b74583b401a04bbca16b439044674bbb0388a3c8f2d85bd955ab73e669fab3ed5c86fbddc786b3cd5ce43bb2296b93805e6b93b1d6c8bbc24e2933c57fd5cbc4809363b311e12ba91ac5b39244c1dbb154b1a3caf5fa0bcfdaf0b3dc29d75bb87ef053b3dc3053bb21234ba70e187ba0300d73bcbc2a2bce8beaebca3b18ebd0f7f6c3c4069c8bb718d8c3a24ced2bad54a163c1f5e61bd8958b83e8968993e56ae1fbd184ec23bc52e0eb9171615ba5737513cf4312fbd85fc363d688fc8bc0646603b2a2f003af42d1d39433295ba1d0e513c7682debcee36543d0b53d6bcc31bba3bc2f195ba612022baa611aaba3eea9eba6149c8bc6425423ce3e17cbd9330c43c133062bba6b14b3a64a08c3abb98cf3b0f1a10bd2aa9b13e5c33823edf83a9bc5d0cadbb330da9392a98e9b931194f3a73fd5cbb39fe47bb687909bcb072e03a76d132bad62eb9b74c95cfba3211da3b9b671cbb2f2dd83c551ba13cd8389eba602f3d3b52511dba6a44acbab5d62e3beb80c9bb924384bd806699bdbd401e3cd1f329bb0e19983aa58aa0bb1b03ab3c5ff393bd597cbe3e73a8ab3ee09080bdae627d3c0e5884bb8401e3ba522b1a3c4abaa5bc011f743ca40e08bc085d82ba8d645e3a7ac8b139e3ad20bbebc34d3ce6b4cbbcb5bd3c3dde51b6bbf67d323b1b24e83ab6f7cebaacd704bb8971103c2d0cf8bcfe944ebc1017c4bd0d37cb3ca936d4bb380dfe3a987b96b943751a3ce03d73bd1e4bc33efdee933e6c6708bd11c3343b83bf6dba1fc78ebb463ee83c2b8286bd6ddf513d097e3bbc7e8cbabb5a76973a269a86397ff1053bf10a943b7ede0fbdc2c2a73d958c38bd655c003c60eaeb3a0e1325baeaa8eb3a23edfbbb4671c1bc54d4073d7a9ec4bd9d81f33cc7ce1abb0c022ab94d67173a14ae6ebbc3729cbc300db53e0e4d683e5ac33f3afeee92bb53ac0dba6e1447bab193693bab31d0bb70da1ebb794fa5bb7539e1ba6fa4993a2895ab38772015bb0ce4dc3b1dee6fbb7d67f13cd1e1a63c63bb32bb41f2743bf879b5baf3e338bb98cbd03b8ea455bc69fb83bdc15da7bdb3a0303c3d3d41bbef405f3a6bcd96bb54deb93c46679ebd7f33c53ec0faa93e06977bbd51e2733c9dba4fbb1acd8fbb8ce7603c2c9cd4bc9a02383c05810fbb4c03c9bb0cdc1e3be66aceb8822710bb3815883cd695d1bccd085d3dfa05073bb5d6803936def93aacb18fbac5e71bbbc981f23be10e40bdc386b93b4a2e00be5b53fb3c6f0585bbb90d363a4f65a53ada92243c110b66bdd3f3cd3e89a2873e0b0492bcfb6a9fbba5c19cb89e51cfbb75a8183d2fdaa6bd86492a3d5ed32c3c834b4bbcc57aa73a54b1173a4787943bd85d8fbbe59907bdaeead43d93da4ebd0ad33f3b35f32c3b82aa3bbadfd4203b489c86bc31afcbbc5ef2a13d5f6305bee459d63c21dd663b46e4f4b9b5aa14b9771990bb0cb62f3b04dfb03ee87d413e66b98f3cdd8477bb6b68fbba7d72dbba40e3723b18a281bb7d36a7bb5552bfba870918bb8767523a92870239c5bf00bb2482ba3bee62a3bbf091e13cfdad9d3c647e91bb3ec9793b1deed3ba487285bbafc6343cfade9cbc734461bd0ad4a1bd6926283c94b021bb9ab7a53ae71648bb70f9953c16ae9abdffd6c93e733f9f3ec14f48bd3c2e183c00fed3ba4a92eabbdc808a3c7892d7bca9221c3c5cf16c3b272c28bca206723bcbb79fb96078d2ba96126d3ce5e0c9bc899c353da610263cd7ce45bbc003613bb129a9bae1f256bbdfc6503c091b5abd4a67d93cfe560bbefc5ef03c89f495bb56ed003a763ed33a9da3d43bc1fa81bd2dacd83eacb26e3e28a01e3a5bd6b7bb5d71223a54d619bc8d8b333df26dafbdf603e33c1d38c43c570983bc796ddf39a0bf383a933c013c66d650bc5615a7bcdcb2e23d1f9426bd33a9a2396e8da73b73a7b338a4c69f3a0e1678bc009019bd92a4cd3d212728be7a69d23c8bd77a3ba55befbaac2b073aad9591bb8d47b73b1ce8b73ebaed2d3e60aad73c930a3ebb3d2822bbf689feb9db6042397d8e58bb5f2c05bc658dd7bbe7eb39bb50d9943a4d5a94b9099009bbd529063c930c26bb863ff13c126f073d55f71ebca23d233cf3738dbaebb6c8bb86a3693c8c2457bcd1d284bd89439fbd03f1f03bc3a68aba8d0b34bb285847bc4ebf063de7d4ccbd99d3ce3e9495a03e422a73bd42b3ce3c4008a6bb385d09bc0018893c9e3fccbc1b6a243cd333403be9b531bce637c63be43eb8bab158bebbbd6b953c9dd474bc9fced93b41c3e03cc5df50bccea6e73b291084ba8d8dd6bbd072d93ce93186bdf578883d82cbdebddd69833cedab25bb988b2e390d5a68bb4d11d03b0f228fbdce41e93e39ac223ef2a5203ca63ec53acfce8a39deb442bc17af5d3d80b4b2bd51e2063c0758df3c6be144bce56eba3a4e7a2c3a832fd43b55f4b4bc64903abce958b03d9dbd053bf34b65bc54d1c33bd2a8d0b9a2b0073b0c231fbcb0cc1cbda8b7473e1b873fbebcd4943c2a89823b7115c5baebac403a45a4b3bbf655853b52e6b83edb5ab93d2bc8133d3e765cb9c9d338bba52fee3927ad33bb662bb63afdfecfb94b072fb96fe252baf9fee3ba039ab8397bd2c3ba7895f33bc36ee9bbce28163bb1a27439a7d5a3bbd402f43ba92bb3ba82f3e9b9322e69bb9a38353ca39dc93c91aafc3b8464633c587755bbf53023baa5f16139507ed939692f1cbba9a5843ed867423eab26903ba49fb1b9a303233aaffd003afdaafebb518f3b3c283654bbe21593bb128412bb936c26bb4b45cf393f42ddbabe99313c108fb4bc2aa2263cb267c23a1f19b1bb7e31363c728d46baeda9fdba248bc8bbfebde6baf8cf113e323e5e3ad004743c3af28dbb1051f3ba69d0a93a36229fbaf0a6f43b5e12873e4dde963d8677583c038d1a3b86edc23aa85501382f11efbb3ebfd63a2e89583cc89e99bb501c563b407b38bb5d114d3825bb08bb57338f3ca22cfbbc1e71823c051e11bc45d252bc2eae4c3cf918973929d6923a4fa8f3bb92c4193d8d53953ec38b03bd0435c43c6ea30abc15faf5babbaa61ba8201e43967e05abce5e1453e771f9e3c1c6f33bba8915a3b70d8963a9bf9993859f5aeba05205f39ff8b553a19871cbab25b063910ed94ba3559083914b654baf6f8653bb2bb42bb3c126a3b76184c3b83643cbbfac63e3be3fb6aba1c8325b9ac502ebbb3f6093c2fd666bc40eb8dbc8d73083c478717bb6793313ad52ef6b98d568e3bef07c4bce629963ec33a853ea69eabbc0ee8733baed377baefbf8d39840c9dbb569d0d3b560d99b9046f30bb3d900dbb6679d7ba51d16d393731afbad703013c07485ebc564beb3b4bdf89bbb9f9f6bba84a013c03f65dba95df3dba602813bce656603c7fac453deb57273bfa91773c59d869bb8cb284bae5be06391c235d39df5301bc045f8f3e04183b3e612df1bb80e21d39d6e3363957af4c39cefc19bc39f5213cbb477a3b011720bcd1b2a1ba108e3abb46ffd539f5490cbbc168013c95b286bc06fab73c070454bc617d21bc8ab3453c221aa0ba595e2ebb85ab39bc28b2663cb949193e3a8f993b5224c83c26adeabb4100c6ba1ee8773a7a6ddeba2cc1b33b9370473e7f98073eab16cd3a0a64a43bff85ce393ade3ab81227bdb92a0406bb25b0cf3ab8031fbbe9de203a9f52c1bac0a78f397d22aeb8bf831f3b31fad2baca3ae13b9343073c5e429dbb4ad8853ba66386bafb10a4ba2b769dba4cbef03a1bc008bd52f318bd8382e63b1529a1bb8925f23a305cadb946faf03b06a124bdf8e3a53efe8f983e506c17bda256003cb5ca26bb6bf49db9566d77bb77e732bb07791a3b649276bbc98c0f3b71b9a1b83754d739ab71df3a1048f23b90996abb20f6003c3e4d033bd20b0dbcfb733e3aa80af7ba60d375bb2ca5cdbb36c24cbbef24a6bb6d36f8bc77ad7f3c47e723ba02626f3b176a403b1d05263c714a15bdd8e9ab3e2e28833e612611bdaabeb93a9a4796bb8aa504ba466a30bc76c087b8a60a20bb875fb8bb90a60b3b12993e3b1334013ac0200d3bbf80613cac8fc0bb11138a3c3cc850bc090759bccbb514bb97e93abbeb2085bbe5f798bcf8ffdfbabb20823d6271dcbb6665bd3c25efe03bc709583be58bb13b471b173c73db13bcc8ef943e67f0423e3373a4bce91816bcbe68aabb940cdfb877b7c139c1bf3fbb3512ab382a7695bba8b6a43a54deacba097fc0390af58a38697a5a3b3d1aceba4d0b773c69fe553c228f88bb6f43a13beb196dba6a6d04bb3643183b4922dbbb5a5f48bd8acb60bd627fb83b848098bb45375a3a8911c8ba8fbf3e3cb2af5fbd3577b33eb265a43e3bb255bdff3d4f3ca5a50fbb1e718cb983c1403aed32dabbbcce8d3b4b8a00bcc183b63b377384bab5b4ec3957ae743a4149983b5377a6bbb661a83c0536393ba6ce0abc0ee5d63a16ecb7ba580d8bbb81d48d3b04b49cbc50abb9bc69565ebd246fab3c5cf5a2bb71c3443b763bb83a707c2d3c3bf048bd8e16ba3e5efd903e216f3fbd4c2bc53b2c4f35bba9800f3b728abcbb9b6921bce75f8bbb11d8e1bb87d5353cc2be523b3a2dc73936d376bbfa8c583cbdcf1e3ce689063d7b0af9bbde90b4bc163b20bc22e31bbbd754003aa91428bc6a5c2bbd6454c03b3cdb1fbda55c2f3d8dda393c8099793b341ec5b95f1fc03cbd9092bc3648bb3e521e6a3e548b6cbdacbb4ebc7fbe34bbe12cc13720391eb998d01fbb69ec14bbb00eaabb0450e2399fbd6eba9e7f9d393f534cba934eb83be0ccd9baf8ffaa3cc42a853c0b7150ba96bb5c3b5f87eeb9911efebaba94453bfda508bc65c86ebdb7be88bd97cdb73b749c47bbd04a023a91d273bbceab953c9ef288bd7048bb3ee837a93e294970bd8bd86c3cca2a32bb330cffb84e84863bd28205bc75dea73bc562d7bb9867083bb00a6cba8478ed39768d58bb6e471b3cc8ed90bc29fef63cdcbf573b5fc86cbbd89d803babbe88ba30731dbb744c5a3caf25f9bc648777bc13cfa5bdbc0cbc3c752b08bcf210993a298150baff84063c41bc7abdf01cc43e0e5e923e99fb20bda7efdd3ba35827b859dc133a9e4a933b244b3abc8af21f3b5680babb1c72823b3bd4cd39bbc42b39cf8cd1bb9f58303c29548ebc4794323d35fc3abc53b904bcb500b038a30617ba4b09723a449b323c6db541bd8dd9893c4a239cbdf2d9223d23e788bb4ee935370c21a1b9b28ce83b758426bdc7eac53e2bfd723e3a5e0abd19cd8fbb0d3dfa3a6bc1eab9211dd33a02a4b7bb720b22bb862cd3bb49037a3976da6339e0cb6f39ae7fdeba14410b3c06260abbeb40e23c97599f3ca10920bb2a25533ba50d8ebadacd53bbd2e18f3b775b60bceb2b81bd0cfc9ebd7e903b3c8df95abb4ffea03a9d9f91bb338fc03c0a0799bd53b2c43e3096a73ec8a07dbdd9c6723ce1e56cbbd93811bbfca1ea3b0a1324bcf37be0baf42b03390580efbaa8f3193a08f14a3a9ae080bbb59b993c8bdcd6bc250e2e3d24130a3c3f59f7bb7a75743bd18ef8ba50eb49bb0fe94a3c3e9851bdfe47873bd9c8e1bd1200f43cf21b8ebb00969c3aa260003b59c8063cf21371bda51fd13e2cdf853e7001c8bcfe0f60ba39d1aaba73307ebbb23b643c717744bc2748a4bb9aa6d53b60612ebba4489ab9c4f2a239c58602bb7d11723c32063bbd4c09513d2af626bca803d1bb12039d3b597edfb95e53f13a0968003ca97663bd6bb4903d1fd8d7bd71bde53ce25995bbbfd0e9b91819083b58750abc2e4602bd5ee4c73e1cfb4e3eb9afc53aa159d3b82ce58fba3ecc6bba4692653b43dcd1bbad188abbb5d97fbb1c94d5ba4c366a3a5d87a439667920bb5767ff3b52ba34bbd99f003d5f8ca23cdaf07bbb6540913b4598d0ba4a0193bbbfe01e3c51eea2bca5b881bda092abbd99a3763cc4f0aebb6338963a010b98bbb017c63ce9eba7bd2638ce3e27bca13eb1bd69bdd14b5d3c498310bbba7abcbb67993d3c55d73bbcc3e9e5bb1e46263b38e637bb3221fc399c3a793a27a801bb8f2daf3c3e4500bd551c393d4c83c23c3c2162bc73608d3b1515bfba43db12bb462a2e3cc6448cbdcd3ee03c819a04bebc3fdc3c387c6a39a52048b8b0605b3b3c6f833b3e2650bd6e04e13e97735a3e28212ebadfe5cdbb444ff0ba26ace2bbd7a2b73c702a64bc6a484abcc7061a3c69af1fbb99eb44b90c256b3980fb233b0e5a493cdc3e83bd3def3f3dd328c73be1f40bbc3c5c443b3da318392a4d5a3bf7cb9abb06b16cbd50560a3e105aeebd33991f3cdd2b663a60b82dbabb6220ba54ec1dbc1de0e7bbd233c53e84a1143e1f82b93cf976023b1ec5ceba83da20ba92ca3e3be06261bb40e8e9bb9314663961b01cbb4bf3793a1e5ff13916c269bb4185e63b883b6bbb524ee23cff179d3cb596edbbc0aca23b38d92cbbc55ea8bba2797d3c765ce5bc050058bde06ca3bd26b1843c553ba8bbe667043bd91e62bba75b9c3cd100a6bda9a8d63ee297923ea72731bd6d94043cb9c31cba50af07bc0b9d673c40ae30bcff7c9abb336f173bb12426bbf83896b86ca46d3a0b5a67ba29ed9f3c926e18bd96d10c3dfeed073dd6c591bc2787b83b1c047fba12de51ba1b56663ca4cf92bd5e83493db9cf02be3641993c2ac5a93aaba6a0bad02d1f3bec8256bb702b53bdae20ef3e36a0253ee8eaad3c1ae9a0bbc0e3aeba20261bbca6d5ce3c880cb1bc085102bc4d88d93b4a3c9bba7e15c6b92a63c0382b82c73b3c7c353c6f8f6abdbd3a0c3d1883c23c87a93fbc0f80dd3a0f488c3a3b8b3c3b44da41bc93fd84bdb948293ecc3405be79731d3b6244ac3bc5379eba14caf2ba3ec1c7bbeead9e3b560cc73e245cee3d9a97fe3c50663d3a9fa500bb2724633adbc12dbb15a56c39a65a57bcd7d5eeba31c993bbff91573adfd810ba75fa9dbb7e70e63b62e7b9ba5ecaf53ca149ff3cdb332ebcd1bf353c4ca5a6ba784640bb5cf7aa3c57879fbcd9b783bd463498bddf65e13b011142bb63aaabbacef97abcd157043d099bdbbdcd1ddf3effcb8e3ee13135bd7caea23c87993cbbcc2911bcd4c23a3c3ec30ebc6475623a1f4447ba58478fbb8e10003bed9a873aae1988bb80e7bf3c0c7c19bdbc52ee3b502a2a3d41c2a0bc5348093cad3d19bbc0bd33bbc081b83ca92a99bda0089d3d909fcbbdc351403bd92b933bbd1b09bb327906bb642a75bb341046bd5b78013ffbfea53d849d043db50667bbcb31b03a0e4b36bcf271f43c5b1a00bd0bff2e3ba3e0d9bba8e62f3b1b3b98bae72d173a8e43e83b1c15883b339262bdee43c5bb71f6543d4d2011bc5212e63ad8e5393a73cb543aaa9d4ebcafdf5bbdf58d773e866de5bdde422fbc64714c3b4dc6d0ba0787d6bafa3a2fbb2809883c9c7bc43e27d4183d03c9db3cf4a39d3b95f495ba622c143ac48c2bbb2cf7b93abfa072ba9ef6a237337964baf6cae2ba7ac3b93935eddcba4b01fc3b698bd1bb6499563a5e616aba32ac85bb6cbef63b0a0ac4baac9423ba00a182bbe816693c6b469d3c0d62bb3b1fa96d3c981a69bb282a20ba4437e3385604b53952afa2bb398f8d3e16453a3ee95f793ba4945bba68b4183a1c401e3ae18d04bc28ee8e3cb2eaa0bb11e13abbc8c74bbbbc6858bb4a070c3a32e3c4ba00e8aa3b3c6e0ebc896905bcd6e2a9bbb7fd75bb4841623cde7883ba4e1711bba09e7ebab0899b3a5a1bde3da4605d3b5fb2b03c0c4ac0bbf6b71dbb90533c3a07b101bb7cc7c0bb0d30a43e6b66893da83b043cacc652b9f825ac3ad4e30539af1e76bc1b344a3d754841bc1313f43b3406f8baece909bcd483e8386690debb543eec3c0d2222bd772e5fbc4cb2cbbc872c4cbcd3b2f93cb437183b02f8c93b80cd8cbb20fa383d26133e3e682572bc148b453dc8709ebcbf7e01bc0788b3bbd8d9eabbcaf74cbd7b39933ed0f1843d26e7b1bcab04b13bd2d9613b771fe6389033b2baf489913912eb3a3a238e71bad68ee539cefe97ba4e811639e3bd56baf83d7e3b477f4abbb121653bbc08573b0a9340bbb545563bbdab83babf4c65b9cd8c41bb076c243c142d8cbcbf159dbcd68d0d3c17ce35bb1e1e7b3a1c72adb9e1b9953b1ff2d1bc549a9a3e333b833efd78adbc27216f3bf6148cba10a4d839c55faebb2057543b163985ba36f710bbab8bcabab9a0eabab65587399eb0f4bac3eb083cb9212ebc9135183b6225c0bb42c0dabb438b0c3ca9496fba6e7a1cb954a021bc5650a93cf2aa053d2550b5bb7e81a03cc0c369bba0a18fba36bb86b92a121739dc6485bc81e6a03ed4dd343eb30249bcfabeabb9b013b338d5281b3aca692abc7ef7653c8911fcbbc4355fbb454f5abb1b9c8cbb554ae039470d85bb06f80f3c6711773bb8a1273c54f48dbc31681cbc8393923c596730ba6e5612bae72e59bcf4e0ef3c8535a83db5b5ccbaa2421f3db72ee0bb545281bbcf1f69b9b633edbab9c430bc68c9873e15370f3ead264abcdefe6ab84c22843a7e54d0b82d913ab854d30dbbcc3be83a520367bb7072da3a2482e0ba6e68c639783e6639904d0a3b814c15baeef5c43be985173cae53b1bbdad0943bf182b5bafda303bbe6f97abad9600b3bed2211bd49841fbdd0af0a3ceabec2bb0246133b720137394c56f33bf2eb29bd7e12a93ecb0a973e27c219bd90070c3c7b4a40bb3c6cd5b9bf5127bbad85b8bae8bcd73ab9a7a0bba331513b63728dba14f5f2394017103bc94b913b28f429bbb893973b8b9bbf3bb8f70dbca5c9423bc95df3badd5b90bb6d2a95bb47e2133b101c66bc497a1bbd82d7963cb20a8abb2b70803b9097513b2f92093c6c6b2cbdfa49b53e8871813edd081abdbc22ab3b8831afbb70f1ff39ba3e21bcf435bd3bd950bbbbacee81bbaef52d3aca6e173a5b899339a3bd03ba3a550a3c4d70a3bb3d35873ba16c17bcc4f910bcd1408d3b0bcfc1baf19867ba149681bcebd9b23c2df02d3dc76b80bceeaccf3c6b3ac739352733b95d98213b6bf1eb3a9073b4bc1236a43ebde03c3eda959ebce8b45ebba66c11bb0ddf7ab91873313a27cf4ebb8657fb3943ca9dbbee92d73a2668b9ba0e96fd392e452d3aa88a253b169659b9d0045d3c6e116a3c3368b0bb6feaae3b20ac9fba783b47bbc2fe353b0a8ad0bb272652bdb27563bd666df73b69a7b9bbfc84b03a5e8e8cba0ff0423cb20b65bda590b63ed2c1a23e51d758bd82ed573cc34225bbce9b2dba01b643391adab6babb040bba730fcabbe8fdab3bf308e1bad1a40c3ab67d2e3ba92e84ba267bbbb8782f543cf1ca383c083c32bc36a4813b1fc0afba03f3bfbb9943083c1b8d7cbcf09efabce7d375bdb023c43ce72d08bcb6e0423b48ecec3ae096123ca46564bd176dc23e363b8f3eb42d4cbd0e612f3cca5f5fbbec46af3a17232abb8481623b125729bc63bcd9bbf6e7233c5dd6aa395c36d638bf4816babe2aeabb3786db3b9885943c8e999b3b40daa0bcc08d17bb7cafd4b9342bfd3acc10a03b173d95bcf5d128bcb34643bd20222d3d8a0fe6b9bcb71e39170ca1bb0969043cde590dbd09ebc63ebb47663e49955bbda63d2d3b9bcc973ad5be94397225b8b957580bbbd1ca37bb6caa8ebb5a8b133a95ca69ba15a3e339c6aa52ba6a8d9a3b3bc12db94a42a33cfbe3863c74350bbb3c18693b845a73ba1c4d27bb28d58c3bee9018bcad6976bdfa1788bdd9a7f13bde9966bb475a923a11c151bb4b70973c98088dbd0d4ebf3efd42a63ec3466fbd078f703ce43755bb8e5d89395bb4343a576de438a6c167bb560455bb4255413b5c9fc1ba5ed7133a6c0600bbe4a28c3b8d9df0bb2787973cbeb56c3c48461fbce7799c3b2dd28dbac50e9cbb0b60983cc0c407bd4376bdbcdceba5bde19cd73c9e700fbcb9d6a83a900f7fb5c903113cbbb68abd6e4acf3ea3ab8c3eb28e2cbd1dfb093c568a29baca0bad3a72aab6ba4a43f93b2fa66bbce1bc9bba3e94ce3b5e3948ba1b0b94b89dd927bbccb4e6bb6b637e3af261af3c0701143c657b8fbc8128de3ac54d1d3a39c0e0ba8582d53c7d852fbd9ec109bc921191bdf3862e3dd67be3bb1c50e6ba6c6f78bbdabf603b2dcd59bd86f4d73ee233663eefaf29bd373b6f3b1374943bc68fc2b91daaa63a549babbb58ef67bb4aa2b3bb68b80c3adf24ac373f0be1394421a6bacabb093c9242ffb9a790dc3cb45aa33cbcf58bbbd6be743b3bfdbfbae77a98bbd944ca3b169c8ebc982d83bd7a589dbd8a2d5f3cb0128dbbaf37e83af6c87fbb029cc63c9b379cbd2809ca3e55eba23e3d657abdc1b0703cfcd47ebb4647ddb9a6420dba6c84263a9c6401bc92ec97ba5f3ee03addecbcb98564893a9e8f7dbb13ce9a3cc28d57bc9775b53c26dab93c21354fbc1be3413b8f810fbbe17d03bcaa769b3cb7407bbd4005dcba1181ccbd67bad43c3652bfba2799143bb845ad3b1a953c3c346f8bbd7be5df3ede73753e6a7bb5bc7d2f22bbe3fb77bb9760043af1c764bb6359443cd4f762bc5035b13a03a2663be31e8dba08b2bdb8ee92a6bb2525243c178e3dbcbeb9b53b4abb8a3cf19772bca587503bd0c24c3a838f32bb6cc1f43cb94a96bd5c12183d876fa3bd9e82e03ca1308dbb0dd5c2bad8a2443be70412bc74674bbda1c9e33ed70d3a3efa672bbccc7a223b9089d5394bc81eb9ef350b3b5ce9b6bb6865c0bbaf0949bb4a296aba3934ee3976e19439122926bb4de6003c155bc7393e28f83c287aa63c713fbfbb4839af3b331be1bad97eadbbb1a03a3c6e06cabc549786bd16b8a5bd333b8c3c5d04cbbbb51e883aaadf9fbb99f3cd3cf066abbd8d72d53e2ee89a3e653c62bd13c24c3c6365beba0b0111bb03be153bb7500b3a348b2bbce52a48bbb854373b23e114ba40f53e3acf06cebb9f8ec33c4ec289bcdfdcad3c97a50c3d39f270bcf1ca243b515766bacce741bba3c2a53cc94baebd34ce833cf8dcd1bdf43d813c252de33aad12e339b2277b3b1c1ee23a4b7169bdb6e0f43e9a23373e6104793b05d57ebb0d172cbb4d95cfba7c3f5038fde31a3ce0eae4bb4262a7ba2e6c443b1d5663baf824adb9644de7bb8032ba3c45bab5bc57b38ebc1dd3bf3c316326bcb998dd3a81cbb73a93cb8e3b068a983c9f57c2bd83b9bc3d748892bd40ee0c3c2d24b2ba6c02eabad90902ba6a947fbc17eeeabc2c79ea3ed59af93d2ad3383c20f9a73b3679063a5117023a17a7f43afa2364bbc3fa09bc94d9a23a80a8e1ba9ce54f3aba668e394bf386bb5786df3b425dda39814dd73c0d9b9c3cfc6c14bc3b95b73bd10e26bb084cc3bb6b0f933cd7fa07bd2e7e6abd314997bd0fda8b3cbd50c2bb70dbda3aff5562bbcb22a33c55a0acbdd89ae03e64e3883e33b521bdb840e93bc3aabd382165acbb47f3913b81a16d3ba0272ebcb33759bbd3cc6e3b726dbaba23d95e3a15bdb8bb2d52c83c0828c9bcdb517c3cb497123df3996fbc0ca0533b65bfefb994f7e1b9924fb33c78cabbbd29bef93cd608b1bd2f77813bff861a3b42dcbeb9ae951c3b30a2c4bb63c051bdc240023f9141fa3d15b0ae3ce9772cb904652cbb9544b6bbd225813b686c893b1f7bfd3a86719cbb910fc73a173c4fba51455e39eb9150bb2337fa3cb932ffbcbcad00bdfd6ae83c10312abb86b87c3adfe3a6381176823b5902803bc0bac5bdb1ad013edbe196bdfa04e3bb65b0443aef2c123a2d55923ae69536bccd91aebc548eeb3ed5ddbb3d2494ea3c079d243bfe3229bb00cae03a81ed74bb32021e3ab90183bccab5703a5a339ebb7e3886b9eaf78d3a25b291bbd5b3ac3b56709b3b21c6f63cac63e93cc74829bc8c65433cf1941cbb90c08cbbddc4b63c5d3ddabccf7292bdf44889bd317fed3bdc846abba979c9ba39f081bc21e6043ddb03ddbde387ec3ea168813e44c81bbdb8278b3c386355b90138e6bbc129a33b15db973b8149a6bbf671ccbbd1f7d03abb5bdab98f16493ab73ed8bb7d9dc53cea87e6bcf64f733b0a5e003de7482dbcf862683b22cda6b7222ec7ba1b55c23ca6e0bebdab86373d0c4c59bdb93e00bc807ec03bbaf008bb6d75433a473eefbb628e19bdf8d70b3f56bf2f3d9123e43c5d42dc3abb4801bbe01b15bc0bb1223ce37ed73ac644f33be869d8bb9dacf13a751297ba20e6bd3943a8103ac1eae93c6cfa47bdaf1322bd679aa73cdadb063b9834613ac73ded39f2c4223bd60484bb0078b1bdc5d1193e13f20bbd25d741bc08a9dabaffdfe0b96ce113badd92f3bb24f6ec39c5bdfb3ef221fa3b92e6a43c415dc23bcba927baa4c33a3a21b623bbaf7b4c3a6cfa8cba9bc1063a6ce11eba03a8e7ba8b61c939af8e00bb037d0a3c8745c5bb4d8e16379cadbeba2fe585bb427afa3b6e52d6baea45d6b901029abbdef4933cfd36293cefa78f3ba6bb6f3ce85772bb5d94f9b9bc6989b9834723b55858b8bb0c02953eb881343e7a7f773b5d79afbaddfc243aec649139aec93c359274d33ae67c36bbdd6c9639cc8962bb13e535bbab001b3a72cb17b9c4ae1b3bcefbb03b9686e2bbbacccfbbe42f89bb9743563cedd790ba85481dbb4d3862bb875f6c3c9957283d3461613b043ec03c41459bbb713e36bbc04915ba928c7f3a91d15ebcb4d8be3edc94923d68ffd83b574a83bbfff8a73a01d4e3b7510f4e3cf526c4bb001f00bb08cfa83a083c16bce3c689bb0ce73f3941582d3b0f2640bb63dfa43ca3a5943bc751c6bc3a477cbb8670bc3caf488339f3ef0bbbe7cc56bb3ad1913cbae46b3c6b95483bd328263d2249b4bb534cc2bb9691ac3acb8a5ebb70c31cbd7b5fd93e24c4593da557fa3af94e2bbc6fe4a9b84f8610391dcda2ba58387e396de8043a085187bac904273ab82995ba5a992339ccd57dba57af943ba18262bb8a957d3b6529523bae3e47bbc02c5e3b5ec986ba426607b9ee476bbbab6b463c913ab0bcc59aa4bc05ce103c533d3fbb6314883aea72a8b9d00b9f3b2c2dddbcccbd9e3e0a47813ecaeeacbc4e566f3b18c394bae7880d3a1fab85bb7ecce73acfd35dba6dd0c8ba22e49aba11e8c7ba295492390efe1fbbf11e183c18fc31bc3c68c03a598892bb43bbb5bb82b8073c712088bad531af39e41634bcd146f53c7bb2a33b78e129bc393ea83cc5dc6bbb3fc788ba41540fba4befb83a97debabc1d92b13e9401313ed83467bca13888ba3449fcb912d6293a5d2d893bb7f561bb5baa06bc63d312bb58e0a0bbc63d47bb48cc043a9e2d9fbb1c070b3c9da4f73baf458a3bd67d48bcb1ce13bcb9be993cc820b8baa8f71eba6db53cbc28172a3d35472f3ce64e8cba4080343d2a3c8fbbff098cbb5486c0bae1c18cbbb2b696bc31edb03e6078013e0a333bbcc402bbbb169c18b95fb672b9aab2b039d65630bbb07efc3a5d5686bb59e6153b984600bb7cffe6399ac6373a452bee3a674c94b782cabd3b47a8223c3a97cdbba017a83b1bbad9baea322cbbbcc610ba2fdf363b08781cbdbf2620bd3276193cb7b2d7bbf289393b2f004a3a2e4be33b79e92bbda773ab3eea9e953edaeb1bbdc3131e3c00c376bb0fcc11ba10883bb92a573cbb0640523ba69ad1bb2c20863bb14215bb6e72143a8280133b8c3b1f3bc78922bba5602e3b398f233c6b9918bc6562b53b47d0e8ba6cc5a4bbc64e5cbbf4c3163c8d86e8bc1ecd26bd72ea9a3ca3b0f7bb527b863b8ff16e3bdf9dd93b11b83fbd5f3ebd3e9668803ec43d1fbdda40163c11e8cbbbd92d963a28daadbb8e8aba3a984558ba6b782abb02e01eb91d8bbcba21d4aa398bde5dbb0e1b0b3c1eb12dbc994e89bb06e6cabb0d8adbbbed3e0d3cf89f3dba1496be393f7a89bc8d5f413d50dc363c2c3493bc2b30ce3c15b487bbf121bbba9804093b34312abb886ceebcaba3b23ec19d373e35ce91bc192511badbe0e2ba024bb9b9f923323a9dd071bb0784863a36d79ebbe60be03a6166c1ba06611d3aa6f2923ac8dc303b9ce50a3a32ba4b3c1bcc7c3c66b7e3bba4bdd13b31daebba7b5785bb543f4f3b2c4fbfbbf13c5cbdde4364bd9226173c1cb1e9bb7fe4153b09e993b95269403cb58a68bd66e4b83e534ea13ec66258bdb0ae5d3cec7e52bb2f41a2ba88a9053b874b6fbb9810f43a8c13e0bbe494a43b6e3029bbc1d44e3aa4468d3b6e5f80bbafd6753b6f96df3ba7b08d3c089145bc06c4c33b0bf3d6ba8198f8bbb974073c975fffbb569b32bdfae475bd8bf3c13c764c2cbc92a7673b24b02e3b3183093c319478bd9f0ec83ebabb8e3ea4d750bdfd5d613c70c194bbbb180bbbd55efb38e51d0a3b81f58b392817d9bbbcf9b33b5ff133bb23e0e0397918cc3b8031eebb66693fbad339b0ba2137153ca92c2fbce15ab53bae5bb9388288a5bbf9e889ba016a863cc850bfbce52342bd50e3e73c836116bc1a02063a682a623b3f410f3bcd6f61bdd1aec83e704f6e3eeebb23bd75a73b3ce9fc78bb7ed5c639404d26ba1a53e5bafaf642bb0b6c86bb482d853a468aa1bac8ee393a3c9242ba9648873b353b7f3a01189d3c14c5873c89c771bbbfd9903b4f5bbbbafe2325bb88e7943b773c13bc6e1882bdf4e283bdc529123c7a6493bbd1f3ac3a1d0b64bb71a2973c4ac48dbd4a12c23e4017a43eb06f71bdad90723c512f3dbbc6cbeab8839b963a5ab4ebba1af2a9ba4ab7b8bbb6f5903b1d7624bb64f4683ac392c53a386d85bb548ad13b9a69173c1ba6b23cd2aa47bc8060c23b192bb8ba4de9f4bb8e1da53c2ebde2bcfc8d37bda11491bd6117c33cac5c1cbca8f7033be0c28d3a2c1d1f3c2af195bd307ed93e6aa0873e7e8935bdffc3363cbf3507bb963225bb58b7fc3a6703153aceba05bb9b53bdbb15dcc03bef931fbbe6179c390d93213c88ed86bcb940643cf15460ba14de923c495060bc2a178a3b12a8f539d2a141bc36458a3c56d74ebc666e16bd3b1d72bd2a1ff83c0dc10ebced288cb9861e613bfb11ef3b44f094bda507df3e6cff673efa1c17bd16720c3c3cd589ba66e8d1b73ae6693975119abb309076bbd664b3bb9ab5c33af8f083bac2ed843a9a102eba9ec5013cb92a663aa587dc3c5764a23c8cf7c8bb46d3a93b628112bb8feabbbb77c4d53bcf568dbc51be8cbde10697bdfd6a7d3c5238b6bb0c9c173bb2ef60bba4f5cf3ccc909ebda2facd3e71ca9f3ede0680bd3e217b3c49c792bb4ed4c23ac6e179bb2ca06a3a64ea53bbba32babb56afa43b4393ffbab760a63a22af2bba20dd963be741133cf916d73b2da7cb3cfdfc43bcabc21a3bb34308bb951f45bcbcd0de3c988666bd4192eabca0959ebd113eb33cedc1e0bab866553b2f15cb3b87fe583cea24a3bdfa68ed3eb6a8643e498bc2bc14945eba97f7a6bba42f32b93f542dba62b647bb7bb6153b2d9db3bbb5ee8f3bf47fdcba52605739bae4a13bd87f4fbc20d8de3cbdfa44bc1b36983ccc051fbc1bd4013bcfe9c6397c6f55bc893cfe3cfd0d53bd69acb0bc547e55bd392e923c857b49bb047f803725ebd63b0a11863bf5799bbd6d13f53e8ac9363e001454bced455c3a1dacf9bad8b93d3abde248396c0797bb679cd0bba1f73ebba0b05839f1e205ba2077403a334100bbe744da3b0fdb7e3be348ee3c5147a43c5ef8f7bbefcbcc3b323a0dbbdcd3bfbbf69e413ca6cfccbc7c6f94bd4be398bd1961913c14c4dabb048daa3aabb0adbb6838da3cedc2aebd5dd3da3eb556963ee15d66bd719b553cbdc3e4bad7da183b9ab16abb4c9d53ba030393bb5032bcbbe41b623bda1b8eba7c41fd393edfcdbbb24d233c6a854a3ccb76f73b90f7dc3c07640cbc354d0c3bf23f1bba67ace2bbe2650b3daf47adbd996dcabc4c7c88bdb095053c635a5d3821ce153ab4976e3b3a5e6b3b3aac97bd13e6023f8334293e6e4182bad5a92eba25e30abb4ebebf3a07b2eabad0a2cebb3ac3d53ba3aab9bbda70483b3540aababbb7ed382c0940bb7f2ee1ba7e9df23cdf45a5bc6ed1793cbd0d91bb68989a3a91f7dc39ae91d6bb0144103d45fcaabd14c1b83ac2a41fbd65f1a73b34f5e8bad21817393e14b13b4f3dc4bb74d983bd5152023fdbb6003e143fc53bb7faf13a4fe708bbb293df3abc600bba0f2558bb53f503bc17340f3a0878b8b8fd491bbad29b5a3a5cc949bbdb57aa3b1eb4c53b73afca3c5ee0923c5eac27bc73b5e03be35c37bbedb6debb6652983c8eae10bd645288bd13ea83bd625c843cc271d1bbb044ac3a2c3b89bb8023ae3c3d7eaebd740ae83ee788823e334624bd0bd4003cd5c9f53939d20d3bd033b6bbd584483b960fb8bb4c1c61bb64ef213bf3739bba09085c3ab0cb1abc85cd863c4ad3043c5617833b997bb53c459edfbb3d66453b985387ba92b267bb0ae30c3de19acabd937379bc24a646bd41098dbad3a6793aced781b8f1f9303b13e552bb503385bd645e0a3f6409f03d3215313c913d123b4d971bbb3530ce3a3b145ebb867e8abb3607cf3b73cca7bbb968e13a0fc65bbab5bebe398fa4febb7a9c3a3cad60a13c49d4a1bcad2b633c4a102bb980bf4c39ff669cb93f46eeb87518f03c1eaacabd8bf7933c17f80ebd2a1074bb9bb018b9dddd893a20ad623b60a527bc415b58bda758073fdadfb53d80ba9d3c1036a43ab07027bbf41d6e3b222abdbb842d1e3a6c368ebc2bab383b045485bb97b48fba5ff95c3a76d5a4bb27c38d3b9083213c2194fd3cebf8c33cb05b18bc96db393cc3bde3bae0d794bb9a0da43c29b3debcb2e1a9bde3416cbdf1d6ea3b9fdaa6bb657620bbd09478bc3814023d1886dabd6d77f43e6502753e5b1a17bd4ea48d3cbe71e43aa94a4a3acb24b1bbf01f523b5e6e2fbb4f645fbbdf23083b131b47ba9b93053ae0363ebce0619a3c7ef9b73b92db843ae184723c9f31a2bbe477d23a863133bae75fabba5338f33ca9abd2bdf7ef8cbb1440e7bc5e89bbbbc1017c3b18d99bba638e43b9e91d85bbd80a45bd9f3b113fe31c683dc9c2943cc076e43af144d3b9ccb521bb5fd377bacf0b40bad30d293b91e2efbadda84e3aa6f669ba2db4e339c73adcbbec91af3c6be89eb9c25d2dbcbb12b73b7749923a3cc7383af21f3cb9d50c2f3b34a79a3ccc53dabd896de43c31ff65bc1537abbb9f3cf2bad4fadc39b0147f3a13ce58bc43c2c2bcd66f103fc0eba93cdacb8e3c01d3933b922881ba195d4f3aca831fbbe8625a37801b7ebaf9cc1a3ac277eeb9e5b3e7ba8314df39d91110bbf956163c9476c5bb3f4b02b80345e4ba9ba67cbb79feff3b872fe8bad1fe84b941e6b9bbecb9aa3c8ecdeb3abb338e3b35a86e3c22617ebb9b8cc7b9e5a605ba0a297739677072bb45a1993efd0c303ea2628e3bdf89faba460a283ae1d20d3ade37a73a2f1e27bb265bc8ba7341c93aba333fbb4a1efdbada490c3a53bda0ba4812f63bfeaa7dbb1aaf34ba0150a7bbf1049fbb99323e3c4e64d1bafdf2f2ba0f82cabba1f4033d16e69b3bc54b293be751af3c7c8c8fbbffabf9ba5b4fd3bac75bd23ab6521bbc3435c73e584d9d3d4135923bfc8caebb672f8f3a61e838b8c3a2e33b52b71bbba95ad5ba54a8ce3965e289bbb8866eba360c0e3990f2c1ba5a9c9d3b13948dbbaf449a3a24db17bca14a7cba1d55163c75c83eb9359d803771e15abbe529ea3cbf8abdbb6a5b0fbb8d06ca3c91ae0cbb748a45bb0628c9ba79877739401005bcc05be83ef68be73c5ebf183bb6af25bc05688b3a20133039249e82ba4c7260b936ccfb39c93094ba34346e3a75f49fbad17a5339391586bac5eda93b36f87fbb5185833b30d4653baf9b51bb2ae1773b05e5a4ba85a0c8b9f37b7ebb8bfc603cc31bcfbcddc9a9bcdfe0163c933955bb475f963a936541399f15953b8245debcef81a13ebfa67f3e46c9abbce1e5733b7bd0acbac07d503adf9d6dbbcbb08c3adb0607ba412b83baa1a38abaee6ba8bacd729e395c6c58bb970b403c527957bce627163b0a7819bbe77092bb34b7ff3b962b8aba2735243ad01555bc66a9183d952c93bc33cb42bc0987973c674081bb19275abac8caefb9a69a263bfa68d0bc8daebd3e56952b3eeb365abc6583bfbace355cbab460913a2a8fb2ba37b18dba276c3fbb980616ba48ac93bb1d579bba43896839c7348fbba3f0703cc4f42bbce21c9cba1561d6bb3bc152bb9bae4d3cc7aa17baeae25fb93d2b46bc773c683d773936bcdd2047bb64c8e43c41a936bb367e83bb8bd603bb5a7817bb354f8ebcd00fcc3eb769bc3d340787bba2b6dbbbd1db213800f286b9dddd323ab04559bb9817fd3ac21196bbce37473b61fe0bbb85e7083a976f463af3dd093b07aed936fde9c03b485c2d3cf5b1ebbb2c02be3b423b02bbd57256bbfd5149b95ddf7a3bf6bc26bdf78f1fbd65e22a3ca2aef2bba0cd4f3b273bc53adb4bcf3bb6282cbdd3d8ac3ec5c5943e83351ebd06d4263c35788bbbe5805cba1939003b7d2cbcbb368ca83bbc12ffbb028ba13b06e03cbb81f84c3aa319253b250b263b31363abb4ded723b7346433c611622bc922fed3ba0491abb4bc4cabb7f5449bbea946e3cee3132bdc61421bd4c6c983c19e91fbcb7df9d3bcc519e3ba5dcb23b54b248bd7b5fc33e54637d3e47051fbdb71d3c3cf126f6bb5f63103b91a0b7bb36100e3a4c5e923aeb33edbaaff559ba56479abace8aa3391d94b9bba2635e3ced5786bc3a50ceba8d6a60bb6f3e94bb9f42013c4a124bba21b1693a61278dbc156d633d8baeb0bc9f3777bc639eb03c444f85bbdf55b2bafb81913aae23a0badf89ffbc9a80c53e0798253ee12e80bc15ace8ba4148a3ba5a6a9eb9a6936c3a291092bbfc72b73a195295bb94eb043b5befe4ba17c5333af16e613ac57d663ba707663ad2513e3c58717d3c38f40bbc015ff63b1768fdbabba792bb034b033bad9082bbaece65bd42cd5ebd7d21303cc0a009bc9f55243b42361f3a209b3e3cb3ac68bd00c2b93e608fa03ecfbd5bbd18106e3c68a481bb571bf3baf134a13b98f617bcaf8fcb3bf98bfdbbd02ba33bbf4c4dbbfb389f3af5199a3b93f851bb50629e3be355c43b6385993c061365bcde16103c2d7d34bb3b9517bc6e04c33b6c239bb747ca6cbd1db060bdbac7be3ca13057bc4f389a3b8962a73bd5adf93b2a3b7fbd452fcb3ed51b8e3eab2453bd73be803c79c0cebb07ff01bbdaa4543be344bbbb97a2cc3b153dddbb8b03893bb2c960bb3151843a2e1e4b3bfa1e993a159ccbbb5a2057393bbd1a3c781c15bcd3bef03bcb1ba2ba694ca9bba443f9bb8f79fc3cb4e93bbde08a1ebdf047b83c0dcf0fbcfdc70a3bd892bb3b52d2253b2a365fbd0b81cd3e4ea6683ef94318bdce31213cd845bebb2593da3936cf34badeb518bb8d7b27bbc9c382bb00e8ca3a6071f4bacfa2723ac14616baa23b8f3b88b5d23a89299c3c4b6f893ca41ac2bbb44ec23bef88deba16f931bbd5292d3b0802d4bb1a8b8bbd64a27fbdd9943a3c784eb7bb9516a83a0a4f3ebb30379f3c55c18ebdd638c43ef6ada23ea97e79bd794b7b3ceac153bba8a601bbfcc8ab3bde7922bc25aabf3b58d602bc8ac8a73bb00055bb1865c83a1a31a93bfdc8edbb6fe5483cd35a0d3cdcef9e3c451353bc917d063c43b050bbb7462fbc9c027f3cbe3a8abc328a8abd64af60bd20b2a83cd3883bbc14e8943b860e923b0cdc2c3c5d2d98bdb2cede3ec303843e49083abdd4da4b3c5d949fbbb90988bb499b063c8e3128bcd2dbf93bec9f0ebc0cd0cc3be6ae83bb58359d3a8ff60c3cdf5615bc915cae3bba70b73bf8863e3c66ef15bc777ca13ba22028ba1a4c21bcdb60173b50153f3c137287bd23f22cbd1a1cb03c258ce9bbf379e33a1528b73bc154313c0a7599bd8c97e13e2c31683ece2b18bd737e003c9a039bbbd61512ba74599c39c6658fbb57239bbbacdd92bb273e1c3bef3c28bb1095c93a93c8f539014d0d3c4e1b02bb3a3ffc3c50a59a3c6c9936bc193a163c674c38bbfc9faabb26412d399127e5bb9d289fbd30c697bd2fbbcd3c4d242fbcaa141e3b0ad193bb77fbf93c5cf6a6bd7698cf3eafd9a03e88338ebd2766893cce1c80bb007bd2bad4707b3b68d400bc4003563bc635ebbbad1cec3b61a589bbf973213b1e26db3b518a45bcda1b9c3cb3043d3c4bc74f3c8d8135bc98188a3b882270bbe2a35dbce7f0ba3c5c9dfdbc23ed8abd8f2b61bdd9afe53c93c3e9bbacfeb33b5568a83bd969973c6189aebd7e06f33e2154633ee67216bd2283053bf824b7bb44fe61bbee51de3b532a19bc6961ce3b5481d2bbf40b9c3b92f535bb56b0653a39d3093c4cbf49bcb269563c0d2fd53bc00ef43b138aa4bb4310be3a01d455b976be21bcc7a1103c83dc43bb705997bd22be01bd3c394d3cebae06bb045f893abec35c3be199913c8b65babdb798f73e8b88433ec6b0a3bc911ec8b9b6af16bb6b7e6e39e76bd0b813cc83bbf71c00bc2bf5ebba19abc13aec4c2dbb549ae43aada4f0b957aee03b5fec113be3b2083d037b913c86a536bc6a6b1f3c87394abbfa2ea0bba1e9b23b3ff981bcb152acbdf3f48fbd0abbc03c7a122abc64e1b53a16d0f3bbff68043de059b5bd49a2dd3e4740963e7eb482bd7250753c84c078ba636575ba9156693b23be23bc261492b9ee6c77bb7ec85f3bf14b55bbc1e2043bc9f0983b89af22bc2cbccf3cebd4873c36d8413c78d408bcfa80c53b7dd320bbdf5d62bc6db3073d258e68bd06cd95bdae4730bd1a1e823c30929dbbbc65ab3ac6dc223bc864853c63eeb7bdccb3043fc535393ea8f3acbcf73d973af7a7c0ba0cbd3bbbd7a2cb3ba85513bcf63fa23b4c96a7bb3cf6623b258908bbce646c3affdde43bb8b153bca15d923c8629d13bee87b23bb59c23bb39821e3a367fcdb9cc6133bc247fa03c8c01d5bc06ca90bdea65bcbce342d13bc1d1b1b9e5626c3add5a873b6ad76a3c4b28bbbdf7b8043fcc821c3ef80ff4bb733f34bb395304bb4a5d263bf066e5bae15382bbb2bbf9bbc08f153ae417803a18a50cbb3cb5b93aadc515bb715b4c3b3959393c4b88d03cefd0663cf1941dbc1bdbff3b811c37bb5412c0bb10be823c2e560cbd59a29fbd427960bdb98a843c82c0f4bbc039813abf9bc9bbf827cb3ceb0cadbdc9f9eb3eb47d803e25683ebd55aa223c3cf5323a8555403b751105bb43ecfdbb4f2376ba5d3c91babcaaaf3a007908bb0669d13aeddf06bbc44344bbfda9f33cdc1d463c6a8cef3b0c9b8abbe5a98d3b50d302bb6f8729bce7891c3d9124a7bdf61789bda322ddbc0753a63be607ecbaf6eca6386d08db3a57741d3c3bf2a8bd51270d3f25360c3e3324edbb67fbfa3925ff30b962d720bad4c8393b2656e2bb31cb543b035653bb2428103b6e0014bbb8d2d23a7193143be40507bc0cb3a03c746eca3bace4383be79fa0ba221ec03a6eb7b6ba474a10bc13b2da3c80f749bd59e779bd43d98dbc80257b3b5bd8bab950068e3abe0f943b432fef3b5647a9bd0f600b3f61f1ee3d133eec3ab9a84dbbb8e80abb74e86a3bf817b6bbb2d0ce39433d8fbcf56ac63a6165d0b9371979bbbe9e7b3ad26a9fbb83e2f03a5aae623c6132003ddb03cd3c0d8f46bc3743683cb1635abb2dc0c5ba9ec1893ca8e7b9bc4dc3c5bd67df63bd7ca51c3c152d1fbca6bdde393e7586bc60fe053dae26d8bd1f80f43e5224803e3d883ebd0c52af3c1d954d3a7256993b98ef9ebb4a43c7bbcc8390bb08d003b82198c93a4e4b08bb5e50b83a1e60a3bb29f390b8e519de3cfc3b7a3c3d24e03b9a5ea3bb3f8f8b3bd87b13bbf59a04bca508073ddd259fbd16db80bde625c6bce446b33b3ead9fba7df444bad89541bb4345483c2d37a1bd0ded0f3f2658e33d36e8a8b96e25afba003b423b0a6d853a50ea5bba5f8e5abb29676d3afe37afbaf18da63ae917e1ba7b37b73ac08146bb0c047a3a5a14593cc69d893bc4508a3a95837fbaf1e2e83a5f76c0baaa3455bbb593bd3c0aa88dbd2af105bda4ef2fbcbe18233b3bea4cbac5a1433aa22c003b87ba5e39ad6a59bdb001103f1b237b3dfb24e53b4aec07bba85739ba48da4e3a7c0c10bb600e88b95e3609ba59f62e3a5810c2b9ac36e8ba0ab3de39867c1fbb0d61163cad94babb3e307739cbccf5ba466b7ebb98fdfe3bb7b0e7bac64b01372a15c6bb14a6aa3c437774bb438d8e3b75d26d3c71a77cbbeb80e8b983d580ba52beefb7fb43e73a739d993e2a2a303e62438e3bfc1ee0baecef213ab7030e3a869aa1ba1d11f5ba34d8d0ba5ba38d3ab203fabac4f2d0ba2f5f0c3ac692a63acb20f73be9b3cabb22aed23a348caebbb9578ebb4bd13d3cbda4fcbaff2a28bba3fa7cbbb1d6033d27b71abcaa2b923b860caf3cbacb9dbb93953fbb5809c6bab49131ba94b99d3bfa1fc73e7c6d9d3d4d77293b9672a7bb4adbc73ad762ff38c6d9f1bac678583978f8dfbab2499c3ae98b50bbe43094b820b8e738ef0fcb3b25eece3bc64872bb2d78a63975b828bc0c1508bb9ca5133c38103aba353019bb4c66a9bbf9e1ef3cc69d05bc21a71c3b1d08ca3c478d64ba13b38ebb4f2ce4ba3b749c3a7483c7bbd473e83e9b23e73c773f0ebb49c018bca0d6163a3b0e3039c31486ba43a0c8b92b68413955d5acba235f963ac3e1a4ba366d5339ba9d82ba2ceea93b1c7c7ebb8216953b48ec733be03655bb8adf773b59f19fba597160b954f87fbb1afb603caa44debcd6c9abbca0de163c509851bbb4336e3a88cefb39ca85833beb1acfbc1b82a13e43a67f3e80caa9bcf5db653bc43594ba637e503a016e58bb9f45243a15c9efb992225cba5e3f5abac32e8abab2859e39339f6dbb4d09403c781655bc81a5263b4481bfba3a4381bbeebbff3b976ca8ba65ba8c3a287a57bc0aa9183d3c6ad0bc103d5abc4288973cea7292bb83b18aba3f0607ba5832163b742e93bc76aebd3e76962b3edcd142bcd47719bbc81f83ba3f709f3a9cd295bbbfc810b905ea06bb1e4f9f38df4484bb136814ba7407643950c3d2baf717793ccfeb49bc212212bb0793ddbb126534bb573a4d3c65f698ba992085ba3b3430bca478693d9bcc8fbc781884bb355ee43c0f4e50bbae9694bb2c3141bb5d0295ba4f6e39bccb30cc3e7810bc3da12142bb0599d7bbc3070abab2f286b95970463a0e7356bb113bc53a2a788bbb64cd4f3b3b3a02bbdde4083aa4de323a95dd093be24b49b9a84bcf3b29d4263c67aef2bb3301be3b6dfd0bbbeb4559bb6d74da36ddde7a3baa282cbd89351ebd7ce22a3cbdb1ebbb9f37473b8217fd3ac9e9c03be9bc26bdd4d8ac3ec2c5943efd8f1fbd6d5c2d3cb81196bb44815cbad619253b72c4cabba9519e3b5c26f6bb63df9d3bc3491abb6cf94c3a4b39003bb70a263b285449bbd0dcb23b6e1d3c3ccde81fbc1a2fed3babdf3cbba52cbcbbf4353abbcc946e3c33b248bd53051fbd496c983c0e1622bc7f8aa13b118ca83bb3ed723bcc3132bd7a5fc33e4a637d3ed01421bd2f46433c1512ffbbf632123b5f14bbbbd6a3703a55e38f3a8d07a2ba854fb3bae07a4abab9cba239a63ab9bbc1ab5f3cde8e8dbc64e69cbae882eabaecfe84bbb91e013cc03d99bacf2b153a81c386bc99a8633d11e4ffbcbef67fbca581b03c37ed93bb04085cbaa1c8903a9733cbbadc09b1bc5487c53e788d253eb3d476bcdc4461bb30f4ebba566b9eb93c70613aeba792bb0c381f3ac7a481bbd555243be967fdba0ac5333ad7946c3a327d663b6b4b033bf49a3e3c50106e3c55a009bc615ef63bfaeee4ba671092bb040a663ad19082bbaeac68bdbcbd5bbd4f20303cd6f30bbcc5eb043b3274b73aa2513e3cadce65bdffc1b93e608fa03e32cd5ebd92717d3c6f5295bb571bf3baf5199a3b3b9517bc8962a73b79c0cebb4f389a3b2d7d34bbfb389f3af134a13b93f851bb6e04c33bd5adf93b73be803ca13057bcde16103cbf4c4dbb98f617bc50629e3b6a239bb72a3b7fbdab2453bdbac7be3c061365bcd02ba33baf8fcb3be355c43b47ca6cbd452fcb3ed51b8e3e1db060bd6385993cf98bfdbb2cad01bb7a8c4a3b430ea9bb0151bb3b74f8bdbb1e6f0a3bba9ea1ba4709843aea09543b8ee79a3a0999f9bbce47263b5012213cafb00fbc5b91f03bd28a60bbca01bbbb6ff6cbbbf88ffc3ca53f5fbd823c18bd663ab83c49ff14bca0bc883bdd70cc3b698e5e3947f33bbd5c82cd3ef4a3683e66831ebd11a11a3cadfadcbb818bda397e3f16ba5cfb31bb0e4d3ebbf6c253bbf918a83aea8adebaafa4723ae0c734ba493a8f3b6d2d2d3bc4369f3c6c4b7b3c584fb7bbaa4fc23b6273f4ba41b818bb0ebdd23a4e05d4bb3cc18ebd157e79bdb8943a3c9a1bc2bb83eaca3a5b7927bb0b299c3cfb8a8bbdff38c43eaeada23ecda17fbd536f893c6bc482bbaaa601bb1d31a93bb8462fbc800e923b5a949fbb15e8943b41b050bb1865c83afcc8ab3bfcc8edbb9d027f3c0bdc2c3cd7da4b3cd4883bbc907d063cb20055bbde7922bc70e5483cbe3a8abc5d2d98bd49083abd1eb2a83c431353bc8bc8a73b22aabf3bd65a0d3c328a8abdb2cede3ec303843e64af60bddcef9e3c58d602bcc8f787bb9ae00c3c052521bcbfc8b63b54cb9abb5357e33a7e2c28ba29279d3ac686063cdd3c15bc8ff0163bdf79313c305d003c6c6ce9bb026ca13bea9983bbad1128bc0826ae3bcf2c3f3c3e7899bdb02418bd1e0fb03cfdd615bc9194cc3b9b7ff93ba3b1b73b5a7587bd4e98e13e972f683e15eb2cbd4d643e3c646f0ebcd61512ba93c8f539fc9faabb0ad193bbce1c80bbaa141e3b674c38bb1095c93a74599c39014d0d3c26412d3977fbf93c2766893c4d242fbc193a163cef3c28bbc6658fbb4e1b02bb9127e5bb5cf6a6bd88338ebd2fbbcd3c6c9936bc273e1c3b57239bbb3a3ffc3c9d289fbd7698cf3eafd9a03e30c697bd50a59a3cacdd92bb007bd2ba1e26db3be2a35dbc5568a83bf824b7bbacfeb33b882270bbf973213bd4707b3b518a45bce7f0ba3cd969973c2283053b93c3e9bb98188a3b61a589bb68d400bcda1b9c3c5c9dfdbc6189aebde67216bdd9afe53c8d8135bcad1cec3b4003563bb3043d3c23ed8abd7e06f33e2154633e8f2b61bd4bc74f3cc635ebbba06d61bb7694093c518921bc925b5c3be19616bb0473893af5b256b9fcc3653a0ebcdd3be45949bcff53103cbdaf913cc95ecab97b9d06bbe013be3a6ded35bb53db18bcc412563c1dbf42bbc36cbabd799da3bc81264d3ce678a4bbd0f49b3ba1f3cd3b7a9bd53b856097bdb09af73e1485433ecbb401bd76dcf33bb54bd2bba27e6e39bda4f0b9f72ea0bb1bd0f3bb12c078ba3ee1b53a8a394abb4b9ae43a216cd0b856aee03ba4e9b23bfe68043d7750753c82122abc776b1f3cf04c2dbb10cc83bb63ec113b3ff981bce159b5bd7db482bd06bbc03c8ea536bcf5aac13af91c00bce2b2083db152acbd49a2dd3e4740963ef2f48fbd057b913cf4f4ebba636575bac9f0983bdf5d62bcc6dc223bf7a7c0babc65ab3a7dd320bbc1e2043b9156693b89af22bc6db3073dc864853cf73d973a30929dbbfa80c53bf14b55bb23be23bc2cbccf3c258e68bd63eeb7bda8f3acbc1a1e823c78d408bc7ec85f3b261492b9ebd4873c06cd95bdccb3043fc535393eae4730bd36d8413cee6c77bb50a73bbb05cde43bb35933bc844f873b0a4804bb095a6c3a6e7ccdb9805a6c3a5b8ecb3bf3a453bc3a7aa03cf6dd6a3cff4c34bb0bb2b1b97b861e3afe8308bb7e4a13bcf857923c3cfdd4bc3229bbbd9a04f4bbcf3cd13b3d9723bb47e7623ba52ca23b1838d13becca90bd1ab9043f4d821c3e5f63bcbc1c80b23bf588a7bb4a5d263badc515bb5412c0bbbf9bc9bb3cf5323ac039813a811c37bb3cb5b93af066e5ba715b4c3b10be823cf827cb3c55aa223c82c0f4bb1bdbff3b18a50cbbe15382bb3959393c2e560cbdeb0cadbd25683ebdb98a843cf1941dbce417803ab2bbf9bb4b88d03c59a29fbdc9f9eb3eb47d803e427960bdefd0663cc08f153a8555403beddf06bb6f8729bc6d08db3a25ff30b9f6eca63850d302bb0669d13a751105bbc44344bbe7891c3d57741d3c67fbfa39e607ecbae5a98d3b007908bb43ecfdbbfda9f33c9124a7bd3bf2a8bd3324edbb0753a63b0c9b8abbbcaaaf3a4f2376badc1d463cf61789bd51270d3f25360c3ea322ddbc6a8cef3b5d3c91ba8ab120baf984143b454710bc7e0c943b5fe50abb75038e3a45b5b6ba02cfd23a62b8393b870107bc68b0da3cd732ef3bb3ac4dbb5ec8bab9841ec03a41fe13bbc04ce2bb37b1a03cd4f649bda847a9bd3050ec3ac9207b3b2c9fa0bacc23103bb8bc543b0873ca3be9e779bd1d600b3ff7f0ee3d4bd88dbc9de1383b144e53bb3bef6a3ba26b9fbb7bbcc5ba207586bcb29a4d3afabdde39855f5abbcf937b3ab018b6bb79dbf03a87c1893c42fe053dcd51af3c2e2d1fbc9c41683ce21479bbfae0ce392bae623c96e7b9bcac26d8bd3e883ebdcda51c3c348f46bc3463d0b91a3d8fbc4232003d4bc3c5bd1d80f43e5124803e64df63bd9803cd3c226ec63a7256993b1e60a3bbf59a04bcd89541bb003b423b7df444bad87b13bb5e50b83a98ef9ebb29f390b8a508073d4345483c6e25afba3ead9fba3f8f8b3b4e4b08bb4a43c7bbe519de3cdd259fbd2d37a1bd36e8a8b9e446b33b9a5ea3bb2198c93acc8390bbfc3b7a3c16db80bd0ded0f3f2658e33de625c6bc3d24e03b08d003b8d178853a3d8746bba32f55bb2b29003bdc4439bab489433ad56ac0baa62cb73a34095cbaa61d7a3a2893bd3cd2f15e39caee07bb14db4cba24dbe83a640de1ba47885abb4c13593cf3a78dbdd16a59bdfc26e53bf715233bac7b7fba2485a63a5d516d3abe9e893b6ef105bdb601103fd2227b3d26ef2fbc6f4e8a3ab731afbaa7c33a3ab08e00bbb345d6b9d56989b9e7fc243a1594f9b98e52d6ba8861c93919b623bb057d0a3c01029abb372623b54979afba015872bb447afa3beaa7e7bac17b4c3a8845c5bbddf4933c5858b8bb777f773ba6bb6f3c25e585bb9fe11eba78fa8cba578716370237293c0c02953eb981343ee7a78f3bb2adbebaf8c1063aed64913972cb17b985481dbbc04915bafef8a73a713e36bbedd790baab001b3a85c83c35c4ae1b3b4c3862bb928c7f3a574a83bb41459bbb9743563c13e535bb9274d33acefbb03b875f6c3c91d15ebc68ffd83b043ec03ce42f89bbcc8962bbe67c36bb9686e2bb9957283db4d8be3edc94923d3461613bbacccfbbdb6c963903d4e3b741582d3bf3ef0bbb9691ac3a70e4a9b8534cc2bbaf4883390ce73f39510f4e3c0f2640bbe8cc56bbcb8a5ebbf94e2bbc2249b4bb8670bc3ce3c689bbf526c4bb63dfa43c3ad1913c70c31cbda557fa3ad328263d3a477cbb083c16bc001f00bba3a5943bbae46b3c7b5fd93e24c4593d6b95483bc751c6bc08cfa83a4f861039ccd57dba426607b9eb72a8b918c394ba6314883a5ec986ba5a9923391dcda2ba57af943bee476bbbd00b9f3b4e566f3b533d3fbbc02c5e3bb82995ba58387e39a18262bbab6b463c2c2dddbccaeeacbc05ce103cae3e47bbc904273a6de8043a8a957d3b913ab0bcccbd9e3e0a47813ec59aa4bc6529523b085187baee880d3a21fe1fbbe531af394f540fba1e49fcb941c788ba772088ba2554923919ab85bbfa1e183cf61634bc7fefb83ab63888bad0dc6bbb85b8073c09e8c7ba4bcce73a12fc31bcd846f53c97debabcd83467bc3b3ea83c42bbb5bb34e49aba3ed35dba6968c03a65b2a33b1d92b13e9401313e7ae129bc668892bb6fd0c8ba12d6293a9e2d9fbba7f71eba5486c0ba159c18b9ff098cbbc820b8ba48cc043a5d2d893b1c070b3c6db53cbce1c18cbbc402bbbb2a3c8fbbb9be993cc63d47bbb7f561bb9da4f73b28172a3db2b696bc0a333bbc4080343db1ce13bc58e0a0bb5baa06bcaf458a3b35472f3c31edb03e6078013ee64e8cbad67d48bc63d312bb5fb672b99ac6373aea322cbb2f004a3a00c376bbf289393b1bbad9ba7cffe639abb2b039452bee3abcc610ba2e4be33bc3131e3cb7b2d7bba017a83b984600bbd65630bb664c94b72fdf363b79e92bbddaeb1bbd3276193c3a97cdbb59e6153bb07efc3a82cabd3b08781cbda773ab3eea9e953ebf2620bd47a8223c5d5686bb0fcc11ba8280133b6cc5a4bb8ff16e3b11e8cbbb527b863b47d0e8ba6e72143a10883bb98c3b1f3bc64e5cbbdf9dd93bda40163ca3b0f7bb6562b53bb14215bb2a573cbbc78922bbf4c3163c11b83fbdc43d1fbd72ea9a3c6b9918bc2c20863b0640523ba5602e3b8d86e8bc5f3ebd3e9668803e1ecd26bd398f233ca69ad1bbd92d963a8bde5dbb1596be399804093bdbe0e2baf121bbbaf89f3dba21d4aa3928daadbb0e1b0b3c3f7a89bc35312abb192511ba15b487bbed3e0d3c1c8bbcba8e8aba3a1eb12dbc8d5f413d886ceebc35ce91bc2b30ce3c0d8adbbb01e01eb9984558ba994e89bb50dc363caba3b23ec19d373e2c3493bc06e6cabb6b782abbdd4ab9b989f2923a7b5785bbb1e893b9e67e52bb82e4153b21daebba03611d3ad823323adcdc303b6c3f4f3b5169403cb2ae5d3c28b1e9bba6bdd13b8366c1ba7fd071bb32e50a3a2f4fbfbbb68a68bdc86258bd8f26173c58b7e3bbf60be03ace83863a36ba4b3cf03c5cbd66e4b83e534ea13ede4364bd19cc7c3c3dd79ebb2f41a2baa4468d3b8198f8bb24b02e3b70c194bb92a7673b0bf3d6bac1d44e3a88a9053b6e5f80bbb974073c3183093cfd5d613c764c2cbc06c4c33b6e3029bb874b6fbbafd6753b975fffbb319478bda4d750bd8bf3c13c089145bce494a43b9810f43a6f96df3b569b32bd9f0ec83ebabb8e3efae475bda7b08d3c8c13e0bbbb180bbb7918cc3b8288a5bb682a623be9fc78bb1a02063aae5bb93823e0e039d65efb388031eebbf9e889ba3f410f3b75a73b3c836116bce15ab53b5ff133bbe51d0a3b66693fba016a863ccd6f61bdeebb23bd50e3e73ca92c2fbcbcf9b33b81f58b39d339b0bac850bfbcd1aec83e704f6e3ee52342bd2137153c2817d9bb7ed5c6393c9242bafe2325bb1d0b64bb512f3dbbd1f3ac3a4f5bbbbac8ee393a404d26ba9648873b88e7943b71a2973cad90723c7a6493bbbfd9903b468aa1ba1a53e5ba353b7f3a773c13bc4ac48dbdb06f71bdc529123c89c771bb482d853afaf642bb01189d3c6e1882bd4a12c23e4017a43ef4e283bd14c5873c0b6c86bb66cbeab8ad92c53a49e9f4bbffc28d3ac73507bba5f7033b1e2bb8ba64f4683a849b963a396d85bb8d1da53c2f1d1f3cfcc3363cab5c1cbc8260c23b197624bb57b4ebba518ad13b2dbde2bc2af195bd7e8935bd6317c33cd5aa47bcb3f5903b02f2a9ba9569173cfc8d37bd307ed93e6aa0873ea21491bd1ca6b23c4cb7b8bb9c3225bb0d93213cd1a141bc8c1e613b3dd589bac9288cb919a8f539ea179c3955b7fc3a87ed86bc35458a3cfe11ef3b12720c3c0dc10ebc2a178a3bf2931fbb6d03153ab740643c58d74ebc43f094bdfb1c17bd2b1ff83c475060bc13dcc03bcbba05bbd05460ba666e16bda507df3e6cff673e3b1d72bd14de923c9a53bdbb66e8d1b79a102eba8feabbbbb2ef60bb49c792bb0c9c173b628112bbc2ed843a3ae669399ec5013c77c4d53ba4f5cf3c3e217b3c5238b6bb46d3a93bf8f083ba75119abbb92a663acf568dbccc909ebdde0680bdfd6a7d3c8cf7c8bb9ab5c33a309076bba587dc3c51be8cbda2facd3e71ca9f3ee10697bd5764a23cd664b3bb4ed4c23a22af2bba951f45bc2f15cb3b97f7a6bbb866553bb34308bbb760a63ac6e179bb20dd963bbcd0de3c87fe583c14945ebaedc1e0baabc21a3b4393ffba2ca06a3ae741133c988666bdea24a3bd498bc2bc113eb33cfdfc43bc56afa43b64ea53bbf916d73b4192eabcfa68ed3eb6a8643ea0959ebd2da7cb3cba32babba42f32b9bae4a13b7c6f55bc25ebd63b1dacf9ba037f8037cfe9c639526057393f542dbad87f4fbc893cfe3c0a11863bed455c3a857b49bb1bd4013bf47fdcba62b647bb20d8de3cfd0d53bdf5799bbd001454bc392e923ccc051fbcb5ee8f3b7bb6153bbdfa44bc69acb0bc6d13f53e8ac9363e547e55bd1b36983c2d9db3bbd8b93d3a334100bbdcd3bfbbabb0adbbbdc3e4ba048daa3a323a0dbb2077403abde24839e744da3bf69e413c6838da3c719b553c14c4dabbefcbcc3bf1e205ba6c0797bb0fdb7e3ba6cfccbcedc2aebde15d66bd1961913c5ef8f7bba0b05839679cd0bbe348ee3c7c6f94bd5dd3da3eb556963e4be398bd5147a43ca1f73ebbd7da183b3edfcdbb67ace2bbb4976e3b25e30abb21ce153af23f1bba7c41fd399ab16abbb24d233ce2650b3d3a5e6b3bd5a92eba635a5d38354d0c3bda1b8eba4c9d53ba6a854a3caf47adbd3aac97bd6e4182bab095053c07640cbce41b623b030393bbcb76f73b996dcabc13e6023f8334293e4c7c88bd90f7dc3c5032bcbb4bbebf3a330940bbab91d6bb3d14b13b4ce708bbc718173987f7dc39c1b7ed3804b2eaba7e2ee1ba0144103d4b3dc4bba6faf13a3bf5e8ba69989a3a3440aabacaa2cebb7e9df23c45fcaabd74d983bd143fc53b6af1a73bb80d91bbd970483b3dc3d53be245a5bc1bc1b83a5152023fdbb6003ec2a41fbd6bd1793ca9aab9bbb293df3a5cc949bbedb6debb2c3b89bbd5c9f539b044ac3ae35c37bbd29b5a3abc600bbadb57aa3b6652983c8023ae3c0bd4003cc271d1bb73b5e03bfd491bba0f2558bb1eb4c53b8eae10bd3d7eaebd334624bd625c843c5eac27bc0878b8b853f503bc73afca3c645288bd740ae83ee788823e13ea83bd5ee0923c17340f3a39d20d3bb0cb1abc92b267bbf1f9303b4d971bbbced781b8985387ba09085c3ad033b6bb85cd863c0ae30c3d13e552bb913d123bd3a6793a3d66453bf3739bbad584483b4ad3043ce19acabd503385bd3215313c41098dba459edfbb64ef213b960fb8bb5617833b937379bc645e0a3f6409f03d24a646bd997bb53c4c1c61bb3530ce3a8fa4febb3f46eeb820ad623bb07027bbdddd893aff669cb9b5bebe393b145ebb7a9c3a3c7518f03c60a527bc1036a43a9bb018b980bf4c390fc65bba867e8abbad60a13c1eaacabd415b58bd80ba9d3c2a1074bb4a102bb9b968e13a3607cf3b49d4a1bc8bf7933ca758073fdadfb53d17f80ebdad2b633c73cca7bbf41d6e3b76d5a4bbe0d794bbd09478bcbe71e43a657620bbc3bde3ba5ff95c3a222abdbb27c38d3b9a0da43c3814023d4ea48d3c9fdaa6bb96db393c97b48fba842d1e3a9083213c29b3debc1886dabd5b1a17bdf1d6ea3bb05b18bc045485bb6c368ebc2194fd3cb2e1a9bd6d77f43e6502753ee3416cbdebf8c33c2bab383ba94a4a3ae0363ebce75fabba638e43b9f144d3b918d99bba863133ba9b93053acb24b1bbe0619a3c5338f33ce91d85bbc076e43ac1017c3be477d23a131b47baf01f523b7ef9b73ba9abd2bdd80a45bdc9c2943c5e89bbbb9f31a2bbdf23083b5e6e2fbb92db843af7ef8cbb9f3b113fe31c683d1440e7bce184723c4f645fbbccb521bbc73adcbbd50c2f3bb0147f3a922881bad4fadc39f21f3cb92db4e3395fd377baec91af3c34a79a3c13ce58bc01d3933b9f3cf2ba3cc7383aa6f669bacf0b40ba6be89eb9cc53dabd43c2c2bcdacb8e3c1537abbb7749923adda84e3ad30d293bc25d2dbc896de43cd66f103fc0eba93c31ff65bcbb12b73b91e2efba422c143ab9eddcba3b9523ba5f3de338c9b4183a9f2a20ba0f0ac4baa3c3b939db8c2bbb1501fc3b45a082bb3e02b53971965bbaf21a69bb77bef63ba8cbe2baf6f6b93a468bd1bba116693c76afa2bb9d5f793b83a96d3cccab85bb5d7a64ba8da072ba2499563a64469d3c3d8f8d3e12453a3ef061bb3be1626abad300a3371c401e3a33e3c4ba4d1711bb8e533c3af925ac3af7b71dbbdd7883ba4a070c3ae18d04bc00e8aa3ba09e7eba07b101bb97c652b90c4ac0bb4941623cbc6858bb28ee8e3c3c6e0ebcae899b3a7cc7c0bba83b043c5fb2b03cb8fd75bbc8c74bbbb2eaa0bb896905bc5a1bde3d0d30a43e6b66893da3605d3bd6e2a9bb10e13abbd4e305396690debb02f8c93b0788b3bbd2d9613bbf7e01bcb437183bd483e838af1e76bc543eec3c80cd8cbbd8d9eabbab04b13bc8709ebcd2b2f93cece909bc1b344a3d0d2222bd20fa383dcaf74cbd26e7b1bc148b453d872c4cbc3406f8ba754841bc762e5fbc26133e3e7b39933ed0f1843d682572bc4cb2cbbc1313f43b771fe638e3bd56babe4c65b91d72adb9f6148cba1e1e7b3abdab83ba4e8116399033b2baf83d7e3bcd8c41bbe1b9953b27216f3b17ce35bbb545563bcefe97baf3899139477f4abb076c243c1ff2d1bcfd78adbcd68d0d3c0a9340bbd68ee53912eb3a3ab121653b142d8cbc549a9a3e333b833ebf159dbcbc08573b238e71baf8a3d83978b0f4baa97a1cb91ebb86b95513b3389fa18fbaa0496fbaba558739cc5faebbb8eb083c3fa021bc4d101739b3beabb9b3c369bb408b0c3cc1a0eaba3d57543bbf212ebc4f50a93cda6485bcb30249bc7d81a03c43c0dabb978bcaba5f3985ba7d35183bf5aa053d81e6a03ed5dd343e2150b5bb5525c0bb35f710bbd5281b3a470d85bb6e5612bad01f69b94c22843a545281bb596730ba554ae039ca692abc06f80f3ce72e59bcb633edbaeafe6ab8b72ee0bb8393923c1b9c8cbb7ef7653c6711773bf4e0ef3cb9c430bcad264abca2421f3d31681cbc464f5abb8911fcbbb8a1273c8535a83d68c9873e15370f3eb5b5ccba54f48dbcc5355fbb5054d0b86f3e6639fda303bb700137397b4a40bb0246133bf182b5ba7668c63956913ab8904d0a3be6f97aba4c56f33b90070c3cebbec2bbd9d0943b2582e0ba54d30dbb814c15bad9600b3bf2eb29bd27c219bdd0af0a3cae53b1bb7072da3acc3be83aeef5c43bed2211bd7e12a93ecb0a973e49841fbde985173c520367bb3c6cd5b94017103bdd5b90bb9097513b8831afbb2b70803bc95df3ba14f5f239bf5127bbc94b913b6d2a95bb2f92093cbc22ab3bb20a8abba5c9423b63728dbaad85b8ba28f429bb47e2133b6c6b2cbddd081abd82d7963cb8f70dbca331513be8bcd73ab893973b101c66bcfa49b53e8871813e497a1bbd8b9bbf3bb9a7a0bb42f1ff398ebd03baf49867ba5d98213ba76c11bb372733b90dcfc1ba57899339ba3e21bc3a550a3c149681bc6bf1eb3ae8b45ebb6e3ac739d1408d3bc96e173af435bd3b4d70a3bbebd9b23c9073b4bcda959ebceeaccf3cc4f910bcb0f52d3ad850bbbb3d35873b2df02d3d1236a43ebde03c3ec76b80bca16c17bcabee81bb0ddf7ab92e452d3a783b47bb5e8e8cbac34225bbfc84b03a20ac9fba0e96fd391873313aa88a253bc2fe353b0ff0423c82ed573c69a7b9bb6feaae3b2668b9ba27cf4ebb169659b90a8ad0bbb20b65bd51d758bd666df73b3368b0bbee92d73a8657fb39d0045d3c272652bda590b63ed2c1a23eb27563bd6e116a3c43ca9dbbce9b2dbab67d2e3b03f3bfbb48ecec3aca5f5fbbb6e0423b1fc0afbad1a40c3a01b64339a92e84ba9943083ce096123c0e612f3ce72d08bc36a4813bf308e1ba1adab6ba277bbbb81b8d7cbca46564bdb42d4cbdb023c43c083c32bce8fdab3bbb040bba782f543cf09efabc176dc23e363b8f3ee7d375bdf1ca383c730fcabbec46af3abf4816ba342bfd3a170ca1bb9bcc973abbb71e397cafd4b95c36d63817232abbbe2aeabbcc10a03b0969043ca63d2d3b8a0fe6b9c08d17bb5dd6aa398481623b3786db3b173d95bcde590dbd49955bbd20222d3d40daa0bcf6e7233c125729bc9885943cf5d128bc09ebc63ebb47663eb34643bd8e999b3b63bcd9bbd5be9439c6aa52ba1c4d27bb11c151bbe43755bb475a923a845a73ba15a3e3397225b8b96a8d9a3b28d58c3b4b70973c078f703cde9966bb3c18693b95ca69ba57580bbb3bc12db9ee9018bc98088dbdc3466fbdd9a7f13b74350bbb5a8b133ad1ca37bb4a42a33cad6976bd0d4ebf3efd42a63efa1788bdfbe3863c6caa8ebb8e5d89396c0600bbc50e9cbb940f7fb5568a29bab9d6a83a2dd28dba5ed7133a5bb4343ae4a28c3b0b60983cc903113c1dfb093c9e700fbce7799c3b5c9fc1ba576de4388d9df0bbc0c407bdbbb68abdb28e2cbde19cd73c48461fbc4255413ba6c167bb2787973c4376bdbc6e4acf3ea3ab8c3edceba5bdbeb56c3c560455bbdb0bad3a9ed927bb44c0e0ba736f78bb1474943b2650e6bac44d1d3a310b94b867aab6bad0b4e6bb8682d53cd3bf603b4d3b6f3bd87be3bb8328de3a4c3948ba4643f93bb0637e3a7c852fbd2ecd59bdeeaf29bdf2862e3d677b8fbc4194ce3b32a66bbcf161af3c9fc109bc86f4d73ee233663e921191bd0601143ceabc9bbac68fc2b94421a6bae77a98bbf6c87fbbfcd47ebbaf37e83a3bfdbfba3f0be1391daaa63acabb093cd944ca3b029cc63cc1b0703cb0128dbbd6be743bdf24ac37549babbb9242ffb9169c8ebc9b379cbd3d657abd8a2d5f3cbcf58bbb68b80c3a58ef67bba790dc3c982d83bd2809ca3e55eba23e7a589dbdb45aa33c4aa2b3bb4647ddb99e8f7dbbe17d03bcb845ad3be3fb77bb2799143b8f810fbb8564893aa6420dba13ce9a3caa769b3c1a953c3c7d2f22bb3652bfba1be3413bddecbcb96c84263ac28d57bcb7407bbd346f8bbd6a7bb5bc67bad43c21354fbc5f3ee03a9c6401bc9775b53c4005dcba7be5df3ede73753e1181ccbd26dab93c92ec97ba9760043aee92a6bb838f32bbd8a2443b9089d5390dd5c2bad0c24c3a08b2bdb8f1c764bb2525243c6cc1f43ce70412bccc7a223ba1308dbba587503be31e8dba6359443c178e3dbcb94a96bd74674bbdfa672bbc9e82e03cf19772bc03a2663bd4f762bcbeb9b53b5c12183da1c9e33ed70d3a3e876fa3bd4abb8a3c5035b13a4bc81eb9122926bbd97eadbbaadf9fbb6365bebab51e883a331be1ba76e19439ef350b3b4de6003cb1a03a3c99f3cd3c13c24c3c5d04cbbb4839af3b3934ee395ce9b6bb155bc7396e06cabcf066abbd653c62bd333b8c3c713fbfbb4a296aba6865c0bb3e28f83c549786bd8d72d53e2ee89a3e16b8a5bd287aa63caf0949bb0b0111bbcf06cebbcce741bbb2277b3b0d172cbbad12e339515766ba40f53e3a03be153b9f8ec33ca3c2a53c1c1ee23a05d57ebb252de33af1ca243b23e114bab7500b3a4ec289bcc94baebd4b7169bd6104793bf43d813c39f270bcb854373b348b2bbcdfdcad3c34ce833cb6e0f43e9a23373ef8dcd1bd97a50c3de52a48bb4a95cfba5f4de7bb8dcb8e3bbd0902ba1c79063a6a02eaba83cbb73afc24adb91d3e50388032ba3c068a983c6e947fbc28f9a73b2c24b2bab898dd3a1a5663baf9e31a3c45bab5bc9e57c2bd16eeeabc2ad3383c3eee0c3c346326bc2f6c443be3eae4bb54b38ebc83b9bc3d2c79ea3ed59af93d748892bd1ed3bf3c2362a7ba5117023a4bf386bb084cc3bbff5562bbc3aabd3870dbda3ad10e26bbba668e3917a7f43a5786df3b6b0f933ccb22a33cb840e93bbd50c2bb3b95b73b9ce54f3afa2364bb425dda39d7fa07bd55a0acbd33b521bd0fda8b3cfc6c14bc80a8e1bac3fa09bc814dd73c2e7e6abdd89ae03e64e3883e314997bd0d9b9c3c94d9a23a2165acbb15bdb8bb94f7e1b9ae951c3b04652cbb42dcbeb965bfefb923d95e3a47f3913b2d52c83c924fb33c30a2c4bbe9772cb9ff861a3b0ca0533b726dbaba81a16d3b0828c9bc78cabbbd63c051bd15b0ae3c2f77813bf3996fbcd3cc6e3ba0272ebcdb517c3c29bef93cc240023f9141fa3dd608b1bdb497123db33759bb9544b6bbeb9150bb1176823b2d55923afe3229bbef2c123adfe3a63851455e39d225813b2337fa3c5902803be69536bc079d243b65b0443a86b87c3a173c4fba686c893bb932ffbcc0bac5bdcd91aebc2494ea3cfa04e3bb10312abb910fc73a1f7bfd3abcad00bdb1ad013e548eeb3ed5ddbb3ddbe196bdfd6ae83c86719cbb00cae03a25b291bb90c08cbb39f081bc386355b9a979c9baf1941cbbeaf78d3a81ed74bbd5b3ac3bddc4b63c21e6043db8278b3cdc846abb8c65433c7e3886b932021e3a56709b3b5d3ddabcdb03ddbd44c81bbd317fed3bc74829bc5a339ebbb90183bc21c6f63ccf7292bde387ec3ea168813ef44889bdac63e93ccab5703a0138e6bbb73ed8bb222ec7ba6d75433abb4801bbbaf008bb22cda6b78f16493ac129a33b7d9dc53c1b55c23c473eefbb5d42dc3a807ec03bf862683bbb5bdab915db973bea87e6bca6e0bebd628e19bd9123e43cb93e00bce7482dbcd1f7d03a8149a6bbf64f733bab86373df8d70b3f56bf2f3d0c4c59bd0a5e003df671ccbbe01b15bc43a8103af2c4223b6ce113bacba927baffdfe0b9c73ded3920e6bd390bb1223cc1eae93cd60484bbdd92f3bb415dc23b08a9daba9834613a751297bae37ed73a6cfa47bd0078b1bd24f6ec3992e6a43c25d741bcdadb063b9dacf13ac644f33baf1322bdc5d1193ec5bdfb3ef221fa3b13f20bbd679aa73ce869d8bbd62fee39f9d1c3baedf2e9b9beef61390f03233a933023ba802bb3bad999b83916ad33bbb395f33bac2f69bb0d80d939d19cb1b9e97655bbc302f43b49fee3ba8c2bb63aea6ee9bbe638353c2c2f1cbbdb26903b2464633c1ad6a3bbf9e052ba3bffcfb9ef28163ba89dc93ca5a5843edd67423ebcaafc3be2a77439150a2fb9aefd003a3e42ddbaefa9fdba6ad0a93a85edc23a1051f3ba738d46ba4b45cf39fdaafebbbe99313c238bc8bb36229fba028d1a3b3af28dbb7e31363c936c26bb518f3b3c108fb4bcfdbde6baf0a6f43b8677583cd004743c1f19b1bb128412bb283654bb2aa2263cf8cf113e5e12873e4dde963d313e5e3ab267c23ae21593bba855013825bb08bb28d6923abbaa61ba71d8963a16faf5baf91897395c114d382f11efbb57338f3c50a8f3bb9501e439a6915a3b6fa30abc2eae4c3c407b38bb3cbfd63aa22cfbbc93c4193d68e05abc1b6f33bb0435c43c45d252bc4f1c563b2e89583c1e71823c8d53953ee5e1453e771f9e3cc38b03bd051e11bcc99e99bb9af9993814b654ba1d8325b9d52ef6b9aed377ba6693313ae3fb6aba3559083959f5aebaf6f8653bac502ebb8d568e3b0ee8733b478717bbfac63e3b10ed94ba06205f39b2bb42bbb3f6093cef07c4bca69eabbc8d73083c83643cbbb25b0639ff8b553a3c126a3b2fd666bce629963ec33a853e40eb8dbc76184c3b19871cbaefbf8d393531afba9ddf3dbae6be0639bce336398db284ba05f65dba52d16d39840c9dbbd703013c602813bc23235d3984e21d3958d869bba94a013c6479d7ba559d0d3b07485ebce656603cdf5301bc622df1bbfa91773cb9f9f6bb3e900dbb4d0d99b9574beb3b7fac453d045f8f3e04183b3ee957273b4adf89bb046f30bb49af4c39f4490cbb5a5e2ebb18e8773a0f86ce393700c6ba271aa0ba49ffd539d0fc19bcc268013c84ab39bc786ddeba0464a43b22adeabb89b3453c108e3abb38f5213c95b286bc26b2663c2cc1b33ba716cd3a5324c83c627d21bcd0b2a1baba477a3b07fab73cb949193e9370473e7f98073e3d8f993b060454bc011720bc3ade3ab87c22aeb8fb10a4ba305cadb9b5ca26bb8925f23aa66386bac0a78f391227bdb9bf831f3b2b769dba46faf03ba256003c1529a1bb4ad8853b9f52c1ba2a0406bb31fad2ba4cbef03a06a124bd506c17bd8382e63b5e429dbbe9de203a25b0cf3aca3ae13b1bc008bdf8e3a53efe8f983e52f318bd9343073cb8031fbb6bf49db9ab71df3a60d375bb176a403b9a4796bb02626f3ba80af7ba3754d739566d77bb1048f23b2ca5cdbb1d05263caabeb93a47e723bafb733e3a71b9a1b877e732bb90996abb36c24cbb714a15bd612611bd77ad7f3cd20b0dbcc98c0f3b07791a3b20f6003cef24a6bbd8e9ab3e2e28833e6d36f8bc3e4d033b649276bb8ba504bac0200d3beb2085bbe58bb13bbe68aabbc709583b97e93abb1334013a466a30bcbf80613ce5f798bc471b173ce91816bc25efe03bcbb514bb12993e3b6ec087b8ac8fc0bbf7ffdfba73db13bc3373a4bc6665bd3c090759bc90a60b3ba60a20bb11138a3cbb20823dc8ef943e67f0423e6271dcbb3cc850bc875fb8bb940cdfb80af58a386a6d04bb8911c8baa5a50fbb45375a3aeb196dba097fc03977b7c139697a5a3b3643183b8fbf3e3cff3d4f3c848098bb6f43a13b54deacbac1bf3fbb3d1aceba4922dbbbb2af5fbd3bb255bd627fb83b228f88bba8b6a43a3512ab384d0b773c5a5f48bd3577b33eb265a43e8acb60bd69fe553c2a7695bb1e718cb957ae743a580d8bbb763bb83a2c4f35bb71c3443b16ecb7bab5b4ec3983c1403a4149983b81d48d3b707c2d3c4c2bc53b5cf5a2bb0ee5d63a377384baed32dabb5377a6bb04b49cbc3bf048bd216f3fbd246fab3ca6ce0abcc183b63bbcce8d3bb661a83c50abb9bc8e16ba3e5efd903e69565ebd0536393b4b8a00bca9800f3b36d376bbd654003a341ec5b97fbe34bb8099793b22e31bbb3a2dc739728abcbbfa8c583ca91428bc5f1fc03cacbb4ebc8dda393c163b20bcc2be523b9b6921bcbdcf1e3c6a5c2bbdbd9092bc548b6cbda55c2f3dde90b4bc87d5353ce75f8bbbe689063d6454c03b3648bb3e521e6a3e3cdb1fbd7b0af9bb11d8e1bbe12cc1373f534cba911efeba91d273bbca2a32bbd04a023a5f87eeb99e7f9d3920391eb9934eb83bba94453bceab953c8bd86c3c749c47bb96bb5c3b9fbd6eba98d01fbbe0ccd9bafda508bc9ef288bd294970bd97cdb73b0b7150ba0450e23969ec14bbf8ffaa3c65c86ebd7048bb3ee837a93eb7be88bdc42a853cb00eaabb330cffb8768d58bb30731dbb298150baa35827b8f210993aabbe88ba8478ed394e84863b6e471b3c744c5a3cff84063ca7efdd3b752b08bcd89d803bb00a6cbad28205bcc8ed90bcaf25f9bc41bc7abd99fb20bdbc0cbc3c5fc86cbb9867083b75dea73b29fef63c648777bcf01cc43e0e5e923e13cfa5bddcbf573bc562d7bb59dc133acf8cd1bb4b09723a0c21a1b90d3dfa3a4fe93537a30617babbc42b399e4a933b9f58303c449b323cb28ce83b19cd8fbb23e788bbb500b0383bd4cd39244b3abc29548ebc6db541bd758426bd3a5e0abdf2d9223d53b904bc1c72823b8af21f3b4794323d8dd9893cc7eac53e2bfd723e4a239cbd35fc3abc5680babb6bc1eab9ae7fdebadacd53bb9d9f91bbe1e56cbb4ffea03aa50d8ebae0cb6f39211dd33a14410b3cd2e18f3b338fc03cd9c6723c8df95abb2a25533b76da633902a4b7bb06260abb775b60bc0a0799bdc8a07dbd7e903b3ca10920bb49037a39720b22bbeb40e23ceb2b81bd53b2c43e3096a73e0cfc9ebd97599f3c862cd3bbd93811bb9ae080bb50eb49bba260003b39d1aaba00969c3ad18ef8ba08f14a3afca1ea3bb59b993c0fe94a3c59c8063cfe0f60baf21b8ebb7a75743ba8f3193a0a1324bc8bdcd6bc3e9851bdf21371bd7001c8bc1200f43c3f59f7bb0580efbaf37be0ba250e2e3dfe47873ba51fd13e2cdf853ed9c8e1bd24130a3cf42b033973307ebbc58602bb5e53f13a1819083b2ce58fbabfd0e9b9597edfb9c4f2a239b23b643c7d11723c0968003c58750abca259d3b8e25995bb12039d3ba4489ab9717744bc32063bbda97663bd2e4602bdb9afc53a71bde53ca803d1bb60612ebb2748a4bb4c09513d6bb4903d5ee4c73e1cfb4e3e1fd8d7bd2af626bc9aa6d53b3ecc6bba667920bb4a0193bb010b98bb498310bb6338963a4598d0ba5d87a4394692653b5767ff3bbfe01e3cb017c63cd14b5d3cc4f0aebb6540913b4c366a3a43dcd1bb52ba34bb51eea2bce9eba7bdb1bd69bd99a3763cdaf07bbb1c94d5baad188abbd99f003da5b881bd2638ce3e27bca13ea092abbd5f8ca23cb5d97fbbba7abcbb27a801bb43db12bbb0605b3b444ff0baa52048b81515bfba9c3a793a67993d3c8f2daf3c462a2e3c3c6f833bdfe5cdbb387c6a3973608d3b3221fc3955d73bbc3e4500bdc6448cbd3e2650bd28212ebabc3fdc3c3c2162bc38e637bbc3e9e5bb551c393dcd3ee03c6e04e13e97735a3e819a04be4c83c23c1e46263b26ace2bb80fb233b2a4d5a3bbb6220ba1ec5ceba60b82dba3da318390c256b39d7a2b73c0e5a493cf7cb9abb54ec1dbcf976023bdd2b663a3c5c443b99eb44b9702a64bcdc3e83bd06b16cbd1de0e7bb1f82b93c33991f3ce1f40bbc69af1fbb6a484abc3def3f3d50560a3ed233c53e84a1143e105aeebdd328c73bc7061a3c83da20ba16c269bbc55ea8bbd91e62bbb9c31cbae667043b38d92cbb1e5ff13992ca3e3b4185e63ba2797d3ca75b9c3c6d94043c553ba8bbc0aca23b4bf3793ae06261bb883b6bbb765ce5bcd100a6bda72731bd26b1843cb596edbb61b01cbb40e8e9bb524ee23c050058bda9a8d63ee297923ee06ca3bdff179d3c9314663950af07bc0b5a67ba12de51bad02d1f3bc0e3aebaaba6a0ba1c047fba6ca46d3a0b9d673c29ed9f3c1b56663cec8256bb1ae9a0bb2ac5a93a2787b83bf83896b840ae30bc926e18bda4cf92bd702b53bde8eaad3c3641993cd6c591bcb12426bbff7c9abb96d10c3d5e83493dae20ef3e36a0253eb9cf02befeed073d336f173b20261bbc2b82c73b3b8b3c3b14caf2ba9fa500bbc5379eba0f488c3a2a63c038a6d5ce3c3c7c353c44da41bc3ec1c7bb50663d3a6244ac3b0f80dd3a7e15c6b9880cb1bc6f8f6abd93fd84bdeead9e3b9a97fe3c79731d3b87a93fbc4a3c9bba085102bcbd3a0c3db948293e560cc73e245cee3dcc3405be1883c23c4d88d93b2724633a75fa9dbb784640bbcef97abc87993cbb63aaabba4ca5a6badfd810badbc12dbb7e70e63b5cf7aa3cd157043d7caea23c011142bbd1bf353cff91573a15a56c3962e7b9ba57879fbc099bdbbde13135bddf65e13bdb332ebc31c993bba65a57bc5ecaf53cd9b783bdcd1ddf3effcb8e3e463498bda149ff3cd7d5eebacc2911bcae1988bbc0bd33bb327906bbcb31b03abd1b09bbad3d19bbed9a873ad4c23a3c80e7bf3cc081b83c642a75bbb50667bbd92b933b5348093c8e10003b3ec30ebc0c7c19bda92a99bd341046bd849d043dc351403b41c2a0bc58478fbb6475623abc52ee3ba0089d3d5b78013ffbfea53d909fcbbd502a2a3d1f4447ba0e4b36bc8e43e83b73cb543a0787d6ba95f495ba4dc6d0bad8e5393ae72d173af271f43c1c15883baa9d4ebcfa3a2fbbf4a39d3b64714c3b5212e63a1b3b98ba5b1a00bd339262bdafdf5bbd2809883c03c9db3cde422fbc4d2011bca8e62f3b0bff2e3bee43c5bbf58d773e9c7bc43e27d4183d866de5bd71f6543da3e0d9bbfc1bbf39db6ea6ba21d707bad55aa439a296093abb1b42baff019fbad818a53979a81dbb85a3ea3ba6a056bb8ee6363a07a5b238b8024bbb4dc8ea3b87bcdbbaa25fe23911cef9bb64eb273c008182395b1a9c3bb0d2493cd71bbabb13da4eba94681d3acd2d763b7177cd3cf09e773e543a4c3e26e23c3c3534da3a224d7bb9447a8e390e9378badf3f77ba25334d3aa38ce43a3394d2ba8173dab9dcac9e39457140bb7c11043cf57c09bc1747433a65aa8e3bf8ad0abb32e2123cea2319bb0082d1bb0480cfbcd59f013bb5bb9e3c2d91a03ce967293cb47223bcac6b76bbb86b333c79d95e3d8db0fc3d37c4533ef37fbe3de04de4392a29203beaeb37bbbee94db6f09936ba83e702bbba0a73baeae1803b12db77bac08e813857521c3725bb9fbbe2a1a8bba06191bc4f35ae3c0b01363c56ff3fbce120093cef16b9bafc7152bcb972a1bcdf72b13c8d67ca3cc53c033ca4f3a63bbb05d2bad5fd8eba94e9463decf74c3eb3bf063e65a8b23d61f6753d0f6efdbc800b0ebce77d3cbc59f59838c5e345ba544826b827cd03ba81fb4aba103c1b3a682d54bac4cee9386043bdba97e0603b7e151dbbf38a833be54b663bf65411bbf4be413b80ceafba79b380b815d44fbb4049fc3bcc2cb7bc84b5a7bc0c45033cc01741bbdbead6371083823a98ce6c3bfda74bbcb5a9913e7661873e98ec79bc2204513b2db62cb999545d392c5f83ba354445ba54242a39beae9838d0775dba7c813bbae2844539ca0d66bbcaf8d23b52d8e0bbfd95203a8001473aad9855bb6e16ce3bfb91e1ba0adb00bb451c5ebc9595173c6dd8d9baedd6e2ba77cd233c542211bce9774fbbb2a32e3b2aa9543c0b3d323d40c67f3ed690473ee39d523c1f530e39e5b99cba79ed433979cd9ebaaa9059bb6fac673a2dc1233bf39d29bb33477eba9fecb03919ebc3bb11468f3b5ebb35bce78fbf3b9b24da3bb2ece8bb544ffb3bf41333bbb47841bc6812b9bc3473013c9c43ab3c4fee8c3c0f587f3ce61311bc6b53b3bb2444013d047da23d396cc03d9562233e7286093ed5d45f3c8520f1bb86b439bce47c1c38025466b9318e2eba95dd3cbaa48af3baf858943a2bad69baf1e577391ae106ba3b222d3bfa22d1bad82ae93bfc14f63b770381bbb837653ba23095ba13cd02bb64ee1fbb6106ee3ae75a1fbddcb016bd129cbf3b4e4e83bb236d01baff9fb13aaa8ef23b50d502bd3081a23e69419a3e024410bd0e19f03b657ea4bac547b9b898e2223ad20fe9bae180963ab75921bb742dfb3a71139bbaa71f98394eac27bbf8ede03b20ae97bb30b5063cfd7eb23ab63c22b9b5a8a73a32beb5b6c93c9fbbe352d8bbd1ec4ebbc21705bd0bd1febc59891c3c2e55febb87e41eba2e3a9d3b3bc2143c3434c0bafa43a03e5ff6863e69eaa0bc5b914f3ae06d02bbfdf087b982da973a8b8f06bbefe9223bf45ef8baca5ca73a048fa7bac337a73932a0c4bb0854233c9b1a44bca449d13bd1628dbbe581113bb221e539301e853a4acd16bc8a965dbc4f5de2bb0fe3a2bb149218bc26cf283c678c3fbc4942f1ba275b373cf659bf3c08eb6b3ddfda853e8786513efb7a0c3cfc662abcd837dcbbc62c5cb800fb8fb9e93cbdba1be9c9ba3957fbba5b13ce39306622ba6e0b8539182fc23913e5873b8ecf943ab9e9383c392d413c261064bbad08963bd93d91ba1f5354bbd0ed10bb5e8eadbb7d735abdc64750bd98b3323b8a7d2fbb0246753925f78b391299733cefad42bd3791af3e5b61a63e874f56bd9ed2433c9a3482bb53678c3654372cb76d3506bb91c92e39d9d0d8ba13d7ea3a657e6bbaf4dc9a39ce0c0b3b0dc7d13b7391d63aa1cd173cecc69c3b2d7559bbb4a4e13ae5a662baf4b342bcbc6826bc5bf461bc12fb37bdcba025bd27a53c3c2bf7a5bbe6df773b7cee423c52ecb13c2d87a2bcf602af3e9291943e30bd32bd872166bad9de1ebc64875439c85a8d3943c430bb5ebdc33aaabc17bb0b761f3b160eaeba7439a63908d0e9bac7796b3c0a0a03bcf4e7823cec1ec0bbcda2a33b322b91bb4716ad3a8ec997bc48bc0abc3645ccbcfbe3d9bc189a16bd98ba9f3ca9811ebcc5399f3b7f5c8b3c1071de3c41f99e3c77e9a53eb0df7c3e88fdcdbc8f194cbcd25f39bce3babe3796f051bab3428eba044674bbd5ce43bbca16b439d83db3b95a6b3439f443d7b954adba3b80bff13ab0388a3cdc786b3c401a04bbd18f633b00567cba878b34bb374eaaba8cdab9bb8f2d85bdd5c86fbd9b74583ba9dbc63943382e39676605bb0211ab3ce8ba6ebd955ab73e669fab3e251486bdbc26883cf41ac6bb2296b938244c1dbb70e187ba24ced2bac52e0eb9718d8c3ab21234ba91ac5b3905e6b93b154b1a3c0300d73bd54a163c184ec23b4069c8bb3dc3053b311e12ba1d6c8bbcaf5fa0bccbc2a2bc1f5e61bd56ae1fbd0f7f6c3c87ef053b4809363b24e2933cfdaf0b3de8beaebc8958b83e8968993ea3b18ebdc29d75bb57fd5cbc171615ba433295baa611aaba64a08c3a330da939a6b14b3a612022baf42d1d395737513c1d0e513c3eea9ebabb98cf3b5d0cadbb133062bbc2f195ba2a2f003af4312fbd7682debc6149c8bc0f1a10bddf83a9bc9330c43cc31bba3b0646603b85fc363dee36543d6425423c2aa9b13e5c33823ee3e17cbd0b53d6bc688fc8bc2a98e9b94c95cfba6a44acbaa58aa0bb0e5884bb0e19983a52511dbad62eb9b731194f3a3211da3bb5d62e3b1b03ab3cae627d3cd1f329bb602f3d3b76d132ba73fd5cbb9b671cbbeb80c9bb5ff393bde09080bdbd401e3cd8389ebab072e03a39fe47bb2f2dd83c924384bd597cbe3e73a8ab3e806699bd551ba13c687909bc8401e3bae3ad20bbacd704bb987b96b983bf6dba380dfe3ab6f7ceba7ac8b139522b1a3cebc34d3c8971103c43751a3c11c3343ba936d4bb1b24e83a8d645e3a4abaa5bce6b4cbbc2d0cf8bce03d73bd6c6708bd0d37cb3cf67d323b085d82ba011f743cb5bd3c3dfe944ebc1e4bc33efdee933e1017c4bdde51b6bba40e08bc1fc78ebb7ff1053beaa8eb3a4d67173a53ac0dba0c022ab90e1325ba269a8639463ee83cf10a943b23edfbbb14ae6ebbfeee92bbc7ce1abb60eaeb3a5a76973a2b8286bd7ede0fbd4671c1bcc3729cbc5ac33f3a9d81f33c655c003c7e8cbabb6ddf513dc2c2a73d54d4073d300db53e0e4d683e7a9ec4bd958c38bd097e3bbc6e1447ba772015bbf3e338bb6bcd96bb9dba4fbbef405f3af879b5ba2895ab38b193693b0ce4dc3b98cbd03b54deb93c51e2733c3d3d41bb41f2743b6fa4993aab31d0bb1dee6fbb8ea455bc46679ebd06977bbdb3a0303c63bb32bb7539e1ba70da1ebb7d67f13c69fb83bd7f33c53ec0faa93ec15da7bdd1e1a63c794fa5bb1acd8fbb822710bbc5e71bbb4f65a53aa5c19cb8b90d363aacb18fbae66aceb88ce7603c3815883cc981f23bda92243cfb6a9fbb6f0585bb36def93a0cdc1e3b2c9cd4bcd695d1bce10e40bd110b66bd0b0492bc5b53fb3cb5d680394c03c9bb9a02383ccd085d3dc386b93bd3f3cd3e89a2873e4a2e00befa05073b05810fbb9e51cfbb4787943bdfd4203bb5aa14b96b68fbba46e4f4b982aa3bba54b1173a75a8183dd85d8fbb489c86bc771990bbdd8477bb21dd663b35f32c3bc57aa73a2fdaa6bde59907bd31afcbbc0cb62f3b66b98f3ce459d63c0ad33f3b834b4bbc86492a3daeead43d5ef2a13d04dfb03ee87d413e5f6305be93da4ebd5ed32c3c7d72dbbac5bf00bb487285bbe71648bb00fed3ba9ab7a53a1deed3ba9287023940e3723b2482ba3bafc6343c70f9953c3c2e183c94b021bb3ec9793b8767523a18a281bbee62a3bbfade9cbc16ae9abdc14f48bd6926283c647e91bb870918bb7d36a7bbf091e13c734461bdffd6c93e733f9f3e0ad4a1bdfdad9d3c5552bfba4a92eabb6078d2bae1f256bb763ed33a5d71223a56ed003ab129a9bacbb79fb9dc808a3c96126d3cdfc6503c9da3d43b5bd6b7bb89f495bbc003613ba206723b7892d7bce5e0c9bc091b5abdc1fa81bd28a01e3afc5ef03cd7ce45bb272c28bca9221c3c899c353d4a67d93c2dacd83eacb26e3efe560bbea610263c5cf16c3b54d619bc933c013ca4c69f3aac2b073a3d2822bba55befba73a7b338a0bf383a8d8b333d66d650bc0e1678bcad9591bb930a3ebb8bd77a3b6e8da73b796ddf39f26dafbd5615a7bc009019bd8d47b73b60aad73c7a69d23c33a9a239570983bcf603e33cdcb2e23d92a4cd3d1ce8b73ebaed2d3e212728be1f9426bd1d38c43cf689feb9099009bbebb6c8bb285847bc4008a6bb8d0b34bbf3738dba4d5a94b9db604239d529063c86a3693c4ebf063d42b3ce3cc3a68abaa23d233c50d9943a7d8e58bb930c26bb8c2457bce7d4ccbd422a73bd03f1f03b55f71ebce7eb39bb5f2c05bc863ff13cd1d284bd99d3ce3e9495a03e89439fbd126f073d658dd7bb385d09bcb158bebb8d8dd6bb0d5a68bbcfce8a39988b2e39291084bae43eb8ba0018893cbd6b953cd072d93c4d11d03ba63ec53aedab25bbcea6e73be637c63b9e3fccbc9dd474bce93186bd0f228fbdf2a5203cdd69833cc5df50bce9b531bc1b6a243c9fced93bf578883dce41e93e39ac223e82cbdebd41c3e03cd333403bdeb442bc832fd43ba2b0073bebac403ac9d338bb7115c5bad2a8d0b94e7a2c3a17af5d3d55f4b4bc0c231fbc45a4b3bb3e765cb92a89823b54d1c33be56eba3a80b4b2bd64903abcb0cc1cbdf655853b2bc8133dbcd4943cf34b65bc6be144bc51e2063ce958b03da8b7473e52e6b83edb5ab93d1b873fbe9dbd053b0758df3c3521af3993c49fbaf8c022ba88fdb539c9e3e23991e613ba75bd9ebaa70596393e3b09bb12a8e93b302351bb305e883af1f8123af61752bb8b51e73bee63e8ba65381eba0516f7bbd90d303c782e383b7003993b4578393c49afd9bb667757baf17f823a112d8c3bceb3af3cdd3d673ebf52573ef866833cfa94643b1072d339044074399f9d40b9cf3f93ba9973a73a6cd5f03a85eaceba54fddbb9115c79395c5efbba9ac7bc3b0682e2bbdd4c1c3b162c7b3b58f96cbbbf84f03bcb5714bb85b11bbc44d58bbc7943123cbab7b53c4480ba3caf914d3c109a2cbcfeaca5bb71da823c7a66263d18348a3de4cc373e57fd0b3ec9559b3ca913f93b3147833b4a4be637ae6455ba94db76ba6019a03ab1f3263bd0c2f8b9f312033a4d67ed3870e4fabbcb63ebbb5c985abc64504a3c968b6c3cfa55b8b79e3a2f3cee0400bba07fb9bb5cdd87bc071255bb488c633d963e4f3da48bd23b2388cdbc5f5035bc3364b93d1e4c0e3e94aad43d711d983d4b93203d52963e3a7f00b8ba22bbd6bb60b5c238c2f855ba8c2f9a39efde48baf5e514bac0f16a39b06c54bae553d538c917b5ba1fba4d3b2d6a17bbe9a0813bf176673b2dc904bb9cce453bff1ea7ba1c7eb0b835ae4abb5abdf53bad7fadbc4a92a6bc049ef53bb2b64dbb1e8c5eb9879d353a662b6d3bdf9d4cbcbea28d3e69ff893e9ec257bc6294593b1253053aab022639b4161aba4eb15aba9e5217380eb0b537319d43ba93f710baec001c39e48c2dbb4626b33bfd979cbb3015bc3a0f4ebb3a349570bb74d0b33b86c70ebb0d4f89bbe0a642bc1516b93b5092ec3ad342013b9d87cc3bc72329bcee6887bbddf08a3bb033423c0d27093d16db673e676a563e1507bf3c80fac93b991bec3a0542e23836fa44ba2aa5dfba20622c3a411a9d3aa272a7baf474b8b95a4014394ad5cdbb72270c3b3495f1bb2b6c223c14ba0d3c843decbb20fc803b128298bb176359bcf5987abc10a9a73b2df8f13ccc92ea3c3223b33bc3bd43bcf53424bcec3e213dd0d1363d6667483d8cd1243e6aa2193ef8babf3c675dfb3b530c1e3c763fe33823aaf4b9ac2e4038cecd99baae53b3ba75950a3a792722badc5c2139211122ba1202463bf2c306bb20bde23b1cf0e03bc4c230bba8714c3bc2b95dbad4221bbb2ce04fbb8b9f283b8ea819bdb96116bd4ac7813b6faa75bb2162a6ba33d7ac3a1039f73b9d7502bdcb299f3e05449c3ea02206bd45e6ef3b05a3a9b968b46838cb9cdeb8511eccb91d3d95b9a22c61ba86f5ea3980e6efb9fbee113902586dbaa163953b807c00bb3f97ae3b83485d3bc6fb71ba8cde403b66e5c8b906b4cdbb9a9e06bc4e618cbabeadebbc3d83e2bcdd36393be79afbbb4a7494bbd6bbb53b2125003c3b4c33bb8c55943e4e1a8c3e26b313bcc54e7d3b9bd8ff3a50f64338c31dda389476abb901fbe539297211392a702cb90d7284b8a0c5b738404a0ebbf1688f3b848c83bb8eab423bf0e5c73a70d901bb15da5e3bf739a2ba2c8050bcba347cbc447af6bb7aca15bba66adeba3d5839bbcb923fbc35700fbc8698753cd82d973c0ab93b3d388e6d3e5ed15b3e3db8e53cb019843b48c6e73a7868de37c6367eb9625f78ba9306b3ba7a3cfbba83482ab94506cbb93e333839ed4abcb99b7d923bc2babeb937da303c4b04343ceb5906bbb0e4993b0a977fba152a18bb8b7805bb4da355bb14b751bdc1074ebdfe6e6db932090dbb7f3f7bbae0ff7bba66cc673c6cff44bd45d3ab3ee788a83e937c4bbddce94e3c2a0833bbfb104539dd3ffbb9f881a5b924f248baeeb54cbaa314eb394d6a12ba07b04439e135ea3a49399a3bf1589b398491d73b3a9ca63b41e6a8ba490f3f3b64df0439e59621bcca821dbcec29bcbb74c921bda5a415bdbb8d993af7fab9bba97606bbf42b153c73b16a3c6c54b0bc2f12a23ed6b6993e87f4f1bc60a7803b53dd5dbbbadd2939835f6bb8dc99aab9e866fab9dce7e0b978432938cfef12b9db03c038d528163b5c2eaa3bbca197b846cdb13bd4285c3baca1d7b78196ef3a8631c1b8b8e59abce86a76bcdd9c31bcf931c3bcb129afbc596c4dbbddbee2bb3006d1bb116da93cc4e08b3c9950863c8f158f3e0aa5843e692124ba37cab438010523bb1af46ab9a53a49b9193db9b9e87675bb4d685bbb3e543339d7ca17b9810cc336bdc685baef2e933b9f960e3a8e5b793c215f663cebe042ba9d36723b75a9c4ba124d96bab8ef8f39a8cdd5ba070c7ebdc90573bdea27f13af49b813ab672c539935580bbfcae9e3ce6af72bd4775b23ea22fae3ea78d7fbda1a18f3c15afd0bbbec1d139d1b6afbac1a836b94506ccba5b9184ba6947263a8bf347babb1aa639ffb92b3bb29bbf3bc67a323bdda1093c0169de3bb0cc94ba11b6013bf511a3b9ab7a2fbc1e5541bcd4d514bc5cce46bd4c9b2cbdc2bbd73a5458c7ba9ff3083ab1ce383cea9cae3c6d0e08bda0f3ab3eadc0a13e8d6149bd8b91683b2fe5efbbef0c83397ab196b9906517ba635554ba275123b94cc9ae3788fa5ab8f13138385f20123cc0c9053c23b39db8277abb3bea2a7539b581adbaf6abf3baf23233b978f01bbd2ca6b2bc1f6156bc5611e1bce1f0a1bcd704343b8b815c3bec376c3b418d493d7e86063d14bed43aee849a3e77728b3e51edd0bc460664bc67a5d4bc218bffb9be81debaeef83f3bc6a3c3bb6967d0bb34be713b49437aba44b92aba085382bb9fa8583a4a594a3b239a523c48ae443ce0aacc3a28757dbad6737ebb3cbffa3b4f8f60b8e68e3d3c2e0889bdcf1082bdf891873c3790abb9934a283c1c2a15bc5e49903ced387dbd0d72b33e92faac3ebc4386bda0f3883cefe65bbc0d79893990c81dbbc9fc3e3a704d17bb10120fbb4665243b8a26daba2b93e139a3fd643b51fa533b3578053ccb16053c379e9f3bbaeca43aa4efa5bab7bbb1b8d9f816bc249c61bcc393ebbb4dcb6abd7d2342bd798f573cc08098ba9b1d103b544a173c5376ce3c4a9e08bdebe5b23e4577a13e150579bd347eb83921ab00bc3ac2acba93b5bb3975f7eeb910850fba812fcf380e59d93851a2ce3817de33b931429b3c7bd51b3c7323ccbafd90923b96284fbb087269bbab5e9cbb5360403a8dda79bdf47be5bc01cba1bcc727dbbc014a5fbc94694d3c81f5873c9910ff3b3503993d4ce0693d5bd2fc3af0e8a43e404c8a3e76925dbd4b9813bd608f2dbded2feeb79ca824bb14ee8139c2369cbb412391bbeb70c63ae83b0fbb6ff2c0396dbc1f3a6751583bb10a8f3b5d51933cb4877a3c5a7b873a1364083b4cda93b9b92207ba6dc672bb1c3e2aba1aec92bd964986bd1a81023c78b664bb83a0023b497690bb5930c73c13508abdcbf3ba3ec33fb13e386899bd6ccbaf3c30c7e9bbddffc7ba30d007bb709f6aba7ef4d0baa18aa0bac223a13af3d577baf530bab808eace3b6168e33bfc2bf83b25d9303ccb60613b300763bac1204839b973c93af2fd4ebcfa2764bcb29e8fbc2f7c70bda34a2abdfe59633cfabbb33942ee1cbb193bd23be9800d3dd71d0abd7e16ba3e0ea9a03ec0bca9bd88b4f53b7f82afbbfb4eb0bba068b53ae27c4a3af44193392377203a70a648399e39f8394a1435ba2715f83c4844023c31b086bb0fab803b447a04bcf0a4a9bb9283d4bb3e491c3b1300a5bd178cfbbc65fee1bc55dde9bc8300763a5910c43cd63f063d44f122b9a275b43d575fa03d5d4bfa3c6b93a93ee911863ec5efcfbdb9ce6bbd782921bd07907bba79d5b3ba793a1fbb50291dbbe70130bb1def87b9fa379aba6494dbb9c57a0a3b3002933bb66fd23b005b7d3c50eb423c8280ed3a620c633bc5b2993aea3f59bb861f89bbfbfb0ebc911a89bd0aaa6abd2aa9e43acaeb74bbd65de5bac3283ebbcbccc53ccd2880bda399bb3e008aad3e589594bdbda6ac3ca03563bba3cc80bb1e7fd4bab6f876bbc639fbb998266db95fc7c5399a39cdb9c2ee3cbaecc4153c4fb9163c7d081d3c35a9363c3390263b59664dbb107a2b3b55cd343bf0785dbc8b2a72bc4ac9d7bc2f8876bd80eff9bcbd91303cf0feca39e458d9bb3420883b4aab133d71d0e6bcbed7bf3e1e8f9b3e7593c0bd93b4403ca57315ba37d233bcd819353b35c908399851b13a09a96e3ad14e963a98fba13abe88c4b9b074203d651f083b518f2e3b3d4e5e3b7f46dcbb5b7153bcfbb49ebb3ef3983aff8aa6bd01cec7bceee148bd73f40bbd0388ed3bb7f6113db483233d2c1dd6bb129b8c3d07f1ca3d3bfc483d9490b63ef1fb7f3e6a3414be2f6e81bd9d47bcbc6b2db9ba2cb459ba02247dbb20a62bbc8a14debbc20ec0bb1866b43a533530bbb223263a49310b3c8de9a43bc462093d6206fe3c97bf333bd5ebab3bba36023bba8a94bad89a16bc75e2273b1ae2babd7364a4bd505f2e3c6f52f6bb34ae85bba79baebb3fbceb3c20e598bd6cd8c13e8a48b53e9a1aacbda699023d3ef5ecbbfaf38bbb983b46bba51bf9bbcdeafebb608455bbcc670abb782f62bbee3035bbd5dd4f3c1650143c1c26a13c3f3eb73c239a2f3c24d1913be013d03b849c0f3c84c439bc03b58cbcc21d00bda12090bd714b0cbd0f5d1a395aa30fbc47012ebc6fa4e43a8058a23c3fcb1ebb5194bc3e66b8943e366798bd0154803c3c76993b64637cbcc8832bbbeeac30bbe724913972ce7a3bb3f3d83a2563003bcbbe803a47fe283d520f1e3bce8e7c3cbe33693bb35528bc6d35eabbda3a013ab44febbbe94f29bd542a2bbd6fbac6bdb285f6bc8360143d5b04453dc0efc63bfeee9e3b447c1b3c2a04d43d783b2d3ec308c13e94472b3e214944beb08645bd4fd5fc3a diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf index 204842d..85f0448 100644 --- a/.config/picom/picom.conf +++ b/.config/picom/picom.conf @@ -141,9 +141,7 @@ opacity-rule = [ "100:class_g = 'Alacritty' && focused", "20:class_g = 'Alacritty' && !focused", "85:class_g = 'Element' && focused", - "20:class_g = 'Element' && !focused", - "60:class_g = 'Popup' && focused", - "60:class_g = 'Popup' && !focused" + "20:class_g = 'Element' && !focused" ]; diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini index 12d0c0c..7c0aa33 100644 --- a/.config/polybar/config.ini +++ b/.config/polybar/config.ini @@ -4,25 +4,29 @@ monitor-allow-redirect = true [bar/top-monitor-1] monitor = HDMI-A-0 font-0 = HanaMinA Regular:size=11;1 - pseudo-transparency = true - - background = #2e3440 foreground = #eceff4 - -modules-left = temperature +modules-left = gpu_temp modules-center = title modules-right = date [module/date] type = custom/script exec = ~/.local/bin/date.sh -interval = 1 -label = %output% +interval = 10 +label-date = %output% + + +[module/gpu_temp] +type = custom/script +exec = ~/.local/bin/temperature-gpu.sh +label-gpu = GPU Temp: %output% + + + + -[module/memory] -type = internal/memory ; Seconds to sleep between updates ; Default: 1 @@ -82,7 +86,7 @@ format =