<commit_before>$(
    function () {

        // Set #beta-code border radius (cross-browser styling) and select all its text
        $('#beta-code').css('border-radius', '8px').select();

        // Select contents of #hebrew
        $('#selectall').click(
            function () {
                SelectText('hebrew');
                return false;
            }
        );

        // Fade in about page
        $('#aboutlink').click(
            function () {
                $('#about').fadeToggle('slow');
                return false;
            }
        );

        // Run convert() on load
        $('#hebrew').html(convert($('#beta-code').val()));

        // Run convert() on textchange
        $('#beta-code').bind('textchange',
            function (event) {
                $('#hebrew').html(convert($(this).val()));
            }
        )

        // Convert Beta Code in #beta-code to Unicode in #hebrew
        function convert(text) {
            // Handle terminal kaf
            text = text.replace(/k(?=[f:][\s])|k(?=[f:]$)|k(?=[f:]$)|k(?=[\s-])|k$/igm, '\u05DA');

            // Handle other terminal letters
            text = text.replace(/m(?=[\s-])|m$/igm, '\u05DD');
            text = text.replace(/n(?=[\s-])|n$/igm, '\u05DF');
            text = text.replace(/p(?=[\s-])|p$/igm, '\u05E3');
            text = text.replace(/c(?=[\s-])|c$/igm, '\u05E5');

            // Handle other letters
            text = text.replace(/\)/gm, '\u05D0');
            text = text.replace(/b/igm, '\u05D1');
            text = text.replace(/g/igm, '\u05D2');
            text = text.replace(/d/igm, '\u05D3');
            text = text.replace(/h/igm, '\u05D4');
            text = text.replace(/w/igm, '\u05D5');
            text = text.replace(/z/igm, '\u05D6');
            text = text.replace(/x/igm, '\u05D7');
            text = text.replace(/\+/gm, '\u05D8');
            text = text.replace(/y/igm, '\u05D9');
            text = text.replace(/k/igm, '\u05DB');
            text = text.replace(/l/igm, '\u05DC');
            text = text.replace(/m/igm, '\u05DE');
            text = text.replace(/n/igm, '\u05E0');<commit_msg>Fixed handling of terminal letters before sof pasuq<commit_after>$(
    function () {

        // Set #beta-code border radius (cross-browser styling) and select all its text
        $('#beta-code').css('border-radius', '8px').select();

        // Select contents of #hebrew
        $('#selectall').click(
            function () {
                SelectText('hebrew');
                return false;
            }
        );

        // Fade in about page
        $('#aboutlink').click(
            function () {
                $('#about').fadeToggle('slow');
                return false;
            }
        );

        // Run convert() on load
        $('#hebrew').html(convert($('#beta-code').val()));

        // Run convert() on textchange
        $('#beta-code').bind('textchange',
            function (event) {
                $('#hebrew').html(convert($(this).val()));
            }
        )

        // Convert Beta Code in #beta-code to Unicode in #hebrew
        function convert(text) {
            // Handle terminal kaf
            text = text.replace(/k(?=[f:][\s])|k(?=[f:]$)|k(?=[f:]$)|k(?=[\s-;])|k$/igm, '\u05DA');

            // Handle other terminal letters
            text = text.replace(/m(?=[\s-;])|m$/igm, '\u05DD');
            text = text.replace(/n(?=[\s-;])|n$/igm, '\u05DF');
            text = text.replace(/p(?=[\s-;])|p$/igm, '\u05E3');
            text = text.replace(/c(?=[\s-;])|c$/igm, '\u05E5');

            // Handle other letters
            text = text.replace(/\)/gm, '\u05D0');
            text = text.replace(/b/igm, '\u05D1');
            text = text.replace(/g/igm, '\u05D2');
            text = text.replace(/d/igm, '\u05D3');
            text = text.replace(/h/igm, '\u05D4');
            text = text.replace(/w/igm, '\u05D5');
            text = text.replace(/z/igm, '\u05D6');
            text = text.replace(/x/igm, '\u05D7');
            text = text.replace(/\+/gm, '\u05D8');
            text = text.replace(/y/igm, '\u05D9');
            text = text.replace(/k/igm, '\u05DB');
            text = text.replace(/l/igm, '\u05DC');
            text = text.replace(/m/igm, '\u05DE');
            text = text.replace(/n/igm, '\u05E0');
{'fraction_non_alphanumeric': 0.2120653925857702, 'fraction_numerical': 0.023946580704582086, 'mean_word_length': 1.5826397146254458, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5721220', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1339, 'n_words': 254}