<commit_before>module.exports = function Count (s, sep) {
  //  discuss at: http://locutus.io/php/printf/
  // original by: <NAME> (http://kvz.io)
  //    input by: GopherJS (http://www.gopherjs.org/)
  //   example 1: Count("cheese", "e")
  //   returns 1: 3
  //   example 2: Count("five", "") // before & after each rune
  //   returns 2: 5

  var Index = require('../strings/Index2')

  var pos
  var n = 0

  if ((sep.length === 0)) {
    return s.split(sep).length + 1
  } else if (sep.length > s.length) {
    return 0
  } else if ((sep.length === s.length)) {
    if (sep === s) {
      return 1
    }
    return 0
  }
  while (true) {
    pos = Index(s, sep)
    if (pos === -1) {
      break
    }
    n = n + (1) >> 0
    s = s.substring((pos + sep.length >> 0))
  }
  return n
}<commit_msg>Remove strings.Index dependency in Go's string.Count<commit_after>module.exports = function Count (s, sep) {
  //  discuss at: http://locutus.io/php/printf/
  // original by: <NAME> (http://kvz.io)
  //    input by: GopherJS (http://www.gopherjs.org/)
  //   example 1: Count("cheese", "e")
  //   returns 1: 3
  //   example 2: Count("five", "") // before & after each rune
  //   returns 2: 5

  var pos
  var n = 0

  if ((sep.length === 0)) {
    return s.split(sep).length + 1
  } else if (sep.length > s.length) {
    return 0
  } else if ((sep.length === s.length)) {
    if (sep === s) {
      return 1
    }
    return 0
  }
  while (true) {
    pos = (s + '').indexOf(sep)
    if (pos === -1) {
      break
    }
    n = n + (1) >> 0
    s = s.substring((pos + sep.length >> 0))
  }
  return n
}
{'fraction_non_alphanumeric': 0.1897946484131923, 'fraction_numerical': 0.020535158680771624, 'mean_word_length': 2.005607476635514, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6059623', 'n_tokens_mistral': 633, 'n_tokens_neox': 597, 'n_words': 168}