Re: compressing a text file



Sure you can. Just use the other 128 character (128 to 255). In a
native text file you are using only 128 characters. You can first scan
your file and see how often each character appears and how many of the
255 character are present. Then use the characters that are not present
to represent the frecuency of other characters.
Actually there are algorithms that are based on the same techniques to
compress files, you can do some research before attempting to do
anything else.
Good luck...

junky_fellow@xxxxxxxxxxx wrote:
HI guys,

I am new to the field of data compression. I want to write an
algorithm to compress
the text file. One way I thought of replacing the frequently occuring
words with a smaller
symbol. Say, for example if "the" is repeated in the text file 1000
times I would replace
"the" with a new symbol "@" at all the 1000 places.
But there is a possibility that the new symbol "@" is already present
at some places
in the text file. So, I may mistook it as "the". Can anyone suggest me
how to solve
this problem ?

Thanx for any help/hints in advance ...

.



Relevant Pages

  • Re: simple file compression program
    ... it would not be possible for ch to compare equal to EOF, ... As the character set representation is not specified by C, ... proceeding end-of-line indicators. ... Is there any other simpler method to compress text files, ...
    (comp.lang.c)
  • Re: zernike moments question
    ... Not sure how you planned to compress your pixel grid. ... >>> I have to calculate the zernike moments (http://homepages.inf.ed.ac.uk/ ... background of a character may as well be made up. ...
    (sci.image.processing)
  • Re: Hutter Prize Rules
    ... will be able to compress the original 18,324,887 bytes by more than an ... at least 1-bit per character characterization of the data which has oft been ... If paq8hp1 is validated we will have 3% ... improvement just since the announcement of the Hutter Prize. ...
    (comp.compression)
  • Re: Skill Challenges - WTF?
    ... Mere moments before death, Allen Wessels ... perhaps (the character has to win enough ... points in negotiation to get the deal, before talks fall apart), but ... I guess it's a matter of how much you want to compress the event. ...
    (rec.games.frp.dnd)
  • Re: compressing a text file
    ... Just use the other 128 character. ... Actually there are algorithms that are based on the same techniques to ... compress files, you can do some research before attempting to do ... I may mistook it as "the". ...
    (comp.compression)