replace_acronyms_by_words: Replace acronyms by words

View source: R/replace_acronyms_by_words.R

replace_acronyms_by_wordsR Documentation

Replace acronyms by words

Description

Searches for acronyms that are followed by a bracketed explanation and replaces the acronym by the content in the brackets.

Usage

replace_acronyms_by_words(docs, remove_replaced_acr = TRUE,
  remove_all_bracketed_acr = TRUE)

Arguments

docs

The documents to be processed in form of a character vector. Each document is processed separately, hence no shared acronyms are assumed.

remove_replaced_acr

By default TRUE. If an acronym was identified and replaced, the acronym itself is deleted.

remove_all_bracketed_acr

By default TRUE. All acronyms in brackets are removed. The identification pattern is ([A-Z][A-Za-z]*[A-Z]s?\).

Details

Currently requires stringi and magrittr loaded (the latter dependency will be removed in the future).

NOTE: The implementation is currently quite slow if there are many acronyms that are not matched. Might be improved in future...

Documentation still to be updated, please check the code in the meantime.

Value

The documents wit acronyms replaced.

Examples

replace_acronyms_by_words("The United Nations Framework Convention on Climate Change (UNFCCC) is a milestone. The UNFCCC came into force in 1994.")


manuelbickel/textility documentation built on Nov. 25, 2022, 9:07 p.m.