edu.northwestern.at.wordhoard.swing.calculator.analysis
Class FindCollocates

java.lang.Object
  extended by edu.northwestern.at.wordhoard.swing.calculator.analysis.FrequencyAnalysisRunnerBase
      extended by edu.northwestern.at.wordhoard.swing.calculator.analysis.CollocateFrequencies
          extended by edu.northwestern.at.wordhoard.swing.calculator.analysis.FindCollocates
All Implemented Interfaces:
AnalysisRunner

public class FindCollocates
extends CollocateFrequencies
implements AnalysisRunner

Compares a single word form's frequency in a specified analysis text.


Field Summary
protected static int ANALYSISCOUNTCOLUMN
           
protected static int DICECOLUMN
           
protected static int LOGLIKECOLUMN
           
protected static int PHISQUAREDCOLUMN
           
protected static int SCPCOLUMN
           
protected static int SICOLUMN
           
protected static int SPANCOUNTCOLUMN
           
protected static int TEXTCOLUMN
          Output column indices.
protected static int WORDCLASSCOLUMN
           
 
Fields inherited from class edu.northwestern.at.wordhoard.swing.calculator.analysis.FrequencyAnalysisRunnerBase
adjustChiSquareForMultipleComparisons, analysisText, analysisTextBreakdownBy, analyzePhraseFrequencies, associationMeasure, blankReplacementCharacter, collocationOccurrenceMap, colorCodeOveruseColumn, compressValueRangeInTagClouds, contextButton, cutoff, displayProgress, filterBigramsByWordClass, filterMultiwordUnitsContainingVerbs, filterOutProperNames, filterSingleOccurrences, filterTrigramsByWordClass, filterUsingLocalMaxs, FONT_SIZE, frequencyAnalysisType, frequencyNormalizationMethod, FrequencyProfileResults, ignoreCaseAndDiacriticalMarks, leftSpan, markSignificantLogLikelihoodValues, maximumMultiwordUnitLength, minimumCount, minimumMultiwordUnitLength, minimumWorkCount, model, percentReportMethod, pluralWordFormString, progressReporter, referenceText, referenceTextBreakdownBy, resultsPanel, resultsScrollPane, resultsTable, rightSpan, roundNormalizedFrequencies, showPhraseFrequencies, showWordClasses, tableSelectionListener, useShortWorkTitlesInDialogs, useShortWorkTitlesInHeaders, useShortWorkTitlesInOutput, useShortWorkTitlesInWindowTitles, wordForm, wordFormString, wordOccs, wordToAnalyze
 
Constructor Summary
FindCollocates()
          Create a single word form frequency profile object.
 
Method Summary
 boolean areResultOptionsAvailable()
          Are result options available?
protected  void doFreq(java.lang.String collocate, int analysisCount, int analysisTotalCount, int refCount, int refTotalCount, WordHoardSortedTableModel model)
          Perform frequency comparison of analysis and reference works for a word.
protected  ResultsPanel generateResults(WordHoardSortedTableModel model, java.lang.String maxLabel, int spanCount, int totalSpanCount, int refDistinctCount, int refTotalCount)
          Displays results of frequency analysis in a sorted table.
 ResultsPanel getCloud()
          Show tag cloud of association measure values.
 ResultsPanel getContext(javax.swing.JFrame parentWindow, ProgressReporter progressReporter)
          Generate context results for selected collocate.
 LabeledColumn getResultOptions()
          Return result options.
 boolean isCloudAvailable()
          Is cloud output available?
 boolean isContextAvailable()
          Is context output available?
protected  void openWorkPartForContext(XTable table, int clickedRow)
          Open work part for selected collocate context.
 void runAnalysis(javax.swing.JFrame parentWindow, ProgressReporter progressReporter)
          Run an analysis.
 
Methods inherited from class edu.northwestern.at.wordhoard.swing.calculator.analysis.CollocateFrequencies
generateResults, getCollocateCounts
 
Methods inherited from class edu.northwestern.at.wordhoard.swing.calculator.analysis.FrequencyAnalysisRunnerBase
closeProgressReporter, createCloudAssociationMeasuresComboBox, createCompressValueRangeInTagCloudsCheckBox, generateResults, getAnalysisPercentColumnName, getChart, getCloud, getColTitleWordFormString, getDoubleFormat, getPercentReportMethodFormat, getReferencePercentColumnName, getResults, getTableFontSize, getTitle, handleTableSelectionChange, isCancelled, isChartAvailable, isFilterAvailable, saveChart, setContextButton, showDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.northwestern.at.wordhoard.swing.calculator.analysis.AnalysisRunner
getChart, getResults, handleTableSelectionChange, isChartAvailable, isFilterAvailable, saveChart, setContextButton, showDialog
 

