C# Class Smrf.NodeXL.ExcelTemplate.WordMetricCalculator2

Counts words and word pairs in a specified column.
This graph metric calculator differs from most other calculators in that it reads an arbitrary column in the Excel workbook. The other calculators look only at how the graph's vertices are connected to each other. Therefore, there is no corresponding lower-level WordMetricCalculator class in the Smrf.NodeXL.Algorithms namespace, and the word metrics cannot be calculated outside of this ExcelTemplate project.

This class uses "term" to describe either a word or a word pair. It uses the WordCounter class to count words and the class to count word pairs in a specified column. It specifies that the words be stored on one worksheet and the word pairs in another.

Inheritance: GraphMetricCalculatorBase2
Show file Open project: 2014-sed-team3/term-project

Public Methods

Method Description
AssertValid ( ) : void
TryCalculateGraphMetrics ( IGraph graph, CalculateGraphMetricsContext calculateGraphMetricsContext, GraphMetricColumn &graphMetricColumns ) : System.Boolean
WordMetricCalculator2 ( ) : System

Initializes a new instance of the WordMetricCalculator2 class.

Protected Methods

Method Description
AddCountedWordPairToValueLists ( CountedWordPair oCountedWordPair, WordMetricUserSettings oWordMetricUserSettings, List oWordPairWord1Values, List oWordPairWord2Values, List oWordPairCountValues, List oWordPairSalienceValues, List oWordPairMutualInformationValues ) : System.Boolean
AddCountedWordPairsToValueLists ( IEnumerable oCountedWordPairs, WordMetricUserSettings oWordMetricUserSettings, String sGroupName, List oWordPairWord1Values, List oWordPairWord2Values, List oWordPairCountValues, List oWordPairSalienceValues, List oWordPairMutualInformationValues, List oWordPairGroupNameValues ) : void
AddCountedWordToValueLists ( CountedWord oCountedWord, WordMetricUserSettings oWordMetricUserSettings, List oWordWordValues, List oWordCountValues, List oWordSalienceValues ) : System.Boolean
AddCountedWordsToValueLists ( IEnumerable oCountedWords, WordMetricUserSettings oWordMetricUserSettings, String sGroupName, List oWordWordValues, List oWordCountValues, List oWordSalienceValues, List oWordGroupNameValues ) : void
CountTermsInEdgeOrVertex ( IMetadataProvider oEdgeOrVertex, String sTextColumnName, WordCounter oWordCounter, WordPairCounter oWordPairCounter ) : void
CreateGraphMetricColumn ( System.Boolean bColumnIsInWordTable, String sColumnName, System.Boolean bValuesAreDouble, List oValues ) : GraphMetricColumnOrdered
CreateGraphMetricColumns ( List oWordWordValues, List oWordCountValues, List oWordSalienceValues, List oWordGroupNameValues, List oWordPairWord1Values, List oWordPairWord2Values, List oWordPairCountValues, List oWordPairSalienceValues, List oWordPairMutualInformationValues, List oWordPairGroupNameValues ) : Smrf.NodeXL.ExcelTemplate.GraphMetricColumn[]
CreateGraphMetricValueLists ( List &oWordWordValues, List &oWordCountValues, List &oWordSalienceValues, List &oWordPairWord1Values, List &oWordPairWord2Values, List &oWordPairCountValues, List &oWordPairSalienceValues, List &oWordPairMutualInformationValues ) : void
EdgesOrVerticesHaveImportedIDs ( IGraph oGraph, System.Boolean bCheckEdges ) : System.Boolean
EnumerateEdgesOrVertices ( System oEdgesOrVerticesToEnumerate, System.Boolean bAreEdges, IGraph oGraph, HashSet oUniqueImportedIDs ) : IEnumerable
EnumerateGroupsForCountingVertexTerms ( IGraph oGraph ) : IEnumerable
ShouldEnumerateEdgeOrVertex ( IMetadataProvider oEdgeOrVertex, HashSet oUniqueImportedIDs ) : System.Boolean
TryCountEdgeTermsByGroup ( IGraph oGraph, WordMetricUserSettings oWordMetricUserSettings, WordCounter oWordCounter, WordPairCounter oWordPairCounter, HashSet oUniqueImportedIDs, GraphMetricColumn &oGraphMetricColumns ) : System.Boolean
TryCountTermsNoGroups ( IGraph oGraph, WordMetricUserSettings oWordMetricUserSettings, WordCounter oWordCounter, WordPairCounter oWordPairCounter, HashSet oUniqueImportedIDs, GraphMetricColumn &oGraphMetricColumns ) : System.Boolean
TryCountVertexTermsByGroup ( IGraph oGraph, WordMetricUserSettings oWordMetricUserSettings, WordCounter oWordCounter, WordPairCounter oWordPairCounter, HashSet oUniqueImportedIDs, GraphMetricColumn &oGraphMetricColumns ) : System.Boolean

