Description Usage Arguments Value See Also Examples
This function can be used to extract a small text excerpt from a text based on a context search constructed with check_context
. It will show the entire sentence from the first occurance of the first relevant entity to the first sentence of the second entity.
1 | show_context(text, search, case_sensitive = FALSE)
|
text |
A string value representing the text that is to be searched. |
search |
The result of a |
case_sensitive |
If TRUE, the function will ignore cases for all entities. |
The function will return a sub-string of text which shows you where the context was found. This is just a snippet and does not necessarily include all of the relevant text. This is especially true if more than one word of the defined entity is present within text.
construct_search
for the construction of the search parameter.
1 2 3 4 5 6 | text <- "There has been a crisis in Fantasia.
The USA will intervene. A proposal has been submitted to the United Nations"
A <- c("USA", "Russia", "China")
B <- c("United Nations", "WTO", "NATO")
search <- construct_search(A, B, 50)
check_context(text, search)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.