Libraryless. Click here for Pure Java version (13598L/81K).
1 | svoid aicDemo(S snippetID default #1034022) { |
2 | new AdaptiveIdentifierCompression aic; |
3 | aic.minCountToCompress(1); |
4 | S text = loadSnippet_cached(snippetID); |
5 | LS tok = map(javaTok(text), t -> aic.encode(t)); |
6 | S text2 = join(tok); |
7 | showText(text2); |
8 | print(nChars(text) + " => " + nChars(text2) + " = " + doubleRatio(l(text2), l(text))); |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1034371 |
| Snippet name: | aicDemo - AdaptiveIdentifierCompression |
| Eternal ID of this version: | #1034371/1 |
| Text MD5: | 80eb6f451fa7f168e72f52714cc63861 |
| Transpilation MD5: | 687fceb0b12c9ac7ee43c1f42fe1b6a6 |
| Author: | stefan |
| Category: | javax / gazelle 22 |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-02-03 10:35:31 |
| Source code size: | 349 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 353 / 473 |
| Referenced in: | [show references] |