Skip to contents

Construct the search string (aka "pattern") based on provided search terms. The get.unique.terms() and get.bigrams.oi() functions use this function. The function is a simple wrapper for the paste() function that surrounds each search term with \\b and separates multiple terms with pipes |.

Usage

create.search.string(search.terms)

Arguments

search.terms

vector of strings to use as the query (aka "pattern") string.

Value

string with the terms to search the text string of interest, e.g., "\\bTERM1\\b|\\bTERM2\\b".

Examples

if (FALSE) { # \dontrun{
search.terms <- c("dog", "cat", "fish")
create.search.string(search.terms)
"\\bdog\\b|\\bcat\\b|\\bfish\\b"
} # }