<commit_before><?php

namespace DataSift\Storyplayer\PlayerLib;

use RuntimeException;
use DataSift\Stone\ConfigLib\JsonConfigLoader;
use DataSift\Stone\LogLib\Log;

class StoryConfigLoader extends JsonConfigLoader
{
	public function __construct()
	{
		parent::__construct("storyteller", realpath(__DIR__ . '/../../../../'));
	}
}<commit_msg>New: detect if we are running from a git clone or after central installation<commit_after><?php

namespace DataSift\Storyplayer\PlayerLib;

use RuntimeException;
use DataSift\Stone\ConfigLib\JsonConfigLoader;
use DataSift\Stone\LogLib\Log;

class StoryConfigLoader extends JsonConfigLoader
{
	public function __construct()
	{
		// are we installed globally?
		if ('@@BIN_DIR@@' != '@@BIN_DIR@@') {
			// yes, we are
			parent::__construct("storyplayer", getcwd());
		}
		else {
			// we are running from the github repo clone
			parent::__construct("storyplayer", realpath(__DIR__ . '/../../../../../'));
		}
	}
}
{'fraction_non_alphanumeric': 0.14659685863874344, 'fraction_numerical': 0.0, 'mean_word_length': 4.370786516853933, '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': '5136719', 'n_tokens_mistral': 314, 'n_tokens_neox': 292, 'n_words': 70}