topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 18, 2024, 6:35 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: clean up text  (Read 6222 times)

Babis

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 84
    • View Profile
    • Donate to Member
clean up text
« on: December 28, 2007, 12:45 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?

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

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: clean up text
« Reply #1 on: December 28, 2007, 06:10 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  ;) 

... 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 AM by Curt »

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: clean up text
« Reply #2 on: December 28, 2007, 06:55 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.
- carpe noctem

Boxer Software

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 31
  • Author of the Boxer Text Editor
    • View Profile
    • Boxer Software
    • Read more about this member.
    • Donate to Member
Re: clean up text
« Reply #3 on: December 28, 2007, 10:02 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.boxersoft...e.com/tminaction.htm

Disclosure: I am the developer of Text Monkey.

Best,

David Hamel
Boxer Software

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: clean up text
« Reply #4 on: December 28, 2007, 12:12 PM »
Here's an animated GIF that shows the concept: http://www.boxersoft...e.com/tminaction.htm
-Boxer Software (December 28, 2007, 10:02 AM)

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!  :up:

--

Edit: In fact it is so impressing that I just bought a copy!  ;)
« Last Edit: December 28, 2007, 12:45 PM by Curt »

Babis

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 84
    • View Profile
    • Donate to Member
Re: clean up text
« Reply #5 on: December 29, 2007, 02:00 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.