<commit_before># Grunt Configuration
# http://gruntjs.com/getting-started#an-example-gruntfile

module.exports = (grunt) ->

  # Initiate the Grunt configuration.
  grunt.initConfig

    # Allow use of the package.json data.
    pkg: grunt.file.readJSON("package.json")

    # Use Uglify to minify files.
    uglify:
      fontloader:
        files:
          'src/partials/fontload-min.html': 'src/partials/fontload.html'

  # Build the available Grunt tasks.
  grunt.loadNpmTasks "grunt-contrib-uglify"

  # Register our Grunt tasks.
  grunt.registerTask "default", [
    #"uglify"
  ]
  grunt.registerTask "generateFonts", ->
    fs = require('fs')
    util = require('util')
    woffFile = fs.openSync('src/files/fonts.woff.css', 'w')
    woff2File = fs.openSync('src/files/fonts.woff2.css', 'w')
    files = fs.readdirSync('src/files/fonts')
    files.forEach (file) ->
      return unless /\.woff/.test(file)
      b64 = fs.readFileSync('src/files/fonts/' + file).toString('base64')
      format =  (if file.indexOf('.woff2') >= 0 then "woff2" else "woff")
      fontWeight = (if /Semibold/i.test(file) then 600 else 400)
      fontStyle = (if /It/.test(file) then 'italic' else 'normal')
      fontFamily = file.split('.')[0].split('-')[0].split(/(?=[A-Z])/).join(' ')
      template = '@font-face{font-family:%s;src:url(data:application/x-font-%s;charset=utf-8;base64,%s) format("%s");font-weight:%d;font-style:%s}\n'
      css = util.format(template, fontFamily, format, b64, format, fontWeight, fontStyle)<commit_msg>correction for filenames<commit_after># Grunt Configuration
# http://gruntjs.com/getting-started#an-example-gruntfile

module.exports = (grunt) ->

  # Initiate the Grunt configuration.
  grunt.initConfig

    # Allow use of the package.json data.
    pkg: grunt.file.readJSON("package.json")

    # Use Uglify to minify files.
    uglify:
      fontloader:
        files:
          'src/partials/fontload-min.html': 'src/partials/fontload.html'

  # Build the available Grunt tasks.
  grunt.loadNpmTasks "grunt-contrib-uglify"

  # Register our Grunt tasks.
  grunt.registerTask "default", [
    #"uglify"
  ]
  grunt.registerTask "generateFonts", ->
    fs = require('fs')
    util = require('util')
    woffFile = fs.openSync('src/files/fonts.woff.css', 'w')
    woff2File = fs.openSync('src/files/fonts.woff2.css', 'w')
    files = fs.readdirSync('src/files/fonts')
    files.forEach (file) ->
      return unless /\.woff/.test(file)
      b64 = fs.readFileSync('src/files/fonts/' + file).toString('base64')
      format =  (if file.indexOf('.woff2') >= 0 then "woff2" else "woff")
      fontWeight = (if /RB/i.test(file) then 600 else 400)
      fontStyle = (if /RI/.test(file) then 'italic' else 'normal')
      fontFamily = file.split('.')[0].split('-')[0].split(/(?=[A-Z])/).join(' ')
      template = '@font-face{font-family:%s;src:url(data:application/x-font-%s;charset=utf-8;base64,%s) format("%s");font-weight:%d;font-style:%s}\n'
      css = util.format(template, fontFamily, format, b64, format, fontWeight, fontStyle)
{'fraction_non_alphanumeric': 0.17260542661000328, 'fraction_numerical': 0.014383785550833606, 'mean_word_length': 3.3651925820256774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1949803', 'n_tokens_mistral': 1132, 'n_tokens_neox': 1078, 'n_words': 201}