Skip to contents

The function splits treaty texts into lists that reflect a structure based on having a preamble and several articles. Once articles are split, users can access the "preambles", "accession" and "termination" clauses, or "annexes" within a collection of treaty texts. The selection of each of these articles relies on regex matching certain expressions unique to each of them. Alternatively, users can get all the articles that contain a certain 'desired' word within a collection of treaty texts. As well, users can select only certain types of treaties for which specific articles are to be returned (e.g. agreements).

Usage

retrieve_clauses(textvar, article = NULL, match = NULL, treaty_type = "all")

Arguments

textvar

A text variable

article

Would you like to get a specific article? Null by default. Other options include the "preamble", "termination" clause, "membership" clause, or "annex". The specified portion for all treaties will be returned.

match

A regex match for a word(s) or expression. For multiple words, please use "|" to divide them.

treaty_type

What types of treaty do you want to look at? By default, "all". Other treaty types include: "agreements", "protocols", "amendments", "notes", "memorandum", and "resolutions".

Value

A list of treaty sections of the same length.

Details

Please make sure treaty texts have been standardised first using standardise_texts() for best results.

Examples

if (FALSE) {
t <- standardise_treaty_text(sample(manyenviron::texts$AGR_TXT$Text, 30))
retrieve_clauses(t)
retrieve_clauses(t, article = "preamble")
retrieve_clauses(t, article = "accession")
retrieve_clauses(t, article = "termination")
retrieve_clauses(t, article = "annex")
retrieve_clauses(t, match = "constitution")
retrieve_clauses(t, article = "preamble", match = "amend")
retrieve_clauses(t, treaty_type = "agreements")
retrieve_clauses(t, treaty_type = "protocols")
retrieve_clauses(t, treaty_type = "amendments")
}