OntoSim 2.3

fr.inrialpes.exmo.ontosim.vector.model
Class DocumentCollection

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<Document>
              extended by 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

Nested Class Summary
static class DocumentCollection.WEIGHT
           
 
Field Summary
private static long serialVersionUID
           
private  TreeMap<String,Set<Document>> terms
           
 
Constructor Summary
DocumentCollection()
           
 
Method Summary
 boolean add(Document o)
           
private  void addTermOcc(Document doc, String term)
           
 void clear()
           
 String[] getDimensions()
           
 double[] getDocVector(Document doc, DocumentCollection.WEIGHT vectorType)
           
 Set<String> getTerms()
          return the set of terms Be careful this method returns a reference to the set of terms and not a copy !!!
 double[] getTFDocVector(Document doc)
           
 double[] getTFIDFDocVector(Document doc)
           
private  void indexTermsOf(Document doc)
           
 boolean remove(Document o)
           
 void update(Observable o, Object arg)
           
 
Methods inherited from class java.util.HashSet
clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

terms

private TreeMap<String,Set<Document>> terms
Constructor Detail

DocumentCollection

public DocumentCollection()
Method Detail

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

OntoSim 2.3

(C) INRIA, UPMF & friends, 2008-2011