Welcome Guest.   Make a donation to an author on the site September 02, 2014, 09:25:27 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: clean up text  (Read 2664 times)
Babis
Charter Member
***
Posts: 84

View Profile Give some DonationCredits to this forum member
« on: December 28, 2007, 12:45:39 AM »

Hello, I am receiving some text messages in my work's program, which have been forwarded many times and in the end appear as follows. Is there a way to clean it up and reformat without loosing the paragraphs?

Quote
L NOT
MORE 0,40 M IN INNER ROAD), PLEASE MAKE SURE THAT SHIP STAMP AND MAST

ER
SIGNATURE AREWELL READABLE AS PORT DUES BILLS WILL BE ISSUED ACCORDIN

G
TO PILOT'S/TUGS BILLS. ALSO PAY  SPECIAL ATTENTION IN CASE OF
MOORING/UNMOORING
FROM 22:00 TO 06:00 AS EXTRA CHARGES FOR TUGS ASSISTANCE ARE TO BE PA

ID
DURING THIS TIME. IF TUGS STARTED WORK AT 06:35(FINISHED AT 22:25) IN

TUGS
BILLS THERE MUST BE MENTIONED CORRECT TIME AS OVERTIME WILL BE CHARGE

D IN
CASE TUGS STARTED WORK EARLIER THAN 05:35(FINISHED LATER THAN 22:25)
BBB.
IN ACC TO RUSSIAN IMMIGR LAW ALL CREW MEMBERS ON ARRIVAL NOVO MUST HA

VE
VALID
SEAMEN'S BOOK IN GOOD CONDITION W/O UNAUTHORIZED CORRECTIONS. OTHERWI

SE,
LANDING
OF CREW MEMBERS  WITH A/M CASES WILL B PROHIBITED BY IMMIGR AUTHORITI

ES
DURING
PASSPORT CONTROL ON ARRIVAL AND PENALTY WL BE IMPOSED UPTO USD 300.
NATIONAL PUBLIC PASSPORTS WITHOUT ENTRANCE RUSSIAN VISA ARE NOT ACCEP

TED
BY
IMMIGRATION AUTHORITIES.
ALL CREW MUST TAKE SEAMEN'S BOOKS DURING LANDING/VISIT SHORE (PIER, C

ITY)
IN ORDER TO AVOID PENALTY UPTO USD 300.
CCC.
IN ORDER TO AVOID PENALTY AND OTHER PROBLEMS PLS PAY SPECIAL ATTN ON

NARCOTICS
DECLARATION,STORAGE OF NARCOTICS AND MEDICINES CONTAINING NARCOTIC,
STRONG,
PSYCHOTROPIC AND POISONOUS SUBSTANCES O/B THE VSL, AS CUSTOMS DRUG DE

PT
OFFICERS MAY INSPECT VSL IN THIS RESPECT.
ALSO PLS CHECK IF CREW MEMBERS HAVE PORNO PRODUCTION. IF YES - ALL PO

RNO
MUST
BE COLLECTED, COUNTED (EXACT NUMBER OF MAGAZINES, CD, VIDEO TAPES ETC

.)
AND
DECLARED IN STORE LIST. DURING VESSEL'S STAY IN PORT PORNO MUST BE S

EALED
IN BONDED STORE OR SOME OTHER LOCKER.
PLS NOTE THAT SUPPLYING PROVISIONS/FOOD PERMITTED ONLY THROUGH
SHIPCHANDLER.
BUYING AND DELIVERY PROVISIONS/FOOD ON BOARD BY CREW MEMBERS IS PROHI

BITED
BY CUSTOMS AUTHORITIES.
DDD.
PREVENTION OF THE POLLUTION OF THE ENVIRONMENT
BEFORE ENTERING THE PORT AND FOR THE HOLE PERIOD OF STAY IN THE PORT

ALL
SEA
VALVES LEADING TO THE VESSEL?S SIDE AND THROUGH WHICH OILY MIXTURES A

ND
HARMFUL
SUBSTANCES ARE DISCHARGED OVERBOARD SHALL BE CLOSED AND SEALED.
HOLDS/HATCHES ARE TO BE CLEANED FM DUST/RESIDUES OF PREVIOUS CGO.
VESSELS LYING ALONGSIDE OR IN THE ROADSTEAD ARE PROHIBITED
Logged
Curt
Supporting Member
**
Posts: 6,336

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #1 on: December 28, 2007, 06:10:02 AM »

You can have it for some email clients, but I have not heard of any made for Instant Messaging programs - if that is what your company is using? What type and program is your "work's program"?

Forgive me for saying so, but by the look of your paste I would say that the program could be improved - well, you are almost saying that yourself - and to have to read stuff like that really made me even more fun of my Skype  Wink 

Quote
... L NOT MORE 0,40 M IN INNER ROAD), PLEASE MAKE SURE THAT SHIP STAMP AND MASTER SIGNATURE ARE WELL READABLE AS PORT DUES BILLS WILL BE ISSUED ACCORDING TO PILOT'S/TUGS BILLS. ALSO PAY  SPECIAL ATTENTION IN CASE OF MOORING/UNMOORING FROM 22:00 TO 06:00 AS EXTRA CHARGES FOR TUGS ASSISTANCE ARE TO BE PAID DURING THIS TIME. IF TUGS STARTED WORK AT 06:35 (FINISHED AT 22:25) IN TUGS BILLS THERE MUST BE MENTIONED CORRECT TIME AS OVERTIME WILL BE CHARGED IN CASE TUGS STARTED WORK EARLIER THAN 05:35 (FINISHED LATER THAN 22:25) BBB.

