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

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

public class TrackWordOverTime
extends FrequencyAnalysisRunnerBase
implements AnalysisRunner

Generates a longitudinal profile of a word form's frequency of use.


Field Summary
protected  BarChartPanel barChartPanel
          Chart panel.
protected static int FREQCOLUMN
          Normalized frequency column.
protected  ResultsPanel mainResultsPanel
          Main results panel.
 
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
TrackWordOverTime()
          Create a single word form historical frequency profile object.
 
Method Summary
protected  boolean analyzeOneYear(int yearWordCount, int yearTotalCount, int year, int worksThisYear, int refTotalCount, int worksInRef, WordHoardSortedTableModel model, ProgressReporter progressReporter)
          Analyze a single year.
protected  void doFreq(Spelling wordToAnalyze, int year, int worksThisYear, int worksInRef, int yearWordCount, int yearTotalCount, int refWorksTotalCount, WordHoardSortedTableModel model)
          Perform frequency comparison of year counts for all works in a corpus.
protected  ResultsPanel generateEmptyResults(java.lang.String title, java.lang.String shortTitle, java.lang.String extraText)
          Generate results when publication dates available.
protected  ResultsPanel generateResults(WordHoardSortedTableModel model)
          Displays results of frequency analysis in a sorted table.
 ResultsPanel getChart()
          Show bar chart of historical frequency profile.
 boolean isChartAvailable()
          Is chart output available?
 void runAnalysis(javax.swing.JFrame parentWindow, ProgressReporter progressReporter)
          Run an analysis.
 void saveChart()
          Saves chart.
 
Methods inherited from class edu.northwestern.at.wordhoard.swing.calculator.analysis.FrequencyAnalysisRunnerBase
areResultOptionsAvailable, closeProgressReporter, createCloudAssociationMeasuresComboBox, createCompressValueRangeInTagCloudsCheckBox, generateResults, getAnalysisPercentColumnName, getCloud, getCloud, getColTitleWordFormString, getContext, getDoubleFormat, getPercentReportMethodFormat, getReferencePercentColumnName, getResultOptions, getResults, getTableFontSize, getTitle, handleTableSelectionChange, isCancelled, isCloudAvailable, isContextAvailable, isFilterAvailable, 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
areResultOptionsAvailable, getCloud, getContext, getResultOptions, getResults, handleTableSelectionChange, isCloudAvailable, isContextAvailable, isFilterAvailable, setContextButton, showDialog
 

Field Detail

FREQCOLUMN

protected static final int FREQCOLUMN
Normalized frequency column.

See Also:
Constant Field Values

barChartPanel

protected BarChartPanel barChartPanel
Chart panel.


mainResultsPanel

protected ResultsPanel mainResultsPanel
Main results panel.

Constructor Detail

TrackWordOverTime

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

Method Detail

analyzeOneYear

protected boolean analyzeOneYear(int yearWordCount,
                                 int yearTotalCount,
                                 int year,
                                 int worksThisYear,
                                 int refTotalCount,
                                 int worksInRef,
                                 WordHoardSortedTableModel model,
                                 ProgressReporter progressReporter)
Analyze a single year.

Parameters:
yearWordCount - Count of work to analyze in this year.
yearTotalCount - Total number of words in this year.
year - The year.
worksThisYear - The number of works in this year.
refTotalCount - The count of words in the reference corpus.
worksInRef - The number of works in the reference corpus.
model - Table model holding results.
progressReporter - The progress dialog.
Returns:
true if analysis successful.

runAnalysis

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

Specified by:
runAnalysis in interface AnalysisRunner
Overrides:
runAnalysis in class FrequencyAnalysisRunnerBase
Parameters:
parentWindow - Parent window for dialogs in the analysis.
progressReporter - Progress display for analysis.

doFreq

protected void doFreq(Spelling wordToAnalyze,
                      int year,
                      int worksThisYear,
                      int worksInRef,
                      int yearWordCount,
                      int yearTotalCount,
                      int refWorksTotalCount,
                      WordHoardSortedTableModel model)
Perform frequency comparison of year counts for all works in a corpus.

Parameters:
wordToAnalyze - The word to analyze.
year - The year being analyzed.
worksThisYear - Number of works in this year.
worksInRef - Total number of works for all years.
yearWordCount - Count of word in texts for year.
yearTotalCount - Total number of words in texts for year.
refWorksTotalCount - Total number of words in reference corpus.
model - Table model in which to store results.

Computes the following quantities for display for one year.

  1. Number of works in the year.
  2. Raw word count for selected word across all works for the year.
  3. Total word counts for all words in the year.
  4. Average selected word counts for the year = (1) / (2)
  5. Normalized word counts for the year. Values depends upon the normalization method selected in the historical frequency profile dialog.

generateResults

protected ResultsPanel generateResults(WordHoardSortedTableModel model)
Displays results of frequency analysis in a sorted table.

Parameters:
model - Table model containing results.

generateEmptyResults

protected ResultsPanel generateEmptyResults(java.lang.String title,
                                            java.lang.String shortTitle,
                                            java.lang.String extraText)
Generate results when publication dates available.

Returns:
results panel.

getChart

public ResultsPanel getChart()
Show bar chart of historical frequency profile.

Specified by:
getChart in interface AnalysisRunner
Overrides:
getChart in class FrequencyAnalysisRunnerBase
Returns:
ResultsPanel containing the chart.

isChartAvailable

public boolean isChartAvailable()
Is chart output available?

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

saveChart

public void saveChart()
Saves chart.

Specified by:
saveChart in interface AnalysisRunner
Overrides:
saveChart in class FrequencyAnalysisRunnerBase