<commit_before>var tokenizer = require("./tokenizer");
var chalk = require("chalk");

module.exports = function (githubTicket, cb) {
  console.log(chalk.blue(("=== Github Ticket # "+ githubTicket.number)));
  var ticketBody = githubTicket.body;
  var tokenizedMeta = tokenizer(ticketBody);

  // Make sure keys in parsedRowData object match spreadsheet column names.
  // Note that 'id' seems to be a reserved key by Google Sheet so remember to
  // not use 'id' as your key.

  var space = "";
  var pathwayArray = [];

  githubTicket.labels.forEach(function(label) {
    var labelName = label.name;
    var spacelabelPrefix =  "[Space] ";
    var mozExLabel = "[Experience] Moz Ex";
    var pathwaylabelPrefix =  "[Pathway] ";

    if (labelName.substr(0,spacelabelPrefix.length) === spacelabelPrefix) {
      // regular Spaces
      space = labelName.substr(spacelabelPrefix.length);
      if (space === "A tale of two cities: dilemmas in connected spaces") {
        space = "Dilemmas in connected spaces";
      }
    } else if (labelName === mozExLabel) {
      // MozEx
      space = "MozEx";
    }

    if (labelName.substr(0,pathwaylabelPrefix.length) === pathwaylabelPrefix) {
      pathwayArray.push[labelName.substr(pathwaylabelPrefix.length)];
    }
  })

  var parsedRowData = {
    "session id": githubTicket.number,
    name: githubTicket.title,
    space: space,
    pathways: pathwayArray.join(", "),
    description: tokenizedMeta.Description ? tokenizedMeta.Description.filter(function(v) { return !!v; }).join("\n") : "",
    "facilitator 1 name": tokenizedMeta.submitterName,<commit_msg>Fixes #15 - parsed pathway info<commit_after>var tokenizer = require("./tokenizer");
var chalk = require("chalk");

module.exports = function (githubTicket, cb) {
  console.log(chalk.blue(("=== Github Ticket # "+ githubTicket.number)));
  var ticketBody = githubTicket.body;
  var tokenizedMeta = tokenizer(ticketBody);

  // Make sure keys in parsedRowData object match spreadsheet column names.
  // Note that 'id' seems to be a reserved key by Google Sheet so remember to
  // not use 'id' as your key.

  var space = "";
  var pathwayArray = [];

  githubTicket.labels.forEach(function(label) {
    var labelName = label.name;
    var spacelabelPrefix =  "[Space] ";
    var mozExLabel = "[Experience] Moz Ex";
    var pathwaylabelPrefix =  "[Pathway] ";

    if (labelName.substr(0,spacelabelPrefix.length) === spacelabelPrefix) {
      // regular Spaces
      space = labelName.substr(spacelabelPrefix.length);
      if (space === "A tale of two cities: dilemmas in connected spaces") {
        space = "Dilemmas in connected spaces";
      }
    } else if (labelName === mozExLabel) {
      // MozEx
      space = "MozEx";
    }

    if (labelName.substr(0,pathwaylabelPrefix.length) === pathwaylabelPrefix) {
      pathwayArray.push( labelName.substr(pathwaylabelPrefix.length) );
    }
  })

  var parsedRowData = {
    "session id": githubTicket.number,
    name: githubTicket.title,
    space: space,
    pathways: pathwayArray.join(", "),
    description: tokenizedMeta.Description ? tokenizedMeta.Description.filter(function(v) { return !!v; }).join("\n") : "",
    "facilitator 1 name": tokenizedMeta.submitterName,
{'fraction_non_alphanumeric': 0.13156269302038295, 'fraction_numerical': 0.0024706609017912293, 'mean_word_length': 3.5427769985974753, 'pattern_counts': {'":': 4, '<': 3, '<?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': '5771832', 'n_tokens_mistral': 1032, 'n_tokens_neox': 978, 'n_words': 254}