metreex-analysis.js
/**
 * Takes all selected treebanks and applies all of the selected metrics to them, recording the used metrics, treebanks, and results.
 */
Takes all selected treebanks and applies all of the selected metrics to them, recording the used metrics, treebanks, and results.
Takes all selected treebanks and applies all of the selected metrics to them recording the used metrics treebanks and results .
function applyMetrics(){
    if (loadedTreebanks.length === 0){
        output.println("No treebanks have been loaded, please load treebank(s) before applying metrics.");
        return;
    }
    if (USING_SIDEBAR) {
        selectedTreebanks = getCheckedTreebanks();
    }
    if (selectedTreebanks.length === 0){
        output.println("No treebanks were selected, please select at least one treebank");
        return;
    }
    var metricPartitions = getMetricPartitions();
    enabledMetrics = metricPartitions.checkedList;
    disabledMetrics = metricPartitions.uncheckedList;
    if (enabledMetrics.length === 0){
        output.println("No metrics were selected, please select at least one metric");
        return;
    }
    if (checkArrayEquals(selectedTreebanks, lastTreebanksUsed) && checkArrayEquals(enabledMetrics, lastMetricsUsed)){
        output.println("Selection of treebanks and metrics has not changed since the last metric application.");
        return;
    }
    lastMetricResults = [];
    selectedTreebanks.forEach(function(tree){
        output.println(tree.getTitle() + " - " + tree.id);
        lastMetricResults.push(tree.apply(enabledMetrics,{progress:output.getProgress()}));
    });
    lastMetricsUsed = enabledMetrics;
    lastTreebanksUsed = selectedTreebanks;
}
function applyMetrics ( ) { if ( loadedTreebanks . length === 0 ) { output . println ( "No treebanks have been loaded, please load treebank(s) before applying metrics." ) ; return ; } if ( USING_SIDEBAR ) { selectedTreebanks = getCheckedTreebanks ( ) ; } if ( selectedTreebanks . length === 0 ) { output . println ( "No treebanks were selected, please select at least one treebank" ) ; return ; } var metricPartitions = getMetricPartitions ( ) ; enabledMetrics = metricPartitions . checkedList ; disabledMetrics = metricPartitions . uncheckedList ; if ( enabledMetrics . length === 0 ) { output . println ( "No metrics were selected, please select at least one metric" ) ; return ; } if ( checkArrayEquals ( selectedTreebanks , lastTreebanksUsed ) && checkArrayEquals ( enabledMetrics , lastMetricsUsed ) ) { output . println ( "Selection of treebanks and metrics has not changed since the last metric application." ) ; return ; } lastMetricResults = [ ] ; selectedTreebanks . forEach ( function ( tree ) { output . println ( tree . getTitle ( ) + " - " + tree . id ) ; lastMetricResults . push ( tree . apply ( enabledMetrics , { progress : output . getProgress ( ) } ) ) ; } ) ; lastMetricsUsed = enabledMetrics ; lastTreebanksUsed = selectedTreebanks ; }
Takes all selected treebanks and applies all of the selected metrics to them, recording the used metrics, treebanks, and results.
Takes all selected treebanks and applies all of the selected metrics to them recording the used metrics treebanks and results .