<commit_before>#!/bin/sh
#
# libplayer statistics script - (c) 2008 <NAME>

ECHO=echo
[ -f /bin/echo ] && ECHO=/bin/echo

bargraph ()
{
  local PERCENT J I

  PERCENT=$1

  J=44
  I=$((PERCENT * J / 100))
  BARGRAPH=""
  while [ $J -ne 0 ]
  do
    if [ $I -ne 0 ]; then
      BARGRAPH="$BARGRAPH#"
      I=$((I - 1))
    else
      BARGRAPH="${BARGRAPH}."
    fi
    J=$((J - 1))
  done
}

varlist ()
{
  local VAR I PRE NEWLINE

  VAR=$1

  I=0
  NEWLINE=""
  PRE=""
  LIST=""
  for x in $VAR
  do
    I=$((I + 1))
    if [ "$I" = "6" ]; then
      LIST="$LIST$PRE$x"
      NEWLINE=",\n\t\t\t\t"
      PRE=""
      I=0
    else
      LIST="$LIST$NEWLINE$PRE$x"
      NEWLINE=""
      PRE=", "
    fi
  done
}

imp_functions ()
{
  local NAME TOTAL NB_NULL PERCENT I J BARGRAPH

  NAME=$1
  TOTAL=$2

  NB_OK=`grep -h -c "funcs->.*$NAME.*" $wrapper`
  NB_NULL=$((TOTAL - NB_OK))
  PERCENT=$((NB_OK * 100 / TOTAL))

  bargraph $PERCENT
  $ECHO -e "     $NAME\t: ($NB_OK)\t$PERCENT% \t[$BARGRAPH]"
}

sup_output ()
{<commit_msg>do not take into account functions that are natively not supported<commit_after>#!/bin/sh
#
# libplayer statistics script - (c) 2008 <NAME>

ECHO=echo
[ -f /bin/echo ] && ECHO=/bin/echo

bargraph ()
{
  local PERCENT J I

  PERCENT=$1

  J=44
  I=$((PERCENT * J / 100))
  BARGRAPH=""
  while [ $J -ne 0 ]
  do
    if [ $I -ne 0 ]; then
      BARGRAPH="$BARGRAPH#"
      I=$((I - 1))
    else
      BARGRAPH="${BARGRAPH}."
    fi
    J=$((J - 1))
  done
}

varlist ()
{
  local VAR I PRE NEWLINE

  VAR=$1

  I=0
  NEWLINE=""
  PRE=""
  LIST=""
  for x in $VAR
  do
    I=$((I + 1))
    if [ "$I" = "6" ]; then
      LIST="$LIST$PRE$x"
      NEWLINE=",\n\t\t\t\t"
      PRE=""
      I=0
    else
      LIST="$LIST$NEWLINE$PRE$x"
      NEWLINE=""
      PRE=", "
    fi
  done
}

imp_functions ()
{
  local NAME TOTAL NB_NULL PERCENT I J BARGRAPH

  NAME=$1
  TOTAL=$2

  NB_OK=`grep -h -c "funcs->.*$NAME.*" $wrapper`
  NB_NOT_SUPPORTED=`grep -h -c "funcs->.*PL_NOT_SUPPORTED.*" $wrapper`
  TOTAL=$((TOTAL - NB_NOT_SUPPORTED))
  NB_NULL=$((TOTAL - NB_OK))
  PERCENT=$((NB_OK * 100 / TOTAL))

  bargraph $PERCENT
  $ECHO -e "     $NAME\t: ($NB_OK)\t$PERCENT% \t[$BARGRAPH]"
}

sup_output ()
{
{'fraction_non_alphanumeric': 0.19268953068592057, 'fraction_numerical': 0.021660649819494584, 'mean_word_length': 2.2844444444444445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '1803448', 'n_tokens_mistral': 1096, 'n_tokens_neox': 966, 'n_words': 221}