sallam-ahmed / Polynomial-Calculator

Data Structure 2015 Course Project
Apache License 2.0
0 stars 3 forks source link

Static dictionary compression #40

Open khaledkee opened 8 years ago

khaledkee commented 8 years ago

We are using static dictionary compression. Basically, all possible words are written in a file (wrt-eng.dic) and the compressor gives each word the number of its line. Longer words are given higher numbers, but, overall, it gives good compression ratio. In our case, we don't need all English words. We've very small number of words we use in our history file. If we just removed non-used words, it would give better compression ratio. Note that if the user mistakenly removed the dictionary, SaveTrieManager gives run-time error. Of course returning a null trie would be an acceptable solution. But if the dictionary was small, we can store it in the SaveTrieManager (hard-coding) instead!