fr.inrialpes.exmo.ontosim.vector.model
Class DocumentCollection
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<Document>
fr.inrialpes.exmo.ontosim.vector.model.DocumentCollection
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<Document>, Collection<Document>, Observer, Set<Document>
public class DocumentCollection
- extends HashSet<Document>
- implements Observer
- See Also:
- Serialized Form
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
terms
private TreeMap<String,Set<Document>> terms
DocumentCollection
public DocumentCollection()
indexTermsOf
private void indexTermsOf(Document doc)
addTermOcc
private void addTermOcc(Document doc,
String term)
getTerms
public Set<String> getTerms()
- return the set of terms
Be careful this method returns a reference to the set of terms and not a copy !!!
- Returns:
- a reference to the set of term contained in this tf.idf object
getDimensions
public String[] getDimensions()
getTFIDFDocVector
public double[] getTFIDFDocVector(Document doc)
getDocVector
public double[] getDocVector(Document doc,
DocumentCollection.WEIGHT vectorType)
getTFDocVector
public double[] getTFDocVector(Document doc)
add
public boolean add(Document o)
- Specified by:
add
in interface Collection<Document>
- Specified by:
add
in interface Set<Document>
- Overrides:
add
in class HashSet<Document>
clear
public void clear()
- Specified by:
clear
in interface Collection<Document>
- Specified by:
clear
in interface Set<Document>
- Overrides:
clear
in class HashSet<Document>
remove
public boolean remove(Document o)
update
public void update(Observable o,
Object arg)
- Specified by:
update
in interface Observer
(C) INRIA & friends, 2008-2009