Description Usage Arguments Examples
View source: R/corpus.R View source: R/corpus.R
If we are interested in a specific term, we often want to know which documents in a corpus contain that term. The inverse index tells us this and therefore provides a simplistic sort of search algorithm.
Tells the size of the inverse index.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | inverse_index(corpus)
update_inverse_index(corpus)
## S3 method for class 'corpus'
inverse_index(corpus)
## S3 method for class 'corpus'
update_inverse_index(corpus)
inverse_index(corpus)
## S3 method for class 'corpus'
inverse_index(corpus)
|
corpus |
A corpus, as returned vy |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
init_textanalysis()
# build document
doc1 <- string_document("First document.")
doc2 <- string_document("Second document.")
# do not update automatically
corpus <- corpus(doc1, doc2, update_inverse_index = FALSE)
# update manually
update_inverse_index(corpus)
inverse_index(corpus)
## End(Not run)
## Not run:
init_textanalysis()
# build document
doc1 <- string_document("First document.")
doc2 <- string_document("Second document.")
corpus <- corpus(doc1, doc2)
update_inverse_index(corpus)
inverse_index(corpus)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.