<commit_before><?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Language-map library.
 * Provides key-based lookup mechanism for translation strings.
 *
 * @todo Junk ALL of this in favour of a sane translation component [ST 2013/03/18]
 */
class LanguageMap
{
    /**
     * @var string
     */
    const I18N_FILE_BASE_NAME = 'application/language/ilios_strings_';

    /**
     * @var string
     */
    const I18N_FILE_SUFFIX = '.properties';

    /**
     * @var string
     */
    const I18N_DEFAULT_LOCALE = 'en_US';


    /**
     * @var array
     */
    protected $_cachedLanguageMaps;

    /**
     * Constructor.
     */
    public function __construct ()
    {
        $this->_cachedLanguageMaps = array();
    }

    /**
     * Returns the absolute file path for a given relative file path.
     * @param string $relative the relative file path
     * @return string the absoulute file path
     */
    protected function _getAbsoluteFilePathForRelativeFile ($relative)
    {
        $rootDir = realpath('.');

        return realpath($rootDir . '/' . $relative);
    }

    /**
     * Loads the language file for a given language key, then parses it into a lookup map.
     * @param string $lang the language key
     * @return array lookup map
     */
    protected function _loadPropertiesFile ($lang = null)<commit_msg>fixed typo in code comment.<commit_after><?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Language-map library.
 * Provides key-based lookup mechanism for translation strings.
 *
 * @todo Junk ALL of this in favour of a sane translation component [ST 2013/03/18]
 */
class LanguageMap
{
    /**
     * @var string
     */
    const I18N_FILE_BASE_NAME = 'application/language/ilios_strings_';

    /**
     * @var string
     */
    const I18N_FILE_SUFFIX = '.properties';

    /**
     * @var string
     */
    const I18N_DEFAULT_LOCALE = 'en_US';


    /**
     * @var array
     */
    protected $_cachedLanguageMaps;

    /**
     * Constructor.
     */
    public function __construct ()
    {
        $this->_cachedLanguageMaps = array();
    }

    /**
     * Returns the absolute file path for a given relative file path.
     * @param string $relative the relative file path
     * @return string the absolute file path
     */
    protected function _getAbsoluteFilePathForRelativeFile ($relative)
    {
        $rootDir = realpath('.');

        return realpath($rootDir . '/' . $relative);
    }

    /**
     * Loads the language file for a given language key, then parses it into a lookup map.
     * @param string $lang the language key
     * @return array lookup map
     */
    protected function _loadPropertiesFile ($lang = null)
{'fraction_non_alphanumeric': 0.10990206746463548, 'fraction_numerical': 0.010155966630395358, 'mean_word_length': 2.396551724137931, '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': '7308660', 'n_tokens_mistral': 812, 'n_tokens_neox': 778, 'n_words': 247}