<commit_before>/*
 * MIT License
 * (c) 2013 <EMAIL>
 *
*/

var exec = require('cordova/exec');

/**
 * record a GPSTrack to sdcard
 */

var GPSTrack = function() {
  this.onlocationupdate = null;
};


/**
 * record a track
 *
 * @param {String} track       Destination file
 * @param {Float} precision    minimum precision of location (horizontal)
 * @param {Boolean} adaptiveRecording    switch recording interval based on ground speed
 */
GPSTrack.prototype.record = function(track, precision, adaptiveRecording, succ, err) {
  var self = this;
  var win = function(result) {
    if (result.location) {
      if (self.onlocationupdate) {
        self.onlocationupdate(result);
      }
    } else if (succ) {
      succ(result);
    }
  };
  exec(win, err, "GPSTrack", "record", [track, precision, adaptiveRecording]);
};

/**
 * subscribe to a track running recording
 *
 */
GPSTrack.prototype.listen = function(succ, err) {
  var self = this;
  var win = function(result) {
    if (result.location) {
      if (self.onlocationupdate) {
        self.onlocationupdate(result);
      }
    } else if (succ) {
      succ(result);
    }
  };
  exec(win, err, "GPSTrack", "listen", []);
};


module.exports = GPSTrack;

<commit_msg>update docs<commit_after>/*
 * MIT License
 * (c) 2013 <EMAIL>
 *
*/

var exec = require('cordova/exec');

/**
 * record a GPSTrack to sdcard
 */

var GPSTrack = function() {
  this.onlocationupdate = null;
};


/**
 * record a track
 *
 * @param {String} track       Destination file
 * @param {double} precision    minimum precision of location (horizontal)
 * @param {Boolean} adaptiveRecording    switch recording interval based on ground speed
 * @param {function} succ   success callback function
 * @param {function} err    error callback function
 */
GPSTrack.prototype.record = function(track, precision, adaptiveRecording, succ, err) {
  var self = this;
  var win = function(result) {
    if (result.location) {
      if (self.onlocationupdate) {
        self.onlocationupdate(result);
      }
    } else if (succ) {
      succ(result);
    }
  };
  exec(win, err, "GPSTrack", "record", [track, precision, adaptiveRecording]);
};

/**
 * subscribe to a track running recording
 *
 */
GPSTrack.prototype.listen = function(succ, err) {
  var self = this;
  var win = function(result) {
    if (result.location) {
      if (self.onlocationupdate) {
        self.onlocationupdate(result);
      }
    } else if (succ) {
      succ(result);
    }
  };
  exec(win, err, "GPSTrack", "listen", []);
};


module.exports = GPSTrack;


{'fraction_non_alphanumeric': 0.13879142300194933, 'fraction_numerical': 0.0031189083820662767, 'mean_word_length': 3.0665610142630744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6765805', 'n_tokens_mistral': 847, 'n_tokens_neox': 804, 'n_words': 219}