[Corpora-List] What is best for text processing?
Eric Atwell
eric at comp.leeds.ac.uk
Mon Mar 17 14:50:50 UTC 2008
On Mon, 17 Mar 2008, Grzegorz Chrupa?a wrote:
> The Haskell example is unnecessarily obfuscated. A simpler and clearer
> solution might be:
>
> import Data.List
> main = do
> text <- getContents
> putStr (unlines [ word | word <- words text , "ing" `isSuffixOf` word ])
>
My colleague David Duke suggested an even simpler HASKELL solution:
import Data.List
main = return . unlines . filter ("ing" `isSuffixOf`) . words =<<
getContents
Others could probably improve on the Prolog, Java, C etc versions
in terms of number of lines of code ... but I think the more important point
is the Python version is easier for beginners to pick up and understand,
and also to return to later and still understand.
Eric Atwell, Leeds University
_______________________________________________
Corpora mailing list
Corpora at uib.no
http://mailman.uib.no/listinfo/corpora
More information about the Corpora
mailing list