<commit_before>(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(
      require("codemirror/lib/codemirror"),
      require("codemirror/addon/hint/show-hint")
    );
  else if (typeof define == "function" && define.amd) // AMD
    define([
      "codemirror/lib/codemirror",
      "codemirror/addon/hint/show-hint"
    ], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {

  CodeMirror.registerHelper("hint", "jsonld", function(cm, pred) {
    var terms = [
      '@base',
      '@container', '@context',
      '@graph',
      '@id',
      '@language', '@list',
      '@reverse',
      '@set',
      '@type',
      '@vocab'
    ];
    if (!pred || pred()) setTimeout(function() {
      if (!cm.state.completionActive) {
        cm.showHint({
          completeSingle: false,
          hint: function (cm, options) {
            var cur = cm.getCursor(),
                token = cm.getTokenAt(cur);
            var start = token.start - 1,
                end = token.end;
            var list = terms;
            if (token.type === 'property') {
              var search = token.string.match(/[@]?\w+/);
              if (search !== null) {
                list = terms.filter(function(t) {
                  if (t.indexOf(search) > -1) {
                    return t;
                  }
                });
              }
              return {
                  list: list, //value[i].listCallback(),
                  from: CodeMirror.Pos(cur.line, start+2),
                  to: CodeMirror.Pos(cur.line, end-1)
              };
            }
          }
        });
      }
    }, 100);
    return CodeMirror.Pass;
  });
});<commit_msg>Remove pred() ref (from XML autocompleter)<commit_after>(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(
      require("codemirror/lib/codemirror"),
      require("codemirror/addon/hint/show-hint")
    );
  else if (typeof define == "function" && define.amd) // AMD
    define([
      "codemirror/lib/codemirror",
      "codemirror/addon/hint/show-hint"
    ], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {

  CodeMirror.registerHelper("hint", "jsonld", function(cm, pred) {
    var terms = [
      '@base',
      '@container', '@context',
      '@graph',
      '@id',
      '@language', '@list',
      '@reverse',
      '@set',
      '@type',
      '@vocab'
    ];
    setTimeout(function() {
      if (!cm.state.completionActive) {
        cm.showHint({
          completeSingle: false,
          hint: function (cm, options) {
            var cur = cm.getCursor(),
                token = cm.getTokenAt(cur);
            var start = token.start - 1,
                end = token.end;
            var list = terms;
            if (token.type === 'property') {
              var search = token.string.match(/[@]?\w+/);
              if (search !== null) {
                list = terms.filter(function(t) {
                  if (t.indexOf(search) > -1) {
                    return t;
                  }
                });
              }
              return {
                list: list,
                from: CodeMirror.Pos(cur.line, start+2),
                to: CodeMirror.Pos(cur.line, end-1)
              };
            }
          }
        });
      }
    }, 100);
    return CodeMirror.Pass;
  });
});
{'fraction_non_alphanumeric': 0.1591240875912409, 'fraction_numerical': 0.004087591240875913, 'mean_word_length': 1.5154185022026432, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1473522', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1020, 'n_words': 205}