uk.ac.gla.dcs.renaissance.interference
Class PhasesComputer

java.lang.Object
  extended by bpiwowar.experiments.AbstractTask
      extended by uk.ac.gla.dcs.renaissance.interference.PhasesComputer
All Implemented Interfaces:
bpiwowar.experiments.Task

public class PhasesComputer
extends bpiwowar.experiments.AbstractTask


Nested Class Summary
 
Nested classes/interfaces inherited from class bpiwowar.experiments.AbstractTask
bpiwowar.experiments.AbstractTask.Information
 
Constructor Summary
PhasesComputer()
           
PhasesComputer(Cooccurrences cooccurrencesProcessor, CorpusCooccurrences corpusCooccurrences)
           
 
Method Summary
 double[] computePhases(Iterator<Long> termIterator, Map<Long,Integer> mapping, Set<Long> interestingTerms)
          Computes the phases for a set of terms
 int execute()
           
 void init(Mapping<String,Long> mappingAdaptator)
           
 void processDocument(Iterator<Long> termIterator, Map<Cooccurrences.UnorderedPair,Cooccurrences.Statistics> statistics, Set<Long> terms)
          Process a document
 void setCorpusCooccurrences(CorpusCooccurrences corpusCooccurrences)
           
 
Methods inherited from class bpiwowar.experiments.AbstractTask
getName, getParent, init, processTrailingArguments, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhasesComputer

public PhasesComputer()

PhasesComputer

public PhasesComputer(Cooccurrences cooccurrencesProcessor,
                      CorpusCooccurrences corpusCooccurrences)
Method Detail

setCorpusCooccurrences

public void setCorpusCooccurrences(CorpusCooccurrences corpusCooccurrences)

computePhases

public double[] computePhases(Iterator<Long> termIterator,
                              Map<Long,Integer> mapping,
                              Set<Long> interestingTerms)
                       throws Exception
Computes the phases for a set of terms

Parameters:
termIterator -
mapping - Internal mapping between a term id and a phase in the array, which is filled while processing the document if the term is interfering with another one
interestingTerms - Terms for which we have in interested in knowing the phase (null if all)
Returns:
An array of phases for which mapping provides the mapping
Throws:
Exception - if something goes wrong

processDocument

public void processDocument(Iterator<Long> termIterator,
                            Map<Cooccurrences.UnorderedPair,Cooccurrences.Statistics> statistics,
                            Set<Long> terms)
Process a document

Parameters:
termIterator - The iterator on terms
statistics - The statistics that we will collect
terms - The set of terms of the document
globalPairs - The set of pairs that have been detected at a global level

init

public void init(Mapping<String,Long> mappingAdaptator)
          throws IOException
Throws:
IOException

execute

public int execute()
            throws Throwable
Overrides:
execute in class bpiwowar.experiments.AbstractTask
Throws:
Throwable


Copyright © 2011. All Rights Reserved.