Field Detail

TEXTCOLUMN

protected static final int TEXTCOLUMN
Output column indices.

See Also:
Constant Field Values

WORDCLASSCOLUMN

protected static final int WORDCLASSCOLUMN
See Also:
Constant Field Values

SPANCOUNTCOLUMN

protected static final int SPANCOUNTCOLUMN
See Also:
Constant Field Values

ANALYSISCOUNTCOLUMN

protected static final int ANALYSISCOUNTCOLUMN
See Also:
Constant Field Values

DICECOLUMN

protected static final int DICECOLUMN
See Also:
Constant Field Values

LOGLIKECOLUMN

protected static final int LOGLIKECOLUMN
See Also:
Constant Field Values

PHISQUAREDCOLUMN

protected static final int PHISQUAREDCOLUMN
See Also:
Constant Field Values

SICOLUMN

protected static final int SICOLUMN
See Also:
Constant Field Values

SCPCOLUMN

protected static final int SCPCOLUMN
See Also:
Constant Field Values
Constructor Detail

FindCollocates

public FindCollocates()
Create a single word form frequency profile object.

Method Detail

runAnalysis

public void runAnalysis(javax.swing.JFrame parentWindow,
                        ProgressReporter progressReporter)
Run an analysis.

Specified by:
runAnalysis in interface AnalysisRunner
Overrides:
runAnalysis in class CollocateFrequencies
Parameters:
parentWindow - Parent window for display.
progressReporter - Progress reporter. May be null.

doFreq

protected void doFreq(java.lang.String collocate,
                      int analysisCount,
                      int analysisTotalCount,
                      int refCount,
                      int refTotalCount,
                      WordHoardSortedTableModel model)
Perform frequency comparison of analysis and reference works for a word.

Parameters:
collocate - The collocate to analyze.
analysisCount - Count of collocate in analysis text.
analysisTotalCount - Total number of words in analysis text.
refCount - Count of collocate in reference text.
refTotalCount - Total number of words in reference text.
model - Table model in which to store results.

generateResults

protected ResultsPanel generateResults(WordHoardSortedTableModel model,
                                       java.lang.String maxLabel,
                                       int spanCount,
                                       int totalSpanCount,
                                       int refDistinctCount,
                                       int refTotalCount)
Displays results of frequency analysis in a sorted table.

Parameters:
model - Table model holding data to display.
maxLabel - Maximum width value for first table column.
spanCount - # of times word to collocate occurs in span.
totalSpanCount - # of words in collocation span. Includes count of word being collocated.
refDistinctCount - # of distinct words in analysis text.
refTotalCount - # of words in analysis text.
Returns:
ResultsPanel with table and title.

isContextAvailable

public boolean isContextAvailable()
Is context output available?

Specified by:
isContextAvailable in interface AnalysisRunner
Overrides:
isContextAvailable in class FrequencyAnalysisRunnerBase
Returns:
true since context output is available for collocation.

getContext

public ResultsPanel getContext(javax.swing.JFrame parentWindow,
                               ProgressReporter progressReporter)
Generate context results for selected collocate.

Specified by:
getContext in interface AnalysisRunner
Overrides:
getContext in class FrequencyAnalysisRunnerBase
Parameters:
parentWindow - Parent window for display.
progressReporter - Progress reporter. May be null.
Returns:
ResultsPanel containing the context results.

openWorkPartForContext

protected void openWorkPartForContext(XTable table,
                                      int clickedRow)
Open work part for selected collocate context.

Parameters:
table - The table holding context text.
clickedRow - The table row for which the corresponding work part is desired.

areResultOptionsAvailable

public boolean areResultOptionsAvailable()
Are result options available?

Specified by:
areResultOptionsAvailable in interface AnalysisRunner
Overrides:
areResultOptionsAvailable in class FrequencyAnalysisRunnerBase
Returns:
true if result options are available, false otherwise.

getResultOptions

public LabeledColumn getResultOptions()
Return result options.

Specified by:
getResultOptions in interface AnalysisRunner
Overrides:
getResultOptions in class FrequencyAnalysisRunnerBase
Returns:
Result options in a LabeledColumn.

isCloudAvailable

public boolean isCloudAvailable()
Is cloud output available?

Specified by:
isCloudAvailable in interface AnalysisRunner
Overrides:
isCloudAvailable in class FrequencyAnalysisRunnerBase
Returns:
true if cloud output available, false otherwise.

getCloud

public ResultsPanel getCloud()
Show tag cloud of association measure values.

Specified by:
getCloud in interface AnalysisRunner
Overrides:
getCloud in class FrequencyAnalysisRunnerBase
Returns:
ResultsPanel containing the cloud.