
It reads like you want to verify that a given word in a string exists in a
list of (english) words.
https://github.com/dwyl/english-words seems to contain a large user
contributed list of english words (~450k). It seems to contain a number of
loan words as well as potentially made up words, so caveat emptor.
As far as testing for membership - I'd suggest building up a Data.Trie.Set (
https://hackage.haskell.org/package/trie-simple-0.4.1.1/docs/Data-Trie-Set.h...).
The trie data structure provides a reasonably compact representation of
strings, and Sets provide a function to test if a given word is a member.
On Sun, Feb 6, 2022 at 11:37 AM mukesh tiwari
Hi Amber,
Can you give one example, or a test case? If you need every English word, you need to read a English dictionary, which has all the words, and store it in map, or hash-map, because list would be very slow for accessing the words. (is it the case that you want to break a line, e.g., “brown fox jumped over the lazy dog” into list of words, [brown, fox, jumped, over, the, lazy, dog]?)
Best, Mukesh
On Sun, 6 Feb 2022 at 16:25, Amber Crawford
wrote: I'm creating a project in which I need a list of every English word, so I'm wondering how I would get this. The only thing I need is that I can filter the words based on some boolean function, thanks. btw I'm pretty beginner so sry If i'm not really good at writing these. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.