compress(str, dictionary = null)
Compresses a string using the current dictionary. Optionally, a new dictionary can be passed.
Parameters:
str– The string to compress.dictionary– Optional dictionary to override current one.
Example:
1const compressed = compressor.compress("hello world hello");2// "$a $b $a"