[Haskell-cafe] take the keywords from a string

Sara Kenedy sarakenedy at gmail.com
Sat Jun 17 18:25:07 EDT 2006


Hi everybody,

I have a function: takeKeyword :: String -> [String]

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.
For example,

ListOfKeywords = ["expand, "limit", "diff"]
takeKeyword :: String -> [String]
takeKeyword limit(x + expand((x+3)^2), x=3) = ["expand", "limit"]
takeKeyword limit(x -7, x= 3) =["limit"]

If you have any suggestions for that, please share with me. Thanks in advance.

S.


More information about the Haskell-Cafe mailing list