<commit_before>/*
 * getCommand(command, callback)
 * 
 * pass a Bash command to getCommand, and receive
 * the main parts of the relevant man page!
 *
 * © 2017 Team Pengo
 *
 * Authors: <NAME>,
 *          <NAME>,
 *          <NAME>,
 *          <NAME> 
*/


const request = require('request'),
      cheerio = require('cheerio'),
      baseURL = 'http://man.he.net/man1/';

// get the command text from the URL
var fetchCommand = function(command, callback) {
  var mainURL = baseURL + command;
  request(mainURL, function(error, response, html) {
    if (error) callback(error);
    var $ = cheerio.load(html);
    callback(null, $('pre').html());
  });
}

module.exports = function(command, callback) {
  fetchCommand(command, function(error, man) {
    if (error) callback(error);

    var commandArray = man.split('\n'),
        toc          = [],
        sections     = [];

    // create TOC numbers
    commandArray.forEach(function(element, index) {<commit_msg>Update getCommand.js<commit_after>/*
 * getCommand(command, callback)
 * 
 * pass a Bash command to getCommand, and receive
 * the main parts of the relevant man page!
 *
 * © 2017 Team Pengo
 *
 * Authors: <NAME>,
 *          <NAME>,
 *          <NAME>,
 *          <NAME> 
*/


const request = require('request'),
      cheerio = require('cheerio'),
      baseURL = 'http://man.he.net/man1/';

// get the command text from the URL
var fetchCommand = function(command, callback) {
  var mainURL = baseURL + command;
  request(mainURL, function(error, response, html) {
    if (error) callback(error);
    var $ = cheerio.load(html);
    callback(null, $('pre').html());
  });
}

module.exports = function(command, callback) {
  fetchCommand(command, function(error, man) {
    if (error) callback(error);

    var commandArray = man.split('\n'),
        toc          = [],
        sections     = [];

    // create TOC numbers
    commandArray.forEach(function(element, index) {
{'fraction_non_alphanumeric': 0.14812916453100974, 'fraction_numerical': 0.005125576627370579, 'mean_word_length': 2.8050682261208575, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6110740', 'n_tokens_mistral': 607, 'n_tokens_neox': 586, 'n_words': 161}