<commit_before>
function Snort (conn) {

  // regexs
  var regex = {

    id: /\[\*\*\] \[([0-9]+:[0-9]+:[0-9]+)\] ([A-Za-z\- \/]+) \[\*\*\]/
  };

  // contents for the next sql statement
  var currentStatement;

  // functions
  this.process = process;


  // process some input
  function process (input) {
    var lines = input.split('\n');
    var i;
    resetStatement();
    for (i = 0; i < lines.length; i++) {
      processLine(lines[i]);
    }
  }

  // process a single line
  function processLine (line) {
    if (isNewline(line)) {
      executeStatement();
      return;
    }
    matchIDLine(line);
  }

  // checks if a line is a newline
  function isNewline (line) {
    return line == '';
  }

  // resets the current statement
  function resetStatement () {
    currentStatement = {
      id: "",
      desc: "",
      classification: "",
      priority: "",
      ttl: "",
      src: "",
      dest: ""
    };
  }

  // executes the pending statement
  function executeStatement () {
    console.log(currentStatement);
    resetStatement();
  }

  // checks the line for an event ID
  // and a classification
  function matchIDLine (line) {
    var match = regex.id.exec(line);
    if (match) {
      currentStatement.id = match[1];
      currentStatement.desc = match[2];
    }
  }

  // 
}

module.exports = Snort;<commit_msg>capturing classification<commit_after>
function Snort (conn) {

  // regexs
  var regex = {
    id: /\[\*\*\] \[([0-9]+:[0-9]+:[0-9]+)\] ([A-Za-z\- \/]+) \[\*\*\]/,
    classification: /\[Classification: ([A-Za-z ]+)\] \[Priority: ([0-9]+)\]/
  };

  // contents for the next sql statement
  var currentStatement;

  // functions
  this.process = process;


  // process some input
  function process (input) {
    var lines = input.split('\n');
    var i;
    resetStatement();
    for (i = 0; i < lines.length; i++) {
      processLine(lines[i]);
    }
  }

  // process a single line
  function processLine (line) {
    if (isNewline(line)) {
      executeStatement();
      return;
    }
    matchIDLine(line);
    matchClassificationPriority(line);
  }

  // checks if a line is a newline
  function isNewline (line) {
    return line == '';
  }

  // resets the current statement
  function resetStatement () {
    currentStatement = {
      id: "",
      desc: "",
      classification: "",
      priority: "",
      ttl: "",
      src: "",
      dest: ""
    };
  }

  // executes the pending statement
  function executeStatement () {
    console.log(currentStatement);
    resetStatement();
  }

  // checks the line for an event ID
  // and a description
  function matchIDLine (line) {
    var match = regex.id.exec(line);
    if (match) {
      currentStatement.id = match[1];
      currentStatement.desc = match[2];
    }
  }

  // checks the line for a classification & priority
  function matchClassificationPriority (line) {
    var match = regex.classification.exec(line);
    if (match) {
      currentStatement.classification = match[1];
      currentStatement.priority = match[2];
    }
  }
}

module.exports = Snort;
{'fraction_non_alphanumeric': 0.15910563836681788, 'fraction_numerical': 0.007128969539857421, 'mean_word_length': 2.2805526036131774, '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': '6280929', 'n_tokens_mistral': 1011, 'n_tokens_neox': 963, 'n_words': 245}