check_context: Logical check for presence of context within text

Description Usage Arguments Value See Also Examples

Description

After constructing a search with construct_search you can use this function to do a logical test of whether or not the defined context is present within your text.

Usage

1
check_context(text, search, case_sensitive = FALSE)

Arguments

text

A string value representing the text that is to be searched.

search

The result of a construct_search call.

case_sensitive

If TRUE, the function will ignore cases for all entities.

Value

A logical TRUE/FALSE value. If TRUE, the searched context is present within text, while FALSE indicates the absence of the defined context.

See Also

construct_search for the construction of the search parameter.

Examples

1
2
3
4
5
text <- "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)

Jhruzik/TextContext documentation built on May 21, 2019, 9:35 a.m.