Generate sets of english words by combining different word lists
Low maintenance activity. Last release 16 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install english-wordsenglish-words-py
Returns sets of English words created by combining different words lists together. Example usage: to get a set of English words from the "web2" word list, including only lower-case letters, you write the following:
>>> from english_words import get_english_words_set
>>> web2lowerset = get_english_words_set(['web2'], lower=True)
Usage
From the main package, import get_english_words_set as demonstrated
above. This function takes a number of arguments; the first is a list of
word list identifiers for the word lists to combine and the rest are
flags. These arguments are described here (in the following order):
sourcesis an iterable containing strings corresponding to word list identifiers (see "Word lists" subsection below)alpha(defaultFalse) is a flag specifying that all non-alphanumeric characters (e.g.:-,') should be strippedlower(defaultFalse) is a flag specifying that all upper-case letters should be converted to lower-case
Each word list is pre-processed to handle the above flags, so using any combination of options will not cause the function to run slower.
Note that some care needs to be used when combining word lists. For
example, only proper nouns in the web2 word list are capitalized, but
most words in the gcide word list are capitalized.
Word lists
| Name/URL | Identifier | Notes |
|---|---|---|
| GCIDE 0.53 index | gcide | Words found in GNU Collaborative International Dictionary of English 0.53. Most words capitalized (not exactly sure what the capitalization convention is). Contains some entries with multiple words (currently you must use the alpha option to exclude these). Unicode characters are currently unprocessed; for example <ae/ is present in the dictionary instead of æ. Ideally, these should all be converted. |
| web2 revision 326913 |