Last chance! 50% off unlimited learning
Sale ends in
The function set.kRp.env
can be called before any of the analysing functions. It writes information
on your session environment regarding the koRpus package,
e.g. path to a local TreeTagger installation,
to your global .Options
.
set.kRp.env(..., validate = TRUE)
Named parameters to set in the koRpus environment. Valid arguments are:
A character string pointing to the tagger command you want to use for basic text analysis,
or "manual"
if
you want to set TT.options
as well. Set to "tokenize"
to use tokenize
.
A character string specifying a valid language.
A list with arguments to be used as TT.options
by treetag
.
A character string specifying a path to a file to use for storing already hyphenated data,
used by
hyphen
.
A logical value, whether tag descriptions should be added directly to tagged text objects.
To explicitly unset a value again, set it to an empty character string (e.g.,
lang=""
).
Logical,
if TRUE
given paths will be checked for actual availablity, and the function will fail if files can't be found.
Returns an invisible NULL
.
To get the current settings, the function get.kRp.env
should be used. For the most part, set.kRp.env
is a convenient wrapper for
options
. To permanently set some defaults, you could also add
respective options
calls to an .Rprofile
file.
Note that you can also suppress the startup message informing about available.koRpus.lang
and install.koRpus.lang
by adding noStartupMessage=TRUE
to the options in .Rprofile
.
# NOT RUN {
set.kRp.env(TT.cmd="~/bin/treetagger/cmd/tree-tagger-german", lang="de")
get.kRp.env(TT.cmd=TRUE)
# example for setting permanent default values in an .Rprofile file
options(
koRpus=list(
TT.cmd="manual",
TT.options=list(
path="~/bin/treetagger",
preset="de"),
lang="de",
noStartupMessage=TRUE
)
)
# be aware that setting a permamnent default language without loading
# the respective language support package might trigger errors
# }
Run the code above in your browser using DataLab