<commit_before>
Dependency.add('browserService', (function browserService() {
  var s = {};
  var data = {
    path: new ReactiveVar([]),
    selected: new ReactiveVar()
  };

  s.init = function(root) {
    var node = root;
    data.path.set([node]);
    data.selected.set(node);
  };

  s.forward = function(node) {
    if (node.type === 'T') {
      var path = data.path.get();
      path.push(node);
      data.path.set(path);
      data.selected.set(node);
    }
  };

  s.back = function() {
    var path = data.path.get();
    path.pop();
    data.path.set(path);
    data.selected.set(s.root());
  };

  s.select = function(node) {
    var temp = node;
    data.selected.set(temp);
  };

  s.selected = function() {
    return data.selected.get();
  };

  s.root = function() {
    var path = data.path.get();
    return path[path.length-1];
  };

  s.parent = function() {
    var path = data.path.get();
    if (path.length > 1) {
      return path[path.length-2];
    }

    return null;
  };

  s.path = function() {
    return data.path.get();
  };

  return s;
})());<commit_msg>Browser service update<commit_after>
var editorService;

Dependency.autorun(function() {
  editorService = Dependency.get('editorService');
});

Dependency.add('browserService', (function browserService() {
  var s = {};

  var data = {
    path: new ReactiveVar([])
  };

  /**
   * @summary Initialize browser service
   * @method init
   * @param {Object} [root] Root node (competency)
   */
  s.init = function(root) {
    data.path.set([root]);
  };

  /**
   * @summary Set the next level of competency hierarchy
   * @method forward
   * @param {Object} [node] Topic node
   */
  s.forward = function(node) {
    if (node.type === 'T') {
      var path = data.path.get();
      path.push(node);
      data.path.set(path);
      editorService.context.select(node);
    }
  };

  /**
   * @summary Go to the previous level of competency hierarchy
   * @method back
   */
  s.back = function() {
    var path = data.path.get();
    path.pop();
    data.path.set(path);
    editorService.context.select(s.root());
  };

  /**
   * @summary Get root node of browser context
   * @method root
   * @return {Object}
   */
  s.root = function() {
    var path = data.path.get();
    return path[path.length-1];
  };

  /**
   * @summary Retrieve root node parent
   * @method parent
   * @return {Object}
   */
  s.parent = function() {
    var path = data.path.get();
    if (path.length > 1) {
      return path[path.length-2];
    }

    return null;
  };

  /**
   * @summary Get browser path
   * @method path
   * @return {Array}
   */
  s.path = function() {
    return data.path.get();
  };

  return s;
})());
{'fraction_non_alphanumeric': 0.17306273062730626, 'fraction_numerical': 0.002214022140221402, 'mean_word_length': 2.4359949302915083, 'pattern_counts': {'":': 0, '<': 3, '<?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': '800572', 'n_tokens_mistral': 939, 'n_tokens_neox': 916, 'n_words': 206}