Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Rep Power

    Default Compress text in java

    Hello friends,

    i want to compress text in my application.
    if text is like:::::: hi i called you just before noon
    after compression it should be like:::::::: hi i cald u juz b4 12

    any idea how to do that
    Rakesh Mehta

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    Looks like you want to create an SMS dictionary that translates text between standard speech and SMS-talk. If you want this translation to go one way, then a Map such as a HashMap could work well. If you want a bi-directional translation, then you may need to use a bi-directional map, something that I believe Java doesn't have, but I think is available open source, possibly via Apache.

  3. #3
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    what about building a small embeddable SQL database, such as H2 database into your application, where you start up the database in process of your application. With minimal JDBC you can have one table that has two columns, the english word and the compressed word.

    I found it convenient, even decadently wasteful to abuse an embedded SQL database as an arbitrary complex map.

Similar Threads

  1. Java Text Printing
    By vivekn in forum Introductions
    Replies: 0
    Last Post: 03-13-2009, 09:05 AM
  2. Replies: 2
    Last Post: 01-23-2009, 05:09 PM
  3. Replies: 0
    Last Post: 05-26-2008, 05:26 PM
  4. how to compress of arraylist
    By hai789 in forum Web Frameworks
    Replies: 0
    Last Post: 05-20-2008, 01:42 PM
  5. Help with text fields in Java
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts