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

    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
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    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, 08:05 AM
  2. Replies: 2
    Last Post: 01-23-2009, 04:09 PM
  3. Replies: 0
    Last Post: 05-26-2008, 04:26 PM
  4. how to compress of arraylist
    By hai789 in forum Web Frameworks
    Replies: 0
    Last Post: 05-20-2008, 12:42 PM
  5. Help with text fields in Java
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05: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
  •