
gr.demokritos.iit.jinsect.structs.VectorSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JInsect Show documentation
Show all versions of JInsect Show documentation
The JINSECT toolkit is a Java-based toolkit and library that supports and demonstrates the use of n-gram graphs within Natural Language Processing applications, ranging from summarization and summary evaluation to text classification and indexing.
The newest version!
/*
* DistributionSet.java
*
* Created on March 30, 2007, 10:59 AM
*
*/
package gr.demokritos.iit.jinsect.structs;
import gr.demokritos.iit.conceptualIndex.structs.Distribution;
import java.util.HashSet;
import java.util.Iterator;
/**
*
* @author ggianna
*/
public class VectorSet extends HashSet {
/**
* Creates a new instance of VectorSet, expected to contain a set of {@link Distribution}
* objects, viewed as Vectors.
*/
public VectorSet() {
}
/** Calculates the centroid of all distributions contained.
*@return The centroid
*/
public Distribution centroid() {
if (isEmpty())
return null;
Distribution dRes = new Distribution();
Iterator iVectorIter = iterator();
// For all vectors
while (iVectorIter.hasNext()) {
Distribution dCurVector = (Distribution)iVectorIter.next();
// For all features
Iterator iFeatures = dCurVector.asTreeMap().keySet().iterator();
while (iFeatures.hasNext()) {
Object oFeatureKey = iFeatures.next();
}
}
// TODO: Implement
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy