/** * Creates a deep copy of the cluster: segments in the new cluster are copies of the original * segments, not references. * * @return the object */ @Override public Cluster clone() { Cluster result = null; try { result = (Cluster) (super.clone()); } catch (CloneNotSupportedException e) { logger.log(Level.SEVERE, "", e); e.printStackTrace(); } result.segmentSet = new TreeSet<Segment>(); for (Segment segment : segmentSet) { result.segmentSet.add((segment.clone())); } result.informationMap = new TreeMap<String, Object>(new StringComparator()); for (String key : informationMap.keySet()) { result.setInformation(key, informationMap.get(key)); } result.modelScores = new ModelScores(); for (String key : modelScores.keySet()) { result.modelScores.put(key, modelScores.get(key)); } result.speakerNameSet = (SpeakerNameSet) speakerNameSet.clone(); return result; }
/** * Information of the cluster. * * @param level the level */ public void debug(int level) { logger.fine( "name= " + getName() + " gender= " + getGender() + " channel= " + getChannel() + " Length= " + getLength() + " info= " + getInformations()); speakerNameSet.debug(); for (Segment segment : segmentSet) { segment.debug(level); } }
/** * Gets the maximum scoreCluster for the given real speaker name. * * @return the maximum scoreCluster for the given real speaker name. */ public SpeakerName getMaxSpeakerName() { return speakerNameSet.getMaxScore(); }
/** * Compute sum. * * @throws Exception the exception */ public void computeSum() throws Exception { speakerNameSet.computeSum(); }
/** * Removes a SpeakerSame instance according the given real speaker name. * * @param name the real speaker name */ public void RemoveSpeakerName(String name) { speakerNameSet.remove(name); }
/** * Compute belief functions of the scoreCluster of speaker name set. * * @throws Exception the exception */ public void computeBeliefFunctions() throws Exception { speakerNameSet.computeBeliefFunctions(); }
/** Mean the scoreCluster of speaker name set. */ public void computeMeanScore() { speakerNameSet.meanScoreCluster(); }
/** Normalize the scoreCluster of speaker name set. */ public void computeNormalizedScore() { speakerNameSet.normalizeScoreCluster(); }
/** * Gets the speaker name. * * @param name the name of the real speaker name * @return the SpeakerName instance */ public SpeakerName getSpeakerName(String name) { return speakerNameSet.get(name); }
/** Clear speaker name set. */ public void clearSpeakerNameSet() { speakerNameSet.clear(); }