txx_identify_sections: Identify sections within text, and wrap in tags

Description Usage Arguments Details Value

View source: R/txx_identify_sections.R

Description

This function identifies the tags within a character string, and then wraps the identified text in XML tag syntax. Generally not used outside of the txx_text_to_xml function, but has its uses.

Usage

1
txx_identify_sections(string, tags, ignore_case = TRUE)

Arguments

string

A character string of the document to be searched

tags

A vector of character strings - strings used to identify a section of text

ignore_case

Logic value of whether you want to ignore the case when identifying the sections

Details

Note that tag order is important - the first tags are identified first and modify the string. If there is another tag that would have identified a section within that string before the first tag, it would not identify it after.

Tags can be regular expressions - use with caution to avoid mis-identifying sections.

Value

A character string with sections identified and wrapped in an XML tag.


michael-ccccc/textured documentation built on Dec. 21, 2021, 5:56 p.m.