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

Predefined dictionary #1

Closed
eroom1966 opened this issue Mar 25, 2020 · 1 comment
Closed

Predefined dictionary #1

eroom1966 opened this issue Mar 25, 2020 · 1 comment

Comments

@eroom1966
Copy link

@siara-cc
Hi Arun
I wonder if you could advise, as to the application of this code

I need to compress short strings of between 40 and 80 characters
The dictionary is small in terms, for example

  • Always Upper case characters
  • Small set of non-alphanumeric
  • Small set of full words

There is a very small dictionary of words, of which many are used repetitively, so I want to be able to define substrings with a code, in addition to characters
The size of the dictionary itself, is not important the dictionary is pre-defined, and not provided with the compressed data. the dictionary is known to the encode and decode itself

The question is, if I have this pre-defined dictionary, can I embed this with your project ?

Thx
Lee

@siara-cc
Copy link
Owner

Hi, you could change the code to accomplish this.
But you can use code from this library: https://github.com/siara-cc/Unishox_Arduino_Progmem_lib
to achieve what you want without changing anything.
It does not use a pre-defined dictionary, but it has all the short strings in an array and words that are re-used in subsequent lines are referred from the previous lines.
The library itself is for the Arduino platform, but you can get it working for C.
Compress using -G option in Unishox library (this repo)
Decompress using decodeRepeat() function in Unishox_Arduino_Progmem_lib

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

2 participants