## Not run:
# tryCatch({
#
# # Calculate conditional probability a particular word will follow a given sequence of words
# conditionalProbabilities <- weblmCalculateConditionalProbability(
# precedingWords = "hello world wide", # ASCII only
# continuations = c("web", "range", "open"), # ASCII only
# modelToUse = "title", # "title"|"anchor"|"query"(default)|"body"
# orderOfNgram = 4L # 1L|2L|3L|4L|5L(default)
# )
#
# # Class and structure of conditionalProbabilities
# class(conditionalProbabilities)
# #> [1] "weblm"
#
# str(conditionalProbabilities, max.level = 1)
# #> List of 3
# #> $ results:'data.frame': 3 obs. of 3 variables:
# #> $ json : chr "{"results":[{"words":"hello world wide","word":"web", __truncated__ }]}
# #> $ request:List of 7
# #> ..- attr(*, "class")= chr "request"
# #> - attr(*, "class")= chr "weblm"
#
# # Print results
# pandoc.table(conditionalProbabilities$results)
# #> -------------------------------------
# #> words word probability
# #> ---------------- ------ -------------
# #> hello world wide web -0.32
# #>
# #> hello world wide range -2.403
# #>
# #> hello world wide open -2.97
# #> -------------------------------------
#
# }, error = function(err) {
#
# # Print error
# geterrmessage()
#
# })
# ## End(Not run)
Run the code above in your browser using DataLab