Author Topic: Storing Text in Axe  (Read 2454 times)

0 Members and 1 Guest are viewing this topic.

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Storing Text in Axe
« on: February 03, 2011, 01:26:44 am »
What is the most efficient way to store text in Axe and then display it on the screen? I've noticed that when I use a direct text function it takes up a lot of memory.
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Storing Text in Axe
« Reply #1 on: February 03, 2011, 01:34:25 am »
What do you mean by the direct text function?  The easiest way to store text is simply to "Text"->Str1.  But I have a feeling that you already tried that and didn't like the memory rates you were getting?

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Storing Text in Axe
« Reply #2 on: February 03, 2011, 02:12:00 am »
Yeah,  was wondermg if there was any way to compress text.
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Storing Text in Axe
« Reply #3 on: February 03, 2011, 02:35:00 am »
You could always try huffman compression, but thats pretty complex.  How much text do you have?

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Storing Text in Axe
« Reply #4 on: February 03, 2011, 03:38:15 am »
If you don't use any special characters, you could cut off the high bit of each letter, that would reduce the size 12.5%.  If its all upper-case, you can do a direct mapping with only 6 bits which could compress it by 25%. Otherwise, huffman is really good at text compression (You might be able to get up to 50% compression) but the algorithm is so long and complicated that it might only be worth it if you had over 5k of text.  Another suggestion is to use a special character that you never use as a "word replacer" for common words.  Lets say that character [FB] is never used, you could have the sequence [FB01] replace the word "the" and [FB02] replace the word "only" etc.  They can even be inserted into the middle of a sentence:  [FB02]"re" would become "there".
« Last Edit: February 03, 2011, 03:40:31 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!