set.sylly.env: A function to set information on your sylly environment

Description Usage Arguments Details Value See Also Examples

View source: R/set.sylly.env.R

Description

The function set.sylly.env can be called before any of the hyphenation functions. It writes information on your current session's settings to your global .Options.

Usage

1
set.sylly.env(..., validate = TRUE)

Arguments

...

Named parameters to set in the sylly environment. Valid arguments are:

lang

A character string specifying a valid language.

hyph.cache.file

A character string specifying a path to a file to use for storing already hyphenated data, used by hyphen.

hyph.max.token.length

A single number to set the internal cache size for tokens. The value should be set to the longest token to be hyphenated.

To explicitly unset a value again, set it to an empty character string (e.g., lang="").

validate

Logical, if TRUE given paths will be checked for actual availablity, and the function will fail if files can't be found. This option is currently without any effect, as it does not apply to hyph.cache.file because that file will be created automatically if needed.

Details

To get the current settings, the function get.sylly.env should be used. For the most part, set.sylly.env is a convenient wrapper for options. To permanently set some defaults, you could also add respective options calls to an .Rprofile file.

Value

Returns an invisible NULL.

See Also

get.sylly.env

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
set.sylly.env(hyph.cache.file=file.path(tempdir(), "cache_file.RData"))
get.sylly.env(hyph.cache.file=TRUE)

## Not run: 
# example for setting permanent default values in an .Rprofile file
options(
  sylly=list(
    hyph.cache.file=file.path(tempdir(), "cache_file.RData"),
    lang="de"
  )
)
# be aware that setting a permamnent default language without loading
# the respective language support package might trigger errors

## End(Not run)

sylly documentation built on Sept. 20, 2020, 9:07 a.m.