lib/dictionary.js
function determineFreqCategories() {
    if (mean - sd < 0) {
      var lowrange = 0 + mean / 3;
    } else {
      var lowrange = mean - sd;
    }
    var midrange = [mean + sd, lowrange];
    var highrange = mean + sd;

    var i = 0;
    for (; i < potentialexamples.length; i++) {
      var word = potentialexamples[i][0];

      if ('undefined' != typeof wordfreq[word.simplified]) {
        pushFrequency(word);
      }
    }

    function pushFrequency(word) {
      if (wordfreq[word.simplified] < lowrange) {
        lowfreq.push(word);
      }
      if (
        wordfreq[word.simplified] >= midrange[1] &&
        wordfreq[word.simplified] < midrange[0]
      ) {
        midfreq.push(word);
      }
      if (wordfreq[word.simplified] >= highrange) {
        highfreq.push(word);
      }
    }
  }
function determineFreqCategories() {
    if (mean - sd < 0) {
      var lowrange = 0 + mean / 3;
    } else {
      var lowrange = mean - sd;
    }
    var midrange = [mean + sd, lowrange];
    var highrange = mean + sd;

    var i = 0;
    for (; i < potentialexamples.length; i++) {
      var word = potentialexamples[i][0];

      if ('undefined' != typeof wordfreq[word.simplified]) {
        pushFrequency(word);
      }
    }

    function pushFrequency(word) {
      if (wordfreq[word.simplified] < lowrange) {
        lowfreq.push(word);
      }
      if (
        wordfreq[word.simplified] >= midrange[1] &&
        wordfreq[word.simplified] < midrange[0]
      ) {
        midfreq.push(word);
      }
      if (wordfreq[word.simplified] >= highrange) {
        highfreq.push(word);
      }
    }
  }
function determineFreqCategories ( ) { if ( mean - sd < 0 ) { var lowrange = 0 + mean / 3 ; } else { var lowrange = mean - sd ; } var midrange = [ mean + sd , lowrange ] ; var highrange = mean + sd ; var i = 0 ; for ( ; i < potentialexamples . length ; i ++ ) { var word = potentialexamples [ i ] [ 0 ] ; if ( 'undefined' != typeof wordfreq [ word . simplified ] ) { pushFrequency ( word ) ; } } function pushFrequency ( word ) { if ( wordfreq [ word . simplified ] < lowrange ) { lowfreq . push ( word ) ; } if ( wordfreq [ word . simplified ] >= midrange [ 1 ] && wordfreq [ word . simplified ] < midrange [ 0 ] ) { midfreq . push ( word ) ; } if ( wordfreq [ word . simplified ] >= highrange ) { highfreq . push ( word ) ; } } }
Create frequency categories
Create frequency categories