[Haskell-cafe] [Newbie] What to improve in my code

David Virebayre dav.vire+haskell at gmail.com
Mon Jul 19 04:24:26 EDT 2010


On Tue, Jul 13, 2010 at 11:49 PM, Frank1981 <frankdeweger at gmail.com> wrote:
>
> First of all: I'm not sure if this question is allowed here. If not, I
> apologize
>
> I'm trying to solve the following problem: For each word in a text find the
> number of occurences for each unique word in the text.
>
> i've come up with the following steps to solve this:
>  * remove all punctuation except for whitespace and make the text lowercase

A minor point: instead of removing the punctuation, you maybe should
convert it to whitespace.

Otherwise in texts like "there was a quick,brown fox" (notice the
missing space after the comma) you'll have the word "quickbrown"
instead of 2 words "quick" and "brown".

David.


More information about the Haskell-Cafe mailing list