Given a list of letters and a dictionary, what are all plausible combinations to create English words?

find_all_words(
  game_letters,
  min_word_length = 4,
  central_letter,
  dictionary = normal
)

Arguments

game_letters

A character vector of letters. Should either be in the format of c("l", "e", "t", "r", "s") or simply "letrs".

min_word_length

The minimum required word length; defaults to 4.

central_letter

The game expects a "central" letter; what is that? Expects a single character, e.g., "c"---if none is provided, defaults to the first letter of game_letters.

dictionary

A character list of words---defaults to the normal list from the package.

Value

A character vector of words in the form of c("first", "second", "third")

See also

Examples

# all words using the letters letrs that include an l and are at least
# 4-letters long.
find_all_words(c("l", "e", "t", "r", "s"))
#>  [1] "else"      "less"      "lesser"    "lets"      "letter"    "letters"  
#>  [7] "sell"      "sells"     "settle"    "settles"   "tell"      "tells"    
#> [13] "lest"      "steel"     "eels"      "leer"      "leers"     "reel"     
#> [19] "reels"     "restless"  "seller"    "sellers"   "settler"   "settlers" 
#> [25] "sleet"     "sleets"    "steels"    "teller"    "tellers"   "trestle"  
#> [31] "trestles"  "ells"      "lees"      "lessee"    "lessees"   "resell"   
#> [37] "resells"   "resettle"  "resettles" "retell"    "retells"   "treeless" 
#> [43] "letterer"  "letterers" "reseller"  "resellers"
# all words using the letters drgti that are at least 3-letters long
find_all_words("drgti", min_word_length = 3)
#> [1] "did"   "digit" "rid"   "dig"   "dirt"  "grid"  "rigid" "gird"