<commit_before><?php

namespace MarkNotes\Plugins\Content\HTML;

defined('_MARKNOTES') or die('No direct access allowed');

class JoliTypo
{
    public static function doIt(&$html = null)
    {
        $aeFiles = \MarkNotes\Files::getInstance();
        $aeFunctions = \MarkNotes\Functions::getInstance();
        $aeSettings = \MarkNotes\Settings::getInstance();

        if (is_dir($aeSettings->getFolderLibs()."jolicode")) {
            $locale = $aeSettings->getLocale();


            // See https://github.com/jolicode/JoliTypo#fixer-recommendations-by-locale
            switch ($locale) {
                case 'fr-FR':
                    // Those rules apply most of the recommendations of "Abrégé du code typographique à l'usage de la presse", ISBN: 9782351130667.
                    // Remove Hypen because need a library (Hyphenator) of 12MB,
                    $fixer = new \JoliTypo\Fixer(array('Ellipsis', 'Dimension', 'Numeric', 'Dash', 'SmartQuotes', 'FrenchNoBreakSpace', 'NoSpaceBeforeComma', 'CurlyQuote', 'Trademark'));
                    break;

                default:
                    // Remove Hypen because need a library (Hyphenator) of 12MB,
                    $fixer = new \JoliTypo\Fixer(array('Ellipsis', 'Dimension', 'Numeric', 'Dash', 'SmartQuotes', 'NoSpaceBeforeComma', 'CurlyQuote', 'Trademark'));
                    break;
            }

            // Set the locale (en_GB, fr_FR, ...) preferences
            $fixer->setLocale($locale);

            $html = $fixer->fix($html);

            $html = str_replace('Wallonie', 'KLJLJKJ', $html);
        }

        return true;
    }

    public function bind()
    {
        $aeEvents = \MarkNotes\Events::getInstance();
        $aeEvents->bind('display.html', __CLASS__.'::doIt');
        return true;
    }
}<commit_msg>jolitypo<commit_after><?php

namespace MarkNotes\Plugins\Content\HTML;

defined('_MARKNOTES') or die('No direct access allowed');

class JoliTypo
{
    public static function doIt(&$html = null)
    {
        $aeFiles = \MarkNotes\Files::getInstance();
        $aeFunctions = \MarkNotes\Functions::getInstance();
        $aeSettings = \MarkNotes\Settings::getInstance();

        if (is_dir($aeSettings->getFolderLibs()."jolicode")) {
            $locale = $aeSettings->getLocale();


            // See https://github.com/jolicode/JoliTypo#fixer-recommendations-by-locale
            switch ($locale) {
                case 'fr-FR':
                    // Those rules apply most of the recommendations of "Abrégé du code typographique à l'usage de la presse", ISBN: 9782351130667.
                    // Remove Hypen because need a library (Hyphenator) of 12MB,
                    $fixer = new \JoliTypo\Fixer(array('Ellipsis', 'Dimension', 'Numeric', 'Dash', 'SmartQuotes', 'FrenchNoBreakSpace', 'NoSpaceBeforeComma', 'CurlyQuote', 'Trademark'));
                    break;

                default:
                    // Remove Hypen because need a library (Hyphenator) of 12MB,
                    $fixer = new \JoliTypo\Fixer(array('Ellipsis', 'Dimension', 'Numeric', 'Dash', 'SmartQuotes', 'NoSpaceBeforeComma', 'CurlyQuote', 'Trademark'));
                    break;
            }

            // Set the locale (en_GB, fr_FR, ...) preferences
            $fixer->setLocale($locale);

            $html = $fixer->fix($html);
        }

        return true;
    }

    public function bind()
    {
        $aeEvents = \MarkNotes\Events::getInstance();
        $aeEvents->bind('display.html', __CLASS__.'::doIt');
        return true;
    }
}
{'fraction_non_alphanumeric': 0.13793103448275862, 'fraction_numerical': 0.009531819456125596, 'mean_word_length': 2.2115211521152114, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '5815639', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1023, 'n_words': 230}