Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characters go missing during round trip #1

Open
euporos opened this issue Apr 27, 2021 · 0 comments
Open

Characters go missing during round trip #1

euporos opened this issue Apr 27, 2021 · 0 comments

Comments

@euporos
Copy link

euporos commented Apr 27, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant