| natlan | R Documentation |
This function replicates the TRANSLATE INTO NATURAL LANGUAGE command in the DELTA system. It creates the necessary directives file and runs the CONFOR program to generate natural language descriptions.
natlan(
delta,
heading = NULL,
replace_angle_brackets = TRUE,
omit_character_numbers = TRUE,
omit_inapplicables = TRUE,
omit_comments = TRUE,
omit_inner_comments = TRUE,
omit_final_comma = TRUE,
translate_implicit_values = FALSE,
omit_lower_for_characters = NULL,
omit_or_for_characters = NULL,
omit_period_for_characters = NULL,
new_paragraphs_at_characters = NULL,
item_subheadings = NULL,
link_characters = NULL,
replace_semicolon_by_comma = NULL,
print_width = 80,
exclude_items = NULL,
exclude_characters = NULL,
vocabulary = NULL,
remove_temp = TRUE
)
delta |
A Delta dataset object (created by |
heading |
Heading for the descriptions (default = NULL, uses heading from specs file) |
replace_angle_brackets |
Replace angle brackets with parentheses (default = TRUE) |
omit_character_numbers |
Omit character numbers from descriptions (default = TRUE) |
omit_inapplicables |
Omit 'or not applicable' from descriptions (default = TRUE) |
omit_comments |
Omit comments in attributes (default = TRUE) |
omit_inner_comments |
Omit inner comments in character list and attributes (default = TRUE) |
omit_final_comma |
Omit final comma before 'and' (default = TRUE) |
translate_implicit_values |
Output implicit values in descriptions (default = FALSE) |
omit_lower_for_characters |
List of numeric characters to omit lower values |
omit_or_for_characters |
List of characters to omit 'or' between alternatives |
omit_period_for_characters |
List of characters where period would normally terminate a sentence |
new_paragraphs_at_characters |
List of characters where new paragraphs should start |
item_subheadings |
List of subheadings for items (delimiter/character/value) |
link_characters |
List of characters specifying how attributes are combined |
replace_semicolon_by_comma |
List of characters to use comma instead of semicolon |
print_width |
Maximum line length for output (default = 80) |
exclude_items |
List of items to exclude |
exclude_characters |
List of characters to exclude |
vocabulary |
List for custom vocabulary (default = NULL) |
remove_temp |
Logical; if TRUE, remove temporary files after conversion (default = TRUE) |
The function assumes that the CONFOR program executable is available in the system PATH or in the current working directory.
Invisibly returns the descriptions as a character vector
# Requires the CONFOR executable on the PATH.
try({
delta <- load_delta(
system.file("extdata", "chars_viola", package = "RDelta"),
system.file("extdata", "items_viola", package = "RDelta"),
system.file("extdata", "specs_viola", package = "RDelta")
)
natlan(delta)
natlan(delta,
heading = "Flora of Region X - species descriptions",
item_subheadings = list(
"87" = "Transverse section of lamina",
"96" = "Leaf epidermis"
))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.