<commit_before>var editor_func = function()
{
        // prefixList is used to store prefix 
        var prefixList =  new Array();
        // Indicate whether html is under edit
        var underEdit = false;
        // Indicate current order mode
        var isAscendant = true;
        // Indicate whether prefix table is selected for function selectAll
        var prefixSelectState = 0;
        // Indicate whether main table is selected for function selectAll
        var mytableSelectState = 0;

        function addRow(source, subject, predicate, object, graphName, index)
        {        
                 var myTable = document.getElementById("myTable"),
                     ontologyBody = myTable.tBodies[0],
                     newRow = ontologyBody.insertRow(ontologyBody.rows.length),
                     attribute_0=document.createAttribute("class");     

                 attribute_0.value = "a1"; 
                 newRow.setAttributeNode(attribute_0);     

                 var cell_1 = newRow.insertCell(0),
                     cell_2 = newRow.insertCell(1),
                     cell_3 = newRow.insertCell(2),
                     cell_4 = newRow.insertCell(3),
                     cell_5 = newRow.insertCell(4),
                     cell_6 = newRow.insertCell(5),
                     attribute_2 = document.createAttribute("ondblclick"),
                     attribute_3 = document.createAttribute("ondblclick"),
                     attribute_4 = document.createAttribute("ondblclick");
                     attribute_5 = document.createAttribute("ondblclick"),     

                 attribute_2.value = "editor_func.createTextArea(this)";
                 attribute_3.value = "editor_func.createTextArea(this)"; 
                 attribute_4.value = "editor_func.createTextArea(this)";
                 attribute_5.value = "editor_func.createTextArea(this)";
                     
                 cell_1.innerHTML = index;
                 cell_2.setAttributeNode(attribute_2);
                 cell_3.setAttributeNode(attribute_3);
                 cell_4.setAttributeNode(attribute_4);
                 cell_5.setAttributeNode(attribute_5);
                 cell_6.innerHTML = "<td align='center'><input type='checkbox' name='tableCheck' style='width:20px' /></td>";     

                 if (source === "empty")
                 {
                     cell_1.innerHTML = ontologyBody.getElementsByTagName('tr').length
                 }
                 
                 if (source !== "empty")
                 {
                     cell_2.innerHTML = subject;
                     cell_3.innerHTML = predicate;
                     cell_4.innerHTML = object;     

                     if (source === "nq")
                     {
                         cell_5.innerHTML = graphName;
                     }
                 }
         }    
        
        //This Function is used to handle files export
        function exportFile(value, type, name)
        {  
            var blob;

            if (typeof window.Blob == "function")  
                blob = new Blob([value], {type: type});  
            else
            {  
                var BlobBuilder = window.BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder || window.MSBlobBuilder,
                    blobBuilder = new BlobBuilder();

                blobBuilder.append(value);  
                blob = blobBuilder.getBlob(type);  
            }

            var url = window.URL || window.webkitURL,
                blobUrl = url.createObjectURL(blob),
                anchor = document.createElement("a");
            
            if ('download' in anchor)
            {
                anchor.style.visibility = "hidden";  
                anchor.href = blobUrl;
                anchor.download = name;
                document.body.appendChild(anchor);
                var evt = document.createEvent("MouseEvents");
                evt.initEvent("click", true, true);
                anchor.dispatchEvent(evt);
                document.body.removeChild(anchor);
            }
            else if (navigator.msSaveBlob)
                navigator.msSaveBlob(blob, name);
            else 
                location.href = blobUrl;
        }

        // Check is this browser support File APIs
        if (!(window.File && window.FileReader && window.FileList && window.Blob))
            alert('The File APIs are not fully supported in this browser.');

        // This Function is used to upload Files
        function handleFileSelect(evt)
        {
            var files = evt.target.files,
                output = [];
            
            for (var i = 0, f; f = files[i]; i++)
                output.push('<li><strong>',f.name, '</strong> (', f.type || 'n/a', ') - ', f.size, ' bytes, last modified: ',
                            f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a', '</li>');

            var reader = new FileReader();
            reader.readAsText(files[0]); 
            var extensibleIndex = files[0].name.lastIndexOf("."),
                extensibleLength = files[0].name.length,
                extensible = files[0].name.substring(extensibleIndex + 1, extensibleLength);

            if (extensible === "nq") 
            {<commit_msg>Update editor.js<commit_after>var editor_func = function()
{
        // prefixList is used to store prefix 
        var prefixList =  new Array();
        // Indicate whether html is under edit
        var underEdit = false;
        // Indicate current order mode
        var isAscendant = true;
        // Indicate whether prefix table is selected for function selectAll
        var prefixSelectState = 0;
        // Indicate whether main table is selected for function selectAll
        var mytableSelectState = 0;       
        // Check is this browser support File APIs
        if (!(window.File && window.FileReader && window.FileList && window.Blob))
            alert('The File APIs are not fully supported in this browser.');

        function addRow(source, subject, predicate, object, graphName, index)
        {        
                 var myTable = document.getElementById("myTable"),
                     ontologyBody = myTable.tBodies[0],
                     newRow = ontologyBody.insertRow(ontologyBody.rows.length),
                     attribute_0=document.createAttribute("class");     

                 attribute_0.value = "a1"; 
                 newRow.setAttributeNode(attribute_0);     

                 var cell_1 = newRow.insertCell(0),
                     cell_2 = newRow.insertCell(1),
                     cell_3 = newRow.insertCell(2),
                     cell_4 = newRow.insertCell(3),
                     cell_5 = newRow.insertCell(4),
                     cell_6 = newRow.insertCell(5),
                     attribute_2 = document.createAttribute("ondblclick"),
                     attribute_3 = document.createAttribute("ondblclick"),
                     attribute_4 = document.createAttribute("ondblclick");
                     attribute_5 = document.createAttribute("ondblclick"),     

                 attribute_2.value = "editor_func.createTextArea(this)";
                 attribute_3.value = "editor_func.createTextArea(this)"; 
                 attribute_4.value = "editor_func.createTextArea(this)";
                 attribute_5.value = "editor_func.createTextArea(this)";
                     
                 cell_1.innerHTML = index;
                 cell_2.setAttributeNode(attribute_2);
                 cell_3.setAttributeNode(attribute_3);
                 cell_4.setAttributeNode(attribute_4);
                 cell_5.setAttributeNode(attribute_5);
                 cell_6.innerHTML = "<td align='center'><input type='checkbox' name='tableCheck' style='width:20px' /></td>";     

                 if (source === "empty")
                 {
                     cell_1.innerHTML = ontologyBody.getElementsByTagName('tr').length
                 }
                 
                 if (source !== "empty")
                 {
                     cell_2.innerHTML = subject;
                     cell_3.innerHTML = predicate;
                     cell_4.innerHTML = object;     

                     if (source === "nq")
                     {
                         cell_5.innerHTML = graphName;
                     }
                 }
         }    
        
        //This Function is used to handle files export
        function exportFile(value, type, name)
        {  
            var blob;

            if (typeof window.Blob == "function")  
                blob = new Blob([value], {type: type});  
            else
            {  
                var BlobBuilder = window.BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder || window.MSBlobBuilder,
                    blobBuilder = new BlobBuilder();

                blobBuilder.append(value);  
                blob = blobBuilder.getBlob(type);  
            }

            var url = window.URL || window.webkitURL,
                blobUrl = url.createObjectURL(blob),
                anchor = document.createElement("a");
            
            if ('download' in anchor)
            {
                anchor.style.visibility = "hidden";  
                anchor.href = blobUrl;
                anchor.download = name;
                document.body.appendChild(anchor);
                var evt = document.createEvent("MouseEvents");
                evt.initEvent("click", true, true);
                anchor.dispatchEvent(evt);
                document.body.removeChild(anchor);
            }
            else if (navigator.msSaveBlob)
                navigator.msSaveBlob(blob, name);
            else 
                location.href = blobUrl;
        }

        // This Function is used to upload Files
        function handleFileSelect(evt)
        {
            var files = evt.target.files,
                output = [];
            
            for (var i = 0, f; f = files[i]; i++)
                output.push('<li><strong>',f.name, '</strong> (', f.type || 'n/a', ') - ', f.size, ' bytes, last modified: ',
                            f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a', '</li>');

            var reader = new FileReader();
            reader.readAsText(files[0]); 
            var extensibleIndex = files[0].name.lastIndexOf("."),
                extensibleLength = files[0].name.length,
                extensible = files[0].name.substring(extensibleIndex + 1, extensibleLength);

            if (extensible === "nq") 
            {
{'fraction_non_alphanumeric': 0.10000940822278671, 'fraction_numerical': 0.00940822278671559, 'mean_word_length': 1.4510029974636847, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2056297', 'n_tokens_mistral': 2672, 'n_tokens_neox': 2536, 'n_words': 551}