Method Details

AddCountedWordPairToValueLists() protected method

protected AddCountedWordPairToValueLists ( CountedWordPair oCountedWordPair, WordMetricUserSettings oWordMetricUserSettings, List oWordPairWord1Values, List oWordPairWord2Values, List oWordPairCountValues, List oWordPairSalienceValues, List oWordPairMutualInformationValues ) : System.Boolean
oCountedWordPair Smrf.AppLib.CountedWordPair
oWordMetricUserSettings WordMetricUserSettings
oWordPairWord1Values List
oWordPairWord2Values List
oWordPairCountValues List
oWordPairSalienceValues List
oWordPairMutualInformationValues List
return System.Boolean

AddCountedWordPairsToValueLists() protected method

protected AddCountedWordPairsToValueLists ( IEnumerable oCountedWordPairs, WordMetricUserSettings oWordMetricUserSettings, String sGroupName, List oWordPairWord1Values, List oWordPairWord2Values, List oWordPairCountValues, List oWordPairSalienceValues, List oWordPairMutualInformationValues, List oWordPairGroupNameValues ) : void
oCountedWordPairs IEnumerable
oWordMetricUserSettings WordMetricUserSettings
sGroupName String
oWordPairWord1Values List
oWordPairWord2Values List
oWordPairCountValues List
oWordPairSalienceValues List
oWordPairMutualInformationValues List
oWordPairGroupNameValues List
return void

AddCountedWordToValueLists() protected method

protected AddCountedWordToValueLists ( CountedWord oCountedWord, WordMetricUserSettings oWordMetricUserSettings, List oWordWordValues, List oWordCountValues, List oWordSalienceValues ) : System.Boolean
oCountedWord Smrf.AppLib.CountedWord
oWordMetricUserSettings WordMetricUserSettings
oWordWordValues List
oWordCountValues List
oWordSalienceValues List
return System.Boolean

AddCountedWordsToValueLists() protected method

protected AddCountedWordsToValueLists ( IEnumerable oCountedWords, WordMetricUserSettings oWordMetricUserSettings, String sGroupName, List oWordWordValues, List oWordCountValues, List oWordSalienceValues, List oWordGroupNameValues ) : void
oCountedWords IEnumerable
oWordMetricUserSettings WordMetricUserSettings
sGroupName String
oWordWordValues List
oWordCountValues List
oWordSalienceValues List
oWordGroupNameValues List
return void

AssertValid() public method

public AssertValid ( ) : void
return void

CountTermsInEdgeOrVertex() protected method

protected CountTermsInEdgeOrVertex ( IMetadataProvider oEdgeOrVertex, String sTextColumnName, WordCounter oWordCounter, WordPairCounter oWordPairCounter ) : void
oEdgeOrVertex IMetadataProvider
sTextColumnName String
oWordCounter WordCounter
oWordPairCounter WordPairCounter
return void

CreateGraphMetricColumn() protected method

protected CreateGraphMetricColumn ( System.Boolean bColumnIsInWordTable, String sColumnName, System.Boolean bValuesAreDouble, List oValues ) : GraphMetricColumnOrdered
bColumnIsInWordTable System.Boolean
sColumnName String
bValuesAreDouble System.Boolean
oValues List
return GraphMetricColumnOrdered

CreateGraphMetricColumns() protected method

protected CreateGraphMetricColumns ( List oWordWordValues, List oWordCountValues, List oWordSalienceValues, List oWordGroupNameValues, List oWordPairWord1Values, List oWordPairWord2Values, List oWordPairCountValues, List oWordPairSalienceValues, List oWordPairMutualInformationValues, List oWordPairGroupNameValues ) : Smrf.NodeXL.ExcelTemplate.GraphMetricColumn[]
oWordWordValues List
oWordCountValues List
oWordSalienceValues List
oWordGroupNameValues List
oWordPairWord1Values List
oWordPairWord2Values List
oWordPairCountValues List
oWordPairSalienceValues List
oWordPairMutualInformationValues List
oWordPairGroupNameValues List
return Smrf.NodeXL.ExcelTemplate.GraphMetricColumn[]

