the document multiplied by the word 39 s idf value in the example all frequencies turn out to be 1 so the weight of a word in a document becomes the word 39 s idf value the calculation of a sim value for a query and a document can now be explained by reference to the similarity procedure in fig2 and a small sample calculation consider the words used in the original query of fig5 and the words used in document 4 of fig6 these two lists are called the query word list and the document word list and they are the inputs to the similarity procedure step 405 sets the sim value to zero step 410 sets qword to 34 fast 34 since 34 fast 34 is not in document 4 step 420 causes movement to step 430 since 34 fast 34 does trigger semantic categories step 430 causes movement to step 435 and step 440 causes cat to be 34 515 34 and qp to be 1 15 at step 445 there is no word in document 4 that triggers 34 515 34 so step 435 is executed again steps 435 440 and 445 re repeatedly executed with no movement to step 450 until category 34 174 34 is used at step 440 cat eventually becomes 34 174 34 and qp becomes 2 15 since there are two of 34 174 34 in.