<commit_before>var infer = require('tern/lib/infer');
var tern = require('tern/lib/tern');
var path = require('path');
var minimatch = require('minimatch');
var fs = require('fs');

var TERN_ROOT = '../node_modules/tern';
var TernServer;

module.exports = TernServer = function () {

  process.__tern = tern;
  process.__infer = infer;
};

TernServer.prototype.importPlugins = function (plugins) {

  for (var i = 0; i < plugins.length; i++) {

    var mod = require(plugins[i]);
    if (mod.hasOwnProperty('initialize')) {

      mod.initialize(TERN_ROOT);
    }
  }
};

TernServer.prototype.startServer = function (data) {

  this.importPlugins(data.config.pluginImports);<commit_msg>3-rd party tern modules got incorrect tern directory<commit_after>var infer = require('tern/lib/infer');
var tern = require('tern/lib/tern');
var path = require('path');
var minimatch = require('minimatch');
var fs = require('fs');

var TERN_ROOT = path.resolve(__dirname,'../node_modules/tern');
var TernServer;

module.exports = TernServer = function () {

  process.__tern = tern;
  process.__infer = infer;
};

TernServer.prototype.importPlugins = function (plugins) {

  for (var i = 0; i < plugins.length; i++) {

    var mod = require(plugins[i]);
    if (mod.hasOwnProperty('initialize')) {

      mod.initialize(TERN_ROOT);
    }
  }
};

TernServer.prototype.startServer = function (data) {

  this.importPlugins(data.config.pluginImports);
{'fraction_non_alphanumeric': 0.156794425087108, 'fraction_numerical': 0.0020905923344947735, 'mean_word_length': 4.358208955223881, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4647101', 'n_tokens_mistral': 474, 'n_tokens_neox': 453, 'n_words': 100}