<commit_before><?php

function Ratings($idGauchada){
  $db = new Connection();
  $where = 'idGauchada='.$idGauchada;
  $data = $db->select('*', 'Ratings', $where);

  return (!$data) ? true : false;
}

?><commit_msg>Se agregaron funciones de rating<commit_after><?php

function Ratings($idGauchada) {
  $db = new Connection();
  $where = 'idGauchada='.$idGauchada;
  $data = $db->select('*', 'Ratings', $where);

  return (!$data) ? true : false;
}

function Rating($idGauchada) {
  $db = new Connection();
  $data = $db->select('r.body, g.title, r.rating', 'Ratings r INNER JOIN Gauchadas g ON(r.idGauchada=g.idGauchada)', "r.idGauchada=$idGauchada");
  if (!$data) return false;

  $rating = array(
    'body' => $data[0]['body'],
    'title' => $data[0]['title']
  );
  switch ($data[0]['rating']) {
    case '1':
      $rating['rating'] = 'Mal';
      $rating['color'] = '-danger';
      break;
    case '2':
      $rating['rating'] = 'Neutral';
      $rating['color'] = '-info';
      break;
    case '3':
      $rating['rating'] = 'Bien';
      $rating['color'] = '-success';
      break;
  }
  return $rating;
}

?>
{'fraction_non_alphanumeric': 0.22281639928698752, 'fraction_numerical': 0.0053475935828877, 'mean_word_length': 3.565040650406504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '6514795', 'n_tokens_mistral': 424, 'n_tokens_neox': 419, 'n_words': 88}