org.jbox.indexer
Class IndexWriterWithTFLOC

java.lang.Object
  extended by org.jbox.indexer.AbstractIndexWriter
      extended by org.jbox.indexer.IndexWriterWithTFLOC
All Implemented Interfaces:
IndexWriter

public class IndexWriterWithTFLOC
extends AbstractIndexWriter

A implementation of IndexWriter, creating word index with TF and location.

Version:
1.0
Author:
YiBin.H
See Also:
Word

Field Summary
 
Fields inherited from class org.jbox.indexer.AbstractIndexWriter
pageHome, wordHome
 
Constructor Summary
IndexWriterWithTFLOC()
           
 
Method Summary
 void createIndex(Word w, long urlId)
          Create index of a Word with TF and location.
 
Methods inherited from class org.jbox.indexer.AbstractIndexWriter
saveIndex, setPageHome, setWordHome
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexWriterWithTFLOC

public IndexWriterWithTFLOC()
Method Detail

createIndex

public void createIndex(Word w,
                        long urlId)
Create index of a Word with TF and location.
The "index" created might be like below: "22-0.166667-0,1" The first field "22" means the word did appear in Page with id 22, the Second field "0.166667" means the TF of the word in a page, and "0,1" represents the locations of the word. For example: "I have a cat. You have a dog. He is so funny." The word "have" appear in first sentence and second, so locations of the word in the text is "0,1". The text have 12 words, so the TF is 2/12 = 0.166667. Suppose the id of this text is "22", and then index of this word in the text is "22-0.166667-0,1".

Specified by:
createIndex in class AbstractIndexWriter
Parameters:
w - which need to create index.
urlId - the id of page which contains the word.