From a43a517a28a8d65dacbd1a3ccec36c772035ef2e Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Wed, 12 Jul 2017 23:58:17 +0200 Subject: [PATCH] Change weights on HuffmanTree generation. --- VAR.UrlCompressor/UrlCompressor.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VAR.UrlCompressor/UrlCompressor.cs b/VAR.UrlCompressor/UrlCompressor.cs index 80a288a..51637f3 100644 --- a/VAR.UrlCompressor/UrlCompressor.cs +++ b/VAR.UrlCompressor/UrlCompressor.cs @@ -6,7 +6,7 @@ namespace VAR.UrlCompressor public class UrlCompressor { private static HuffmanTree _huffmanTree = null; - + private static void InitHuffmanTree() { if (_huffmanTree != null) { return; } @@ -81,21 +81,21 @@ namespace VAR.UrlCompressor { '8', 1000}, { '9', 1000}, - // Common simbols + // Common symbols { ' ', 100}, { '!', 100}, { '"', 100}, - { '#', 50000}, // NOTE: Exagerate to minimize bitstream of this symbol '#' - { '$', 50000}, // NOTE: Exagerate to minimize bitstream of this symbol '$' + { '#', 20000}, // NOTE: Exagerate to minimize bitstream of this symbol '#' + { '$', 20000}, // NOTE: Exagerate to minimize bitstream of this symbol '$' { '%', 100}, { '&', 100}, - { '\'', 100}, + { '\'', 20000}, // NOTE: Exagerate to minimize bitstream of this symbol '/' { '(', 100}, { '*', 100}, { '+', 100}, { ',', 100}, { '-', 100}, - { '.', 100}, + { '.', 20000}, // NOTE: Exagerate to minimize bitstream of this symbol '.' { '/', 100}, { ':', 100}, { ';', 100},