Uses 12245K of libraries. Click here for Pure Java version (8507L/44K).
1 | !7 |
2 | |
3 | cprint { |
4 | start-thread { |
5 | S rule = "revealing secret opening preparation => he reveals his secret opening preparation"; |
6 | LS sides = splitAtDoubleArrow(rule); |
7 | SS data = listToMapWithKeyMaker(sides, i -> str(i+1)); |
8 | |
9 | new LineCompCompressor comp; |
10 | comp.byteMode = true; |
11 | comp.loadTexts(data); |
12 | comp.run(); |
13 | |
14 | //print(comp.asText()); |
15 | lcPrintSubstrings(comp); |
16 | |
17 | // find pairs appearing on both sides |
18 | //print(multiSetDuplicates(multiSetMapToMultiSet(lcPairsToFiles(comp))); |
19 | |
20 | print("top-level encodings", values(comp.finalEncodings)); |
21 | print("expanded encodings", mapValuesToList(comp.finalEncodings, |
22 | l -> join("|", map(l, i -> comp.itemToString(i))))); |
23 | |
24 | // simpler version: just take items appearing in both top-level encodings |
25 | LL<Int> encodings = valuesList(comp.finalEncodings); |
26 | |
27 | Set<Int> inBoth = intersectSets(asLinkedHashSet(first(encodings)), second(encodings)); |
28 | print(+inBoth); |
29 | |
30 | print("renumbered", lcRenumberTopLevelEncodings(comp)); |
31 | print("simplified & renumbered", lcRenumberTopLevelEncodings(lcRenumberTopLevelEncodings_simplify(comp.finalEncodings)); |
32 | } |
33 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028767 |
Snippet name: | ByteComp experimentation |
Eternal ID of this version: | #1028767/9 |
Text MD5: | 5cea303fc153c65eea9caa1436409553 |
Transpilation MD5: | 46fc4da76debe83b9235f05a3f44fe18 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-07-08 01:25:37 |
Source code size: | 1201 bytes / 33 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 239 / 485 |
Version history: | 8 change(s) |
Referenced in: | [show references] |