<commit_before>// -*- js2-basic-offset: 2 -*-

function prim2html(prim, limit) {
  switch(typeof prim) {
  case 'undefined':
    return 'undefined';
  case 'boolean':
    return prim ? 'true' : 'false';
  case 'number':
    return String(prim);
  case 'string':
    if (prim.length > limit) {
      prim = prim.substring(0, limit) + '...';
    }
    return escapeHTML(prim);
  case 'array':
  case 'object':
    if (prim == null) {
      return 'null';
    } else if ($.isArray(prim)) {
      return 'array'; /* TODO: implement */
    } else {
      return 'object'; /* TODO: implement */
    }
  default:
    return 'ERROR';
  }
}

function escapeHTML(str) {
  return str.replace(/&/g, "&amp;")
            .replace(/"/g, "&quot;")
            .replace(/</g, "&lt;")
            .replace(/>/g, "&gt;");
}
Groonga = {
  key_type_list: ['Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
                  'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
                  'TokyoGeoPoint', 'WGS84GeoPoint'],
  value_type_list: ['Object', 'Bool',
                    'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
                    'Int64', 'UInt64', 'Float', 'Time'],
  column_type_list: ['Object', 'Bool',
                     'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
                     'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
                     'Text', 'LongText', 'TokyoGeoPoint', 'WGS84GeoPoint'],
  tokenizer_list: ['TokenDelimit', 'TokenUnigram', 'TokenBigram', 'TokenTrigram', 'TokenMecab'],
  GRN_OBJ_PERSISTENT:             (0x01<<15),

  GRN_OBJ_TABLE_TYPE_MASK:        (0x07),
  GRN_OBJ_TABLE_HASH_KEY:         (0x00),
  GRN_OBJ_TABLE_PAT_KEY:          (0x01),
  GRN_OBJ_TABLE_NO_KEY:           (0x03),

  GRN_OBJ_KEY_WITH_SIS:           (0x01<<6),
  GRN_OBJ_KEY_NORMALIZE:          (0x01<<7),

  GRN_OBJ_COLUMN_TYPE_MASK:       (0x07),
  GRN_OBJ_COLUMN_SCALAR:          (0x00),
  GRN_OBJ_COLUMN_VECTOR:          (0x01),
  GRN_OBJ_COLUMN_INDEX:           (0x02),

  GRN_OBJ_COMPRESS_MASK:          (0x07<<4),
  GRN_OBJ_COMPRESS_NONE:          (0x00<<4),
  GRN_OBJ_COMPRESS_ZLIB:          (0x01<<4),
  GRN_OBJ_COMPRESS_LZO:           (0x02<<4),

  GRN_OBJ_WITH_SECTION:           (0x01<<7),
  GRN_OBJ_WITH_WEIGHT:            (0x01<<8),
  GRN_OBJ_WITH_POSITION:          (0x01<<9)
};
function GroongaAdmin() {
  this.current_table = null;
  this.statusTimer = null;
  this.semaphore = new Array();
  this.current_status = 0;
  this.reload_record_func = function(){};

  var that = this;
  this._initializeTabs();

  $('#tab-tablelist-link').click(function() {
    that.tablelist();
  });
  $('#tab-columnlist-link').click(function() {
    that.columnlist(that.current_table);
  });
  $('#tab-createrecord-link').click(function() {
    that.update_createrecord(that.current_table);<commit_msg>admin: add a new line<commit_after>// -*- js2-basic-offset: 2 -*-

function prim2html(prim, limit) {
  switch(typeof prim) {
  case 'undefined':
    return 'undefined';
  case 'boolean':
    return prim ? 'true' : 'false';
  case 'number':
    return String(prim);
  case 'string':
    if (prim.length > limit) {
      prim = prim.substring(0, limit) + '...';
    }
    return escapeHTML(prim);
  case 'array':
  case 'object':
    if (prim == null) {
      return 'null';
    } else if ($.isArray(prim)) {
      return 'array'; /* TODO: implement */
    } else {
      return 'object'; /* TODO: implement */
    }
  default:
    return 'ERROR';
  }
}

function escapeHTML(str) {
  return str.replace(/&/g, "&amp;")
            .replace(/"/g, "&quot;")
            .replace(/</g, "&lt;")
            .replace(/>/g, "&gt;");
}
Groonga = {
  key_type_list: ['Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
                  'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
                  'TokyoGeoPoint', 'WGS84GeoPoint'],
  value_type_list: ['Object', 'Bool',
                    'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
                    'Int64', 'UInt64', 'Float', 'Time'],
  column_type_list: ['Object', 'Bool',
                     'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
                     'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
                     'Text', 'LongText', 'TokyoGeoPoint', 'WGS84GeoPoint'],
  tokenizer_list: ['TokenDelimit', 'TokenUnigram', 'TokenBigram', 'TokenTrigram', 'TokenMecab'],
  GRN_OBJ_PERSISTENT:             (0x01<<15),

  GRN_OBJ_TABLE_TYPE_MASK:        (0x07),
  GRN_OBJ_TABLE_HASH_KEY:         (0x00),
  GRN_OBJ_TABLE_PAT_KEY:          (0x01),
  GRN_OBJ_TABLE_NO_KEY:           (0x03),

  GRN_OBJ_KEY_WITH_SIS:           (0x01<<6),
  GRN_OBJ_KEY_NORMALIZE:          (0x01<<7),

  GRN_OBJ_COLUMN_TYPE_MASK:       (0x07),
  GRN_OBJ_COLUMN_SCALAR:          (0x00),
  GRN_OBJ_COLUMN_VECTOR:          (0x01),
  GRN_OBJ_COLUMN_INDEX:           (0x02),

  GRN_OBJ_COMPRESS_MASK:          (0x07<<4),
  GRN_OBJ_COMPRESS_NONE:          (0x00<<4),
  GRN_OBJ_COMPRESS_ZLIB:          (0x01<<4),
  GRN_OBJ_COMPRESS_LZO:           (0x02<<4),

  GRN_OBJ_WITH_SECTION:           (0x01<<7),
  GRN_OBJ_WITH_WEIGHT:            (0x01<<8),
  GRN_OBJ_WITH_POSITION:          (0x01<<9)
};

function GroongaAdmin() {
  this.current_table = null;
  this.statusTimer = null;
  this.semaphore = new Array();
  this.current_status = 0;
  this.reload_record_func = function(){};

  var that = this;
  this._initializeTabs();

  $('#tab-tablelist-link').click(function() {
    that.tablelist();
  });
  $('#tab-columnlist-link').click(function() {
    that.columnlist(that.current_table);
  });
  $('#tab-createrecord-link').click(function() {
    that.update_createrecord(that.current_table);
{'fraction_non_alphanumeric': 0.17589175891758918, 'fraction_numerical': 0.040766121946933756, 'mean_word_length': 2.6025316455696204, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 7, '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': '1347451', 'n_tokens_mistral': 2267, 'n_tokens_neox': 2128, 'n_words': 359}