[Haskell-cafe] really difficult for a beginner like me...
amarquaye.ivan at hotmail.com
Sun May 4 09:36:25 EDT 2008
thanks for the tip there....its been four gruesome days and i just don't seem to make any understanding of how to implement some changes or create some new functions due to the fact that im so new to Haskell and functional programming.
For the very first case of allowing hyphenated words to be treated as single words i manged to successfully do that by adding to the definition of the splitWords function to also accept characters such as "-" and it worked perfectly after running it.
The next case posed a headache for me as i have been on it for 3 days now. >From my understanding, it means in situations where your writing a sentence and you get to the end of the line while writing a word, you decide to put a hyphen there and continue on the other line. So the case demands that i allow sentences that end with hyphens and continue on the next line to drop the hyphen and be a single word on that same line without having to continue on the next line so this was how i foresee the input it in hugs:
makeIndex "these are the very same stuff they tell each-\nother"
should be this: [these],[eachother]. 1 indicates they are on the same line and the others are left out as the index takes words greater than 4 characters and i have been struggling with this since. i tried on several counts to include in the splitwords function to dropWhile "-" is found in the words but it turned out an error.I also tried creating a new function to do that didnt succeed either can anybody help me out in this regard.....
Explore the seven wonders of the world
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe