<commit_before>###!
TextFadeIn v 1.0.0
https://github.com/mdesantis/TextFadeIn

Includes parts of Sizzle.js
http://sizzlejs.com/

Copyright 2013 <NAME>
Released under the MIT license
https://github.com/mdesantis/TextFadeIn/LICENSE
###

# Coffeescript compile command: coffee --compile text-fade-in.coffee
# Uglify command: uglifyjs text-fade-in.js --mangle --compress --comments '/!/' --output text-fade-in.min.js
class TextFadeIn

  BLANK_REPLACE_REGEX = /[^\n]/g

  shuffle = (a) ->
    i = a.length

    while i
      j = Math.floor Math.random()*i
      x = a[--i]
      a[i] = a[j]
      a[j] = x

    a

  randomSequence = (length) -> shuffle [0..length]

  replace = (element, text, sequence) ->
    index     = sequence.shift()
    prev_text = getText element
    character = text.charAt(index)

    setText element, "#{prev_text.substr(0, index)}#{character}#{prev_text.substr(index+character.length)}"

  # References: Sizzle.getText
  getText = (element) ->
    text     = ''<commit_msg>Indentation<commit_after>###!
TextFadeIn v 1.0.0
https://github.com/mdesantis/TextFadeIn

Includes parts of Sizzle.js
http://sizzlejs.com/

Copyright 2013 <NAME>
Released under the MIT license
https://github.com/mdesantis/TextFadeIn/LICENSE
###

# Coffeescript compile command: coffee --compile text-fade-in.coffee
# Uglify command:               uglifyjs text-fade-in.js --mangle --compress --comments '/!/' --output text-fade-in.min.js
class TextFadeIn

  BLANK_REPLACE_REGEX = /[^\n]/g

  shuffle = (a) ->
    i = a.length

    while i
      j = Math.floor Math.random()*i
      x = a[--i]
      a[i] = a[j]
      a[j] = x

    a

  randomSequence = (length) -> shuffle [0..length]

  replace = (element, text, sequence) ->
    index     = sequence.shift()
    prev_text = getText element
    character = text.charAt(index)

    setText element, "#{prev_text.substr(0, index)}#{character}#{prev_text.substr(index+character.length)}"

  # References: Sizzle.getText
  getText = (element) ->
    text     = ''
{'fraction_non_alphanumeric': 0.15139442231075698, 'fraction_numerical': 0.008964143426294821, 'mean_word_length': 2.9315068493150687, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 4, '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': '5789828', 'n_tokens_mistral': 756, 'n_tokens_neox': 711, 'n_words': 156}