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

Model generator generates non-C compliant code #42

Open
arkhipenko opened this issue Jun 2, 2020 · 0 comments
Open

Model generator generates non-C compliant code #42

arkhipenko opened this issue Jun 2, 2020 · 0 comments

Comments

@arkhipenko
Copy link

arkhipenko commented Jun 2, 2020

Hi guys,

Thank you for the library. I am using it to compress the underlying data in the Dictionary library on ESP32 and ESP8266 microcontrollers (you can reference those platforms as "works on" from now on).

While playing with specific training data set I noticed that generate_compressor_model.py produced this kind of strings:

static const int8_t successor_ids_by_chr_id_and_chr_id[32][32] = {
  {-1, 13, 6, 9, -1, 7, -1, 15, 1, 11, 3, 4, 2, 10, -1, -1, -1, 0, 12, 5, 8, -1, 14, -1, -1, -1, -1, -1, None, None, None, None},
  {0, 6, 2, 5, -1, 1, 3, -1, 8, 7, 15, 4, 12, -1, -1, 9, 11, -1, 10, -1, 14, -1, -1, -1, -1, -1, -1, 13, None, None, None, None},
  {15, -1, -1, 3, 12, 0, 1, -1, 9, 2, 5, 7, 6, -1, 14, -1, 10, -1, 11, 4, -1, -1, 13, 8, -1, -1, -1, -1, None, None, None, None},

Note all the "None"'s in the code.
Obviously C compiler didn't know what to do with this.
I replaced the None's with 0's manually and it compiled and worked (compressed) the strings, so I assume those are meant to be zeros but I am not sure.
The training dataset is attached (it's a test data set for random key-value creation. Also attached is the resulting model generated with None's.

Hope you can fix this.
dictionary-test.txt
dictioanry-test.h.txt

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