XZB
2022-05-20
mostLikely <- TRUE
returnTable <- FALSE
test <- predictWord("go to the",mostLikely,returnTable)
test## [1] "gym"
set.seed(12)
mostLikely <- FALSE
returnTable <- FALSE
test <- predictWord("go to the",mostLikely,returnTable)
test## [1] "gym"
## # A tibble: 3,237 × 3
## ngram freq p
## <chr> <int> <dbl>
## 1 go to the gym 44 0.107
## 2 go to the bathroom 41 0.0996
## 3 go to the beach 36 0.0874
## 4 go to the movies 36 0.0874
## 5 go to the store 27 0.0656
## 6 go to the hospital 25 0.0607
## 7 go to the mall 23 0.0559
## 8 go to the doctor 18 0.0437
## 9 go to the game 16 0.0389
## 10 go to the polls 13 0.0316
## # … with 3,227 more rows
## [1] "heck"
## [1] "do"
## [1] "be"