gr.demokritos.iit.jinsect.documentModel.representations
Class DocumentNGramDistroGraph

java.lang.Object
  extended by gr.demokritos.iit.jinsect.documentModel.representations.DocumentNGramGraph
      extended by gr.demokritos.iit.jinsect.documentModel.representations.DocumentNGramDistroGraph
All Implemented Interfaces:
IMergeable<DocumentNGramGraph>, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DocumentNGramSymWinDistroGraph, DocumentWordDistroGraph

public class DocumentNGramDistroGraph
extends DocumentNGramGraph

See Also:
Serialized Form

Field Summary
protected  java.util.HashMap EdgeDistros
           
 
Fields inherited from class gr.demokritos.iit.jinsect.documentModel.representations.DocumentNGramGraph
CorrelationWindow, DataString, DegradedEdges, MaxSize, MinSize, NGramGraphArray, Normalizer, TextPreprocessor, WordEvaluator
 
Constructor Summary
DocumentNGramDistroGraph()
          Creates a new instance of DocumentNGramDistroGraph
DocumentNGramDistroGraph(int iMinSize, int iMaxSize, int iCorrelationWindow)
           
 
Method Summary
 DocumentNGramDistroGraph allNotIn(DocumentNGramDistroGraph dgOtherGraph)
          Returns all edges not existent in another graph.
 java.lang.Object clone()
          TODO: CHECK
 void createEdgesConnecting(UniqueVertexGraph gGraph, java.lang.String sStartNode, java.util.List lOtherNodes, java.util.HashMap hAppearenceHistogram)
          Creates an edge in a graph connecting a selected node to each node in a list of other nodes.
 java.util.Map getEdgesToDistros()
          Returns a mapping of edges to corresponding distributions.
protected  void InitGraphs()
           
 DocumentNGramDistroGraph[] intersectAndDeltaDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
          Returns both the intersection and the difference (inverse of the intersection) graph between the current graph and a given graph.
 DocumentNGramDistroGraph intersectDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
          Returns the intersection of two graphs as a new graph, containing only common nodes and their corresponding edges.
 DocumentNGramDistroGraph inverseIntersectDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
          Returns the difference (inverse of the intersection) graph between the current graph and a given graph.
static void main(java.lang.String[] sArgs)
           
 DocumentNGramDistroGraph mergeDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
          TODO: Correct Merges the data of [dgOtherGraph] document graph to the data of this graph, by adding all existing edges and summing the histogram values of the edge distros of both graphs.
 void setDataString(java.lang.String sDataString)
           
protected  void updateWeights()
          DONE: Checked Updates all weights, based on a function of the corresponding distro.
 
Methods inherited from class gr.demokritos.iit.jinsect.documentModel.representations.DocumentNGramGraph
allNotIn, calcCoexistenceImportance, calcCoexistenceImportance, createGraphs, createWeightedEdgesConnecting, degrade, degredationDegree, deleteItem, getAllNodes, getDataString, getGraphLevel, getGraphLevelByNGramSize, getMaxSize, getMinSize, getWindowSize, intersectGraph, inverseIntersectGraph, isEmpty, length, loadDataStringFromFile, merge, mergeGraph, nullify, prune, toCooccurenceText
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EdgeDistros

protected java.util.HashMap EdgeDistros
Constructor Detail

DocumentNGramDistroGraph

public DocumentNGramDistroGraph()
Creates a new instance of DocumentNGramDistroGraph


DocumentNGramDistroGraph

public DocumentNGramDistroGraph(int iMinSize,
                                int iMaxSize,
                                int iCorrelationWindow)
Method Detail

InitGraphs

protected void InitGraphs()
Overrides:
InitGraphs in class DocumentNGramGraph

setDataString

public void setDataString(java.lang.String sDataString)
Overrides:
setDataString in class DocumentNGramGraph

createEdgesConnecting

public void createEdgesConnecting(UniqueVertexGraph gGraph,
                                  java.lang.String sStartNode,
                                  java.util.List lOtherNodes,
                                  java.util.HashMap hAppearenceHistogram)
Creates an edge in a graph connecting a selected node to each node in a list of other nodes. The method also uses a histogram of appearences of the terms in the graph vertices as background knowledge.

Overrides:
createEdgesConnecting in class DocumentNGramGraph
Parameters:
gGraph - The graph to use
sStartNode - The node from which all edges begin
lOtherNodes - The list of nodes to which sBaseNode is connected
hAppearenceHistogram - The histogram of appearences of the terms

updateWeights

protected void updateWeights()
DONE: Checked Updates all weights, based on a function of the corresponding distro.


mergeDistroGraph

public DocumentNGramDistroGraph mergeDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
TODO: Correct Merges the data of [dgOtherGraph] document graph to the data of this graph, by adding all existing edges and summing the histogram values of the edge distros of both graphs. The current graph is modified, becoming the merged graph.

Parameters:
dgOtherGraph - The second graph used for the merging

intersectDistroGraph

public DocumentNGramDistroGraph intersectDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
Returns the intersection of two graphs as a new graph, containing only common nodes and their corresponding edges. The values of the edges are updated by summing the histogram distro values of the edges.

Parameters:
dgOtherGraph - The second graph used for the intersection.
Returns:
A DocumentNGramDistroGraph indicating the maximum common subgraph of the given graph the second graph.

inverseIntersectDistroGraph

public DocumentNGramDistroGraph inverseIntersectDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
Returns the difference (inverse of the intersection) graph between the current graph and a given graph.

Parameters:
dgOtherGraph - The graph to compare to.
Returns:
A DocumentNGramDistroGraph that is the difference between the current graph and the given graph. The edge distributions are kept from the original graphs.

intersectAndDeltaDistroGraph

public DocumentNGramDistroGraph[] intersectAndDeltaDistroGraph(DocumentNGramDistroGraph dgOtherGraph)
Returns both the intersection and the difference (inverse of the intersection) graph between the current graph and a given graph.

Parameters:
dgOtherGraph - The graph to use for intersection and difference.
Returns:
A DocumentNGramDistroGraph array of two elements. The first is the intersection between the current graph and the given graph and the second is the difference of the graphs. The edge distributions are kept from the original graphs.

allNotIn

public DocumentNGramDistroGraph allNotIn(DocumentNGramDistroGraph dgOtherGraph)
Returns all edges not existent in another graph.

Parameters:
dgOtherGraph - The graph to use for intersection and difference.
Returns:
A DocumentNGramDistroGraph containing all edges from this graph not existing in the other given graph (edge distros are not used). The edge distributions are kept from this graphs.

getEdgesToDistros

public java.util.Map getEdgesToDistros()
Returns a mapping of edges to corresponding distributions.

Returns:
The Map of edges to distributions.

clone

public java.lang.Object clone()
TODO: CHECK

Overrides:
clone in class DocumentNGramGraph

main

public static void main(java.lang.String[] sArgs)