IN ACC TO RUSSIAN IMMIGR LAW ALL CREW MEMBERS ON ARRIVAL NOVO MUST HAVE VALID SEAMEN'S BOOK IN GOOD CONDITION W/O UNAUTHORIZED CORRECTIONS. OTHERWISE, LANDING OF CREW MEMBERS WITH A/M CASES WILL B PROHIBITED BY IMMIGR AUTHORITIES DURING PASSPORT CONTROL ON ARRIVAL AND PENALTY WL BE IMPOSED UPTO USD 300. NATIONAL PUBLIC PASSPORTS WITHOUT ENTRANCE RUSSIAN VISA ARE NOT ACCEPTED BY IMMIGRATION AUTHORITIES. ALL CREW MUST TAKE SEAMEN'S BOOKS DURING LANDING/VISIT SHORE (PIER, CITY) IN ORDER TO AVOID PENALTY UPTO USD 300. CCC.

IN ORDER TO AVOID PENALTY AND OTHER PROBLEMS PLS PAY SPECIAL ATTN ON NARCOTICS DECLARATION, STORAGE OF NARCOTICS AND MEDICINES CONTAINING NARCOTIC, STRONG, PSYCHOTROPIC AND POISONOUS SUBSTANCES O/B THE VSL, AS CUSTOMS DRUG DEPT OFFICERS MAY INSPECT VSL IN THIS RESPECT. ALSO PLS CHECK IF CREW MEMBERS HAVE PORNO PRODUCTION. IF YES - ALL PORNO MUST BE COLLECTED, COUNTED (EXACT NUMBER OF MAGAZINES, CD, VIDEO TAPES ETC.) AND DECLARED IN STORE LIST. DURING VESSEL'S STAY IN PORT PORNO MUST BE SEALED IN BONDED STORE OR SOME OTHER LOCKER. PLS NOTE THAT SUPPLYING PROVISIONS/FOOD PERMITTED ONLY THROUGH SHIPCHANDLER. BUYING AND DELIVERY PROVISIONS/FOOD ON BOARD BY CREW MEMBERS IS PROHIBITED BY CUSTOMS AUTHORITIES. DDD.

PREVENTION OF THE POLLUTION OF THE ENVIRONMENT BEFORE ENTERING THE PORT AND FOR THE HOLE PERIOD OF STAY IN THE PORT ALL SEA VALVES LEADING TO THE VESSEL?S SIDE AND THROUGH WHICH OILY MIXTURES AND HARMFUL SUBSTANCES ARE DISCHARGED OVERBOARD SHALL BE CLOSED AND SEALED. HOLDS/HATCHES ARE TO BE CLEANED FM DUST/RESIDUES OF PREVIOUS CGO.

VESSELS LYING ALONGSIDE OR IN THE ROADSTEAD ARE PROHIBITED ...
« Last Edit: December 28, 2007, 06:11:44 AM by Curt » Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: December 28, 2007, 06:55:32 AM »

I think it's going to be hard keeping paragraph formatting, because the original paragraph breaks have been pretty much obliterated in your messy snippet above. But one could apply some heuristics and probably get a decent result - although some hand-editing would be required in the end.

It's really nasty that linebreaks are done on character rather than word basis, so the program would have to be coupled with a dictionary in order to stitch words back together.

Not a trivial task, but it should be doable and give decent enough results.
Logged

- carpe noctem
Boxer Software
Supporting Member
**
Posts: 31


Author of the Boxer Text Editor

View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: December 28, 2007, 10:02:55 AM »

You didn't give an example of what you'd like the processed text to look like, but there's a good chance that Text Monkey (www.textmonkey.com) can do the job for you.  One of its main features is to clean up text that's been forwarded many times by email programs.

Here's an animated GIF that shows the concept: http://www.boxersoftware.com/tminaction.htm

Disclosure: I am the developer of Text Monkey.

Best,

David Hamel
Boxer Software
Logged
Curt
Supporting Member
**
Posts: 6,336

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #4 on: December 28, 2007, 12:12:25 PM »

Here's an animated GIF that shows the concept: http://www.boxersoftware.com/tminaction.htm

Yes, this is the one, but I couldn't remember the name. Good to know the author is a DC supporting member! This Text Monkey is impressing and makes me think $30 is almost cheap! Really fine work, David!  thumbs up

--

Edit: In fact it is so impressing that I just bought a copy!  Wink
« Last Edit: December 28, 2007, 12:45:50 PM by Curt » Logged
Babis
Charter Member
***
Posts: 84

View Profile Give some DonationCredits to this forum member
« Reply #5 on: December 29, 2007, 02:00:23 AM »

Thanks a lot for all replies.

Curt, definitely the program needs a lot of improvement, but I am not responsible for it. It is basically a program that displays all the emails, faxes and telexes received. Now some of them have been forwarded many times and in different formats (email and the old but still used from vessels telex) and therefore look like that.

Boxersoftware, I would like my processed text looks like how Curt processed it. I will try your program now, but please note that the text has been forwarded by email and telex.

f0dder, exactly, what bothers me the most, is that the linebreak is done on the character and not on the word.

Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.037s | Server load: 0.13 ]