-
Notifications
You must be signed in to change notification settings - Fork 7
/
serverBreakIntoWords.R
42 lines (30 loc) · 1.01 KB
/
serverBreakIntoWords.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
## serverBreakIntoWords.R
## BreakIntoWords server code
## by Phil Ferriere
serverBreakIntoWords = function(input, output, session) {
request <- eventReactive(input$buttonBreakIntoWords, {
tryCatch({
weblmBreakIntoWords(input$wordsTextInputBreakIntoWords, input$lmSelectInputBreakIntoWords, as.integer(input$ngramSelectInputBreakIntoWords), as.integer(input$candidatesSelectInputBreakIntoWords))
}, error = function(err) {
createAlert(session, "errBreakIntoWords", "alertBreakIntoWords", content = geterrmessage(), style = "danger", append = FALSE)
NULL
})
})
output$resultsBreakIntoWords <- renderFormattable({
if (!is.null(request)) {
formattable(request()$results,
list(probability = color_tile("white", "orange"))
)
}
})
output$urlBreakIntoWords <- renderText({
if (!is.null(request)) {
return(request()$request$url)
}
})
output$jsonBreakIntoWords <- renderText({
if (!is.null(request)) {
return(request()$json)
}
})
}