Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Compress Lexico

Thread view: 
kubek82 - 25 Aug 2006 09:26 GMT
Hi.
I have a list of words stored in a file.Words (Strings) are separated
with new line character.
I need to keep content of the file in memory during run time, but
sometimes, for different languages, size of the file increases to quite
big size.

I would like to compress the content of the file and load it in to
memory.
Is it worth to do that using Binary Tree? Or simply Huffman Coding
would be more optimal - in case of compress factor=2, I save 2 times
more memory with small programming afford.

Is the Binary Tree good solution for Scrabble? Let's say I want to go
through the Lexico and check whether given word can be formed from my
letters.

I don't expect anyone doing my homework for me, I just hope You can
give me some ideas, key words I should look for, maybe links to code
snippets etc...

With regards
Chris
Ben Kraufmann - 25 Aug 2006 12:33 GMT
> Hi.
> I have a list of words stored in a file.Words (Strings) are separated
[quoted text clipped - 19 lines]
> With regards
> Chris

Hi!

You can compress and uncompress the file itself using the package
java.util.zip.
Hmmm, scrabble... Have a look at n-ary search trees. The idea is that a
path in the search tree represents a word in your dictionary:

-|-d-o-g.
|-c-a-t.-s.
    |-n-d-l-e.

Imagine this was a tree ;)
Each '.' means that you have found a word (end of a path).
I think this is called Directed Acyclic Word Graph.

Ben


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.