<commit_before>export default class Completer {
  constructor() {
    this.strategies = [];
  }

  /**
   * Register a strategy to the completer.
   *
   * @param {Strategy} strategy
   * @returns {this}
   */
  registerStrategy(strategy) {
    this.strategies.push(strategy);
    return this;
  }
}
<commit_msg>Add Completer#extractQuery private method<commit_after>export default class Completer {
  constructor() {
    this.strategies = [];
  }

  /**
   * Register a strategy to the completer.
   *
   * @param {Strategy} strategy
   * @returns {this}
   */
  registerStrategy(strategy) {
    this.strategies.push(strategy);
    return this;
  }

  /**
   * @private
   * @param {string} text - Head to input cursor.
   * @returns {?Query}
   */
  extractQuery(text) {
    var i;
    for (i = 0; i < this.strategies.length; i++) {
      let query = this.strategies[i].buildQuery(text);
      if (query) { return query; }
    }
    return null;
  }
}

{'fraction_non_alphanumeric': 0.13626834381551362, 'fraction_numerical': 0.0010482180293501049, 'mean_word_length': 2.673076923076923, 'pattern_counts': {'":': 0, '<': 4, '<?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': '573147', 'n_tokens_mistral': 328, 'n_tokens_neox': 323, 'n_words': 73}