These methods should be used to get or set values of tagged text objects
generated by koRpus functions like treetag()
or tokenize()
.
taggedText(obj, add.desc = FALSE, doc_id = FALSE)# S4 method for kRp.taggedText
taggedText(obj, add.desc = FALSE,
doc_id = FALSE)
taggedText(obj) <- value
# S4 method for kRp.taggedText
taggedText(obj) <- value
# S4 method for kRp.taggedText
[(x, i, j)
# S4 method for kRp.taggedText
[(x, i, j) <- value
# S4 method for kRp.taggedText
[[(x, i)
# S4 method for kRp.taggedText
[[(x, i) <- value
# S4 method for kRp.taggedText
describe(obj)
# S4 method for kRp.taggedText
describe(obj) <- value
# S4 method for kRp.taggedText
language(obj)
# S4 method for kRp.taggedText
language(obj) <- value
is.taggedText(obj)
fixObject(obj, doc_id = NA)
# S4 method for kRp.taggedText
fixObject(obj, doc_id = NA)
tif_as_tokens_df(tokens)
# S4 method for kRp.taggedText
tif_as_tokens_df(tokens)
An arbitrary R
object.
Logical,
determines whether the desc
column should be re-written with descriptions
for all POS tags.
Logical (except for fixObject
),
if TRUE
the doc_id
column will be a factor with the respective value
of the desc
slot, i.\,e.,
the document ID will be preserved in the data.frame. If used with fixObject
, can be a character string
to set the document ID manually (the default NA
will preserve existing values and not overwrite them).
The new value to replace the current with.
An object of class kRp.taggedText
or kRp.hyphen
.
Defines the row selector ([
) or the name to match ([[
).
Defines the column selector.
An object of class kRp.tagged
.
taggedText()
returns the TT.res
slot.
describe()
returns the desc
slot.
language()
returns the lang
slot.
[
/[[
Can be used as a shortcut to index the results of taggedText()
.
fixObject
returns the same object upgraded to the object structure of this package version (e.g.,
new columns, changed names, etc.).
tif_as_tokens_df
returns the TT.res
slot in a TIF[1] compliant format,
i.e., doc_id
is not a factor but a character vector.
[1] Text Interchange Formats (https://github.com/ropensci/tif)
# NOT RUN {
taggedText(tagged.txt)
# }
Run the code above in your browser using DataLab