Description Usage Arguments Format Details Value Core Methods Author(s) See Also Examples
Document
Entity class for text documents.
1 |
x |
Character vector of text. |
name |
Character string containing the name for the Document object. |
purpose |
Character string used to indicate how the document will be used, e.g. 'train', 'test'. |
note |
Character string containing a comment associated with a call to the text method. The texts of the note variable are written to the Documents log. This is used to track changes to the text, perhaps made during preprocessing. |
An object of class R6ClassGenerator
of length 24.
Entity class for text documents with methods for adding text from character vectors.
Document object, containing the Document text, the metadata and the methods to manage both.
new(name = NULL, purpose = NULL)
Initializes an object of the Document class.
text(x, note = NULL)
Method for obtaining/adding/updating text. If no
parameters are presented, the current text is returned. Otherwise, the text
is updated with the texts of the character vector 'x'. Sentence, word, token, type,
sentence and word length statistics are also computed and the metadata is updated
accordingly.
overview()
Provides a subset of the metadata in a one-row data.frame format.
This is used by the parent class's summary method.
John James, jjames@datasciencesalon.org
Other Document Classes: Corpus
,
Primitive0
1 2 3 4 5 6 7 8 | report <- c("SAN FRANCISCO — She was snowboarding with her boyfriend when ",
"she heard someone scream 'Avalanche!'",
"Then John, 39, saw 'a cloud of snow coming down.'")
avalanche <- Document$new(name = 'avalanche', purpose = 'raw')
avalance$content <- report
key <- c('genre', 'author', 'year')
value <- c('weather', 'chris jones', 2018)
avalanche$meta$setDescriptive(key = key value = value)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.