<commit_before>#!/bin/bash
#
# Script to borrow essential bits from another lodspeakr.
# Desired when lodspeakr essentials are maintained in a project-specfic repository.
# Contributed by <NAME> when trying to apply lodspeakr for DataFAQs.

if [ $# -lt 1 ]; then
   echo "usage: `basename $0` other-lodspeakr-directory"
   exit 1 
fi

if [ ! -d $otherDir ]; then
   echo "$otherDir does not exist."
   exit 1
fi

if [[ ! -e settings.inc.php && -e $otherDir/settings.inc.php ]]; then
   echo ln -s $otherDir/settings.inc.phpl settings.inc.php
   ln -s $otherDir/settings.inc.phpl settings.inc.php
else
   echo "WARNING: not linking settings.inc.phpl because it exists."
fi

if [[ ! -e .htaccess && -e $otherDir/.htaccess ]]; then
   echo ln -s $otherDir/models models
   ln -s $otherDir/models models
else
   echo "WARNING: not linking models/ because it exists."
fi

if [[ ! -e models && -e $otherDir/models ]]; then
   echo ln -s $otherDir/models models
   ln -s $otherDir/models models
else
   echo "WARNING: not linking models/ because it exists."
fi

if [[ ! -e views && -e $otherDir/views ]]; then
   echo ln -s $otherDir/views views
   ln -s $otherDir/views views
else
   echo "WARNING: not linking views/ because it exists."
fi<commit_msg>cleaned up linker<commit_after>#!/bin/bash
#
# Script to borrow essential bits ;rom another lodspeakr instance on local machine.
# Desired when lodspeakr essentials are maintained in a project-specfic repository.
# Contributed by <NAME> when trying to apply lodspeakr for DataFAQs.
#
# Usage:
#  bash-3.2$ pwd
#  /Applications/XAMPP/htdocs/hello/lodspeakr
#
#  bash-3.2$ sudo rm -rf .htaccess settings.inc.php models views
#
#  bash-3.2$ sudo /Users/lebo/projects/lodspeakr/github/lodspeakr/utils/link-components.sh /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr
#  ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/settings.inc.php settings.inc.php
#  ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/.htaccess .htaccess
#  ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/models models
#  ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/views views
#
#  bash-3.2$ sudo /Users/lebo/projects/lodspeakr/github/lodspeakr/utils/link-components.sh /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr
#  WARNING: not linking settings.inc.php because it exists.
#  WARNING: not linking .htaccess because it exists.
#  WARNING: not linking models because it exists.
#  WARNING: not linking views because it exists.

if [ $# -lt 1 ]; then
   echo "usage: `basename $0` other-lodspeakr-directory"
   exit 1 
fi

otherDir="$1"
if [[ ! -d $otherDir && "$otherDir" != "/" ]]; then
   echo "$otherDir does not exist."
   exit 1
fi

for essential in settings.inc.php .htaccess models views; do
   if [[ ! -e $essential && -e $otherDir/$essential ]]; then
      echo ln -s $otherDir/$essential $essential
      ln -s $otherDir/$essential
   else
      echo "WARNING: not linking $essential because it exists."
   fi
done
{'fraction_non_alphanumeric': 0.12236421725239617, 'fraction_numerical': 0.005431309904153354, 'mean_word_length': 3.5708029197080293, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '629747', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1084, 'n_words': 310}