March 26th, 2013, 10:02 AM
Need help with reading and outputting files
Hi everyone, I have got an assignment. It is about comparing two files one file has sentences and the other abbreviations. so far i have managed to compare the abbreviations which appear in the sentence and erase punctuation linked to abbreviations.
However I am currently stuck on putting the punctuation back in when outputting the file. I am also stuck with replacing matching words in the sentences with the expanded abbreviations. Any help would be greatly appreciated. Not sure which code to show. but sentences and abbreviations are below.
HQ Head Quarters
NATO North Atlantic Treaty Organisation
NSW New South Wales
NATO troops were on exercise in Aberd Capt Jones of the first div told Comdr Frank that his troops were near the E flank of the NATO forces. Complaining about the amount of Admin, Capt Jones radioed the NATO HQ asked for navigation relative to the HQ. The Captain then left.
For example the abbreviation "Aberd" in the sentence above needs to be replaced with Aberdeen from the abbreviations file. I need the last part of the abbreviation not "Aberd Aberdeen" need just "Aberdeen". Hope the info is understandable.
Any help will be greatly appreciated.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!