Files
oldlinux-files/Linux-0.98/Yggdrasil-0.98.3/usr/man/man1/sq.1
2024-02-19 00:21:16 -05:00

54 lines
1.3 KiB
Groff

.\"
.\" $Id: sq.1,v 1.4 89/04/28 01:12:28 geoff Exp $
.\"
.\" $Log: sq.1,v $
.\" Revision 1.4 89/04/28 01:12:28 geoff
.\" Change Header to Id; nobody cares about my pathnames.
.\"
.\" Revision 1.3 88/03/27 01:04:20 geoff
.\" Fix a couple of small typos. Add a paragraph on how the squeezing is
.\" done. Credit Mike Wexler as author.
.\"
.\" Revision 1.2 88/03/13 00:58:29 geoff
.\" Add ID keywords
.\"
.\"
.TH SQ 1 LOCAL
.SH NAME
sq \- squeeze a sorted word list
unsq \- unsqueeze a sorted word list
.SH SYNOPSIS
.B sq
< infile > outfile
.PP
.B unsq
< infile > outfile
.SH DESCRIPTION
.I sq
compresses a sorted list of words (a dictionary).
For example:
.RS
sort /usr/dict/words | sq | compress > words.sq.Z
.RE
will compress dict by about a factor of 4.
.PP
.I unsq
uncompress the output of
.I sq.
For example:
.RS
compress -d < words.sq.Z | unsq | sort -f -o words
.RE
will uncompress a dictionary compressed with
.I sq.
.P
The squeezing is achieved by eliminating common prefixes, and replacing
them with a single character which encodes the number of characters
shared with the preceding word.
The prefix size is encoded as a single printable character:
0-9 represent 0-9, A-Z represent 10-35, and a-z represent 36-61.
.SH AUTHOR
Mike Wexler
.SH SEE ALSO
compress(1), sort(1).