<commit_before>// -*- indent-tabs-mode: nil; js2-basic-offset: 2 -*-
/*
  BooleanQueryTranslator translates Boolean Queries in Amazon
  CloudSearch into script syntax grn_expr in groonga.

  Expression Syntax for Boolean Queries:
    http://docs.amazonwebservices.com/cloudsearch/latest/developerguide/Search.Requests.html#Search.MatchSetExpression

  Script syntax grn_expr:
    http://groonga.org/docs/reference/grn_expr/script_syntax.html

  Unsupported syntaxes of Boolean Queries:
    * (not ...)

  FIXME: Returns null if the given query is not supported.
         Should raise.
*/


function BooleanQueryTranslator(query) {
  this.query = query;
  this.offset = 0;
  this.defaultField = null;
}

BooleanQueryTranslator.prototype = {
  translate: function() {
    var expression;
    if (this.query[0] == "(") {
      expression = this.translateGroup();
    } else {<commit_msg>bq: remove done TODO<commit_after>// -*- indent-tabs-mode: nil; js2-basic-offset: 2 -*-
/*
  BooleanQueryTranslator translates Boolean Queries in Amazon
  CloudSearch into script syntax grn_expr in groonga.

  Expression Syntax for Boolean Queries:
    http://docs.amazonwebservices.com/cloudsearch/latest/developerguide/Search.Requests.html#Search.MatchSetExpression

  Script syntax grn_expr:
    http://groonga.org/docs/reference/grn_expr/script_syntax.html

  Unsupported syntaxes of Boolean Queries:
    * (not ...)
*/


function BooleanQueryTranslator(query) {
  this.query = query;
  this.offset = 0;
  this.defaultField = null;
}

BooleanQueryTranslator.prototype = {
  translate: function() {
    var expression;
    if (this.query[0] == "(") {
      expression = this.translateGroup();
    } else {
{'fraction_non_alphanumeric': 0.11229314420803782, 'fraction_numerical': 0.004728132387706856, 'mean_word_length': 3.6767955801104972, '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': '1736734', 'n_tokens_mistral': 532, 'n_tokens_neox': 517, 'n_words': 119}