|
JS8Call-Improved master
|
Static compressor/lookup helper for JS8Call. More...
#include <JSC.h>

Static Public Member Functions | |
| static Codeword | codeword (quint32 index, bool separate, quint32 bytesize, quint32 s, quint32 c) |
| Build a codeword for the given parameters. | |
| static QList< CodewordPair > | compress (QString text) |
Compress text into a sequence of codewords. | |
| static QString | decompress (Codeword const &bits) |
| Decompress a codeword bit-vector into a QString. | |
| static bool | exists (QString w, quint32 *pIndex) |
| Test whether a word exists in the dictionary. | |
| static quint32 | lookup (QString w, bool *ok) |
| Lookup a word and return its dictionary index. | |
| static quint32 | lookup (char const *b, bool *ok) |
| Lookup a C-string and return its dictionary index. | |
Static Public Attributes | |
| static const quint32 | size = 262144 |
| static const Tuple | map [262144] |
| static const Tuple | list [262144] |
| static const quint32 | prefixSize = 103 |
| static const Tuple | prefix [103] |
Static compressor/lookup helper for JS8Call.
This class provides compression and decompression helpers and static lookup tables. Most methods are static and operate on QStrings or plain C strings to locate indexes in the compressed dictionary.
|
static |
Build a codeword for the given parameters.
Generates a codeword for the given index and parameters.
| index | Index into the dictionary. |
| separate | Whether the codeword is separated by a delimiter. |
| bytesize | Byte-size of the codeword container. |
| s | Additional parameter used by the encoding. |
| c | Additional parameter used by the encoding. |
| index | |
| separate | |
| bytesize | |
| s | |
| c |

|
static |
Compress text into a sequence of codewords.
Compresses the given text into a list of codeword pairs.
| text | Input text to compress. |
| text |

|
static |
Decompress a codeword bit-vector into a QString.
Decompresses the given bit vector into a string.
| bits | Bit vector representing compressed data. |
| bitvec |
|
static |
Test whether a word exists in the dictionary.
Checks if the given word exists in the compression map.
| w | Word to test. |
| pIndex | Optional out-parameter receiving the dictionary index. |
| w | |
| pIndex |


|
static |
Lookup a C-string and return its dictionary index.
Looks up the index of the given C-style string in the compression map.
| b | Null-terminated C string to lookup. |
| ok | Optional out-parameter set to true on success. |
| b | |
| ok |
|
static |
Lookup a word and return its dictionary index.
Looks up the index of the given word in the compression map.
| w | Word to lookup. |
| ok | Optional out-parameter set to true on success. |
| w | |
| ok |


|
static |
Secondary mapping table.
|
static |
Primary mapping table.
|
static |
Prefix lookup table.
|
static |
Number of prefix entries.
|
static |
Size of static lookup arrays.