query | R Documentation |
Create a query in the format of a given textmatrix.
query ( qtext, termlist, stemming=FALSE, language="german" )
termlist |
the termlist of the background latent-semantic space. |
language |
specifies a language for stemming / stop-word-removal. |
stemming |
boolean, specifies whether all terms will be reduced to their wordstems. |
qtext |
the query string, words are separated by blanks. |
Create queries, i.e., an additional term vector to be used for query-to-document comparisons, in the format of a given textmatrix.
query |
returns the query vector (based on the given vocabulary) as matrix. |
Fridolin Wild f.wild@open.ac.uk
wordStem
, textmatrix
# prepare some files td = tempfile() dir.create(td) write( c("dog", "cat", "mouse"), file=paste(td,"D1", sep="/") ) write( c("hamster", "mouse", "sushi"), file=paste(td,"D2", sep="/") ) write( c("dog", "monster", "monster"), file=paste(td,"D3", sep="/") ) # demonstrate generation of a query dtm = textmatrix(td) query("monster", rownames(dtm)) query("monster dog", rownames(dtm)) # clean up unlink(td, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.