<commit_before>
/**
 * Useful core for extracting movie title from page title
 */
function TitleExtractor() {
  this.extractors = {}
}

TitleExtractor.prototype.register = function (domain, callback) {
  this.extractors[domain] = callback
}

TitleExtractor.prototype.extract = function (domain, text) {
  if (!domain in this.extractors) return text
  var e = this.extractors[domain]
  return e(text)
}

// Bring the default instance
var titleExtractor = new TitleExtractor()<commit_msg>Fixed bug for unknown domains<commit_after>
/**
 * Useful core for extracting movie title from page title
 */
function TitleExtractor() {
  this.extractors = {}
}

TitleExtractor.prototype.register = function (domain, callback) {
  this.extractors[domain] = callback
}

TitleExtractor.prototype.extract = function (domain, text) {
  var res = text
  if (domain in this.extractors) res = this.extractors[domain](text)
  return res
}

// Bring the default instance
var titleExtractor = new TitleExtractor()
{'fraction_non_alphanumeric': 0.10505050505050505, 'fraction_numerical': 0.0, 'mean_word_length': 4.630681818181818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6630454', 'n_tokens_mistral': 287, 'n_tokens_neox': 284, 'n_words': 87}