Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2005 May : quick data compress.
| Subject: | quick data compress. |
| Posted by: | "Cactus" (zhanglihome [at] 21cn [dot] com) |
| Date: | Fri, 6 May 2005 19:57:07 |
Hi
I thinking about quick-easy data compress.
maybe this method can be public for every one.
example.
a plain text file is ascii 7 bit byte, the high 128 symbols without use.
so if design a table by English word. the ofter part in words is "ing" "ed"
"er" "the" "if" "se"......
now set the unused high 128 symbols escape to the table.
128 = "ing", "129" = "ed", 130 = "se",......
Encoding.
if data in the table, encoding the part with the table.
eg. "ing" to symbol 128, use one byte.
other else is uncoded byte.
Decoding.
if get a symbol not in escape table.
the symbol without change.
if get a symbol in escape table.
the symbol is changing with the table.
the byte '0xff' or 256 is End_Of_File used by DOS.
it should never use within table.
what you think?
regards.