Package 'strzip'

Title: compression for very small Strings
Description: This package implements short string compression algorithms.
Authors: David Schoch [aut, cre] , Salvatore Sanfilippo [cph] (Author of SMAZ library), Arundale Ramanathan [cph] (Author of Unishox2 library)
Maintainer: David Schoch <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2024-10-25 05:16:02 UTC
Source: https://github.com/schochastics/strzip

Help Index


strzip class access vector

Description

strzip class access vector

Usage

## S3 method for class 'strzip'
x[i]

Arguments

x

character

i

element


strzip class access list

Description

strzip class access list

Usage

## S3 method for class 'strzip'
x[[i]]

Arguments

x

character

i

element


strzip class assign

Description

strzip class assign

Usage

## S3 replacement method for class 'strzip'
x[i] <- value

Arguments

x

character

i

element

value

value


Encode strzip

Description

Encode strzip

Usage

## S3 method for class 'strzip'
format(x, ...)

Arguments

x

strzip object

...

urther arguments passed to or from other methods.


Print a compressed string

Description

Print a compressed string

Usage

## S3 method for class 'strzip'
print(x, ...)

Arguments

x

A compressed string object

...

additional arguments to print


Compress a vector of strings using Unishox2

Description

This function compresses each string in a vector using the Unishox2 compression algorithm.

Usage

str_compress(x)

Arguments

x

A character vector of strings to be compressed.

Value

A character vector of compressed strings.

Examples

str_compress(c("Hello", "world", "Unishox2"))

Compress a string using SMAZ algorithm

Description

Compress a string using SMAZ algorithm

Usage

str_compress_raw(x)

Arguments

x

A character vector string to compress.

Value

A list of raw vectors containing the compressed data.

Examples

str_compress_raw(c("Hello", "world", "smaz"))

Decompress a character vector from a file

Description

This function reads compressed binary data from a file and decompresses it using Unishox2.

Usage

str_compress_read(file)

Arguments

file

The filename containing the compressed binary data.

Value

A decompressed character string.


Compress a vector of strings and write to a file

Description

This function compresses a string using Unishox2 and writes the compressed binary data to a file.

Usage

str_compress_write(x, file)

Arguments

x

A character vector to be compressed.

file

filename where the compressed data will be written.

Value

The length of the compressed data written to the file (invisibly).


Decompress a vector of strings using Unishox2

Description

This function decompresses each string in a compressed character vector that was compressed using Unishox2.

Usage

str_decompress(x)

Arguments

x

A character vector of compressed strings to be decompressed.

Value

A character vector of decompressed strings.

Examples

compressed_vec <- str_compress(c("Hello", "world", "Unishox2"))
str_decompress(compressed_vec)

Decompress a raw vector using SMAZ algorithm

Description

Decompress a raw vector using SMAZ algorithm

Usage

str_decompress_raw(x)

Arguments

x

A list of raw vectors to decompress.

Value

A character vector of strings containing the decompressed data.

Examples

compressed_lst <- str_compress_raw(c("Hello", "world", "smaz"))
str_decompress_raw(compressed_lst)

strzip

Description

This package implements short string compression algorithms.

Usage

strzip(x = character())

Arguments

x

character

Author(s)

Maintainer: David Schoch [email protected] (ORCID)

Other contributors:

  • Salvatore Sanfilippo (Author of SMAZ library) [copyright holder]

  • Arundale Ramanathan (Author of Unishox2 library) [copyright holder]

See Also

Useful links:


Summary for strzip

Description

Summary for strzip

Usage

## S3 method for class 'strzip'
summary(object, type = "mean", ...)

Arguments

object

strzip object

type

either "mean" for average compression rate, "all" for all individual rates, "summary" for min/max/average rates

...

additional arguments affecting the summary produced.