Giter Club home page Giter Club logo

huffman-url-compressor's People

Contributors

mlacosta avatar

Watchers

 avatar  avatar  avatar

Forkers

dworznik

huffman-url-compressor's Issues

Characters go missing during round trip

Hi I'm making good use of the library for one of my projects โ€“ thanks for making it available. I did have to work around one problem though, as shown in the following example (RunKit)

train = "[1300 [[57 4.56 0.12 11 10260 240] [8.600000000000001 5.2 0.44 44 16447 142] [8.600000000000001 240.8 0.08 12 930] [8.600000000000001 0.16 4.63 230 1080] [8.600000000000001 482.1 2.82 490 572] [8.600000000000001 135.1 28.67 820 1185]]]"

troublesomeInput = "[1300 [[56 4.56 0.12 11 10260 240] [44 5.2 0.44 44 16447 142] [0 240.8 0.08 12 930] [0 0.16 4.63 230 1080] [0 482.1 2.82 490 572] [0 135.1 28.67 820 1185]]]"

let Encoder = huffmanUrlCompressor.createEncoder(train);

let encodedParam = huffmanUrlCompressor.encodeConfig(troublesomeInput,Encoder)

let decodParam= huffmanUrlCompressor.decodeConfig(encodedParam,Encoder)

decodParam turns out as:

[1300 [[56 4.56 0.12 11 10260 240] [44 5.2 0.44 44 16447 142] [0 240.8 0.08 12 930] [0 0.16 4.63 230 1080] [0 482.1 2.82 490 572] [0 135.1 28.67 820 1185]]

As you can see, the trailing Bracket has been lost in the process. Any idea as to what may be causing this behaviour?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.