query                  package:lsa                  R Documentation

_Q_u_e_r_y (_M_a_t_r_i_c_e_s)

_D_e_s_c_r_i_p_t_i_o_n:

     Create a query in the format of a given textmatrix.

_U_s_a_g_e:

     query ( qtext, termlist, stemming=FALSE, language="german" )

_A_r_g_u_m_e_n_t_s:

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.

_D_e_t_a_i_l_s:

     Create queries, i.e., an additional term vector to be used for
     query-to-document comparisons, in the format of a given
     textmatrix.

_V_a_l_u_e:

   query: returns the query vector (based on the given vocabulary) as
          matrix.

_A_u_t_h_o_r(_s):

     Fridolin Wild fridolin.wild@wu-wien.ac.at

_S_e_e _A_l_s_o:

     'wordStem', 'textmatrix'

_E_x_a_m_p_l_e_s:

     # 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)

