Sorry, I am not clear at some point in your answer:

1) The function
lex :: String -> [(String,String)]
and
filter :: (a -> Bool) -> [a] -> [a]
So, I did not see how filter can use the list of tuple string of lex.

Sorry if the question seems ridiculous. Thanks.

S.


On 6/17/06, Neil Mitchell <[EMAIL PROTECTED]> wrote:
Hi Sara,

> This function will take the input as a string and return a list of
> keywords taken from the input string and they  are elements of
> ListOfKeywords. The order of the result list is sequenced as: the last
> keyword found is set as the first element of the list, and so on.

It looks like your language is quite Haskell like, so you can use the
built in lex function to split a string into a list. Then a simple
filter (`elem` listOfKeywords) will pick out the keywords for you.

As for the ordering, maybe you want to apply reverse at the end?

Thanks

Neil

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to