CreateGraphMetricValueLists() protected method

protected CreateGraphMetricValueLists ( List &oWordWordValues, List &oWordCountValues, List &oWordSalienceValues, List &oWordPairWord1Values, List &oWordPairWord2Values, List &oWordPairCountValues, List &oWordPairSalienceValues, List &oWordPairMutualInformationValues ) : void
oWordWordValues List
oWordCountValues List
oWordSalienceValues List
oWordPairWord1Values List
oWordPairWord2Values List
oWordPairCountValues List
oWordPairSalienceValues List
oWordPairMutualInformationValues List
return void

EdgesOrVerticesHaveImportedIDs() protected method

protected EdgesOrVerticesHaveImportedIDs ( IGraph oGraph, System.Boolean bCheckEdges ) : System.Boolean
oGraph IGraph
bCheckEdges System.Boolean
return System.Boolean

EnumerateEdgesOrVertices() protected method

protected EnumerateEdgesOrVertices ( System oEdgesOrVerticesToEnumerate, System.Boolean bAreEdges, IGraph oGraph, HashSet oUniqueImportedIDs ) : IEnumerable
oEdgesOrVerticesToEnumerate System
bAreEdges System.Boolean
oGraph IGraph
oUniqueImportedIDs HashSet
return IEnumerable

EnumerateGroupsForCountingVertexTerms() protected method

protected EnumerateGroupsForCountingVertexTerms ( IGraph oGraph ) : IEnumerable
oGraph IGraph
return IEnumerable

ShouldEnumerateEdgeOrVertex() protected method

protected ShouldEnumerateEdgeOrVertex ( IMetadataProvider oEdgeOrVertex, HashSet oUniqueImportedIDs ) : System.Boolean
oEdgeOrVertex IMetadataProvider
oUniqueImportedIDs HashSet
return System.Boolean

TryCalculateGraphMetrics() public method

public TryCalculateGraphMetrics ( IGraph graph, CalculateGraphMetricsContext calculateGraphMetricsContext, GraphMetricColumn &graphMetricColumns ) : System.Boolean
graph IGraph
calculateGraphMetricsContext CalculateGraphMetricsContext
graphMetricColumns GraphMetricColumn
return System.Boolean

TryCountEdgeTermsByGroup() protected method

protected TryCountEdgeTermsByGroup ( IGraph oGraph, WordMetricUserSettings oWordMetricUserSettings, WordCounter oWordCounter, WordPairCounter oWordPairCounter, HashSet oUniqueImportedIDs, GraphMetricColumn &oGraphMetricColumns ) : System.Boolean
oGraph IGraph
oWordMetricUserSettings WordMetricUserSettings
oWordCounter WordCounter
oWordPairCounter WordPairCounter
oUniqueImportedIDs HashSet
oGraphMetricColumns GraphMetricColumn
return System.Boolean

TryCountTermsNoGroups() protected method

protected TryCountTermsNoGroups ( IGraph oGraph, WordMetricUserSettings oWordMetricUserSettings, WordCounter oWordCounter, WordPairCounter oWordPairCounter, HashSet oUniqueImportedIDs, GraphMetricColumn &oGraphMetricColumns ) : System.Boolean
oGraph IGraph
oWordMetricUserSettings WordMetricUserSettings
oWordCounter WordCounter
oWordPairCounter WordPairCounter
oUniqueImportedIDs HashSet
oGraphMetricColumns GraphMetricColumn
return System.Boolean

TryCountVertexTermsByGroup() protected method

protected TryCountVertexTermsByGroup ( IGraph oGraph, WordMetricUserSettings oWordMetricUserSettings, WordCounter oWordCounter, WordPairCounter oWordPairCounter, HashSet oUniqueImportedIDs, GraphMetricColumn &oGraphMetricColumns ) : System.Boolean
oGraph IGraph
oWordMetricUserSettings WordMetricUserSettings
oWordCounter WordCounter
oWordPairCounter WordPairCounter
oUniqueImportedIDs HashSet
oGraphMetricColumns GraphMetricColumn
return System.Boolean

WordMetricCalculator2() public method

Initializes a new instance of the WordMetricCalculator2 class.
public WordMetricCalculator2 ( ) : System
return System