[Haskell-cafe] dropping hyphens and \n in words
Ivan Amarquaye
amarquaye.ivan at hotmail.com
Sun May 11 11:47:00 EDT 2008
Generally a hyphen is written at the end of the sentance when moving on to the next line and i managed to achieve this in haskell by using the "\n"- newline which places an index word in the next line i.e. if the words appear indexed like this...([1]),[mangoes] and a hyphen is applied, it becomes ([1],[mang-oes]) and it is valid in my function as i made it accept hyphens as part of a single word.
Now my problem is this...I'm assuming that the hyphen normally comes at the end of a sentence like this: "there are so many guys ravis-hing our women" and this can be demonstrated in haskell by "\n" which places the words or characters following it in a new line like this:
input: makeIndex"there are so many guys ravis\nhing our women" and output is: (([1],[there]),([1],[ravis]),([2],[hing])) where 1 means the first line and 2 the next.
Now i want to write a function that would take away the hyphen and \n from all the words supposed to end on the first line and continue on the next and make all appear on the first line like this: all words in this form: "chip-\nheater" should become "chipheater". hope i can get some guidance on doing this.
_________________________________________________________________
Connect to the next generation of MSN Messenger
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080511/1dbfaf2b/attachment.htm
More information about the Haskell-Cafe
mailing list