<commit_before>/* View Model *************************************************************/
function View() {
  var that = this;
  
  // ajax observables
  this.commands = ko.observable({id: "Loading..."});
  this.variables = ko.observable();
  this.entities = ko.observable();
  this.items = ko.observable({id: "Loading..."});
  $.get('commands?sort=id', {}, function success(res) { that.commands(res); });
  $.get('variables?sort=id', {}, function success(res) { that.variables(res); });
  $.get('values?kind__in=entity', {}, function success(res) { that.entities(res); });
  $.get('values?kind__in=block,item', {}, function success(res) { that.items(res); });
  
  // user input observables
  this.command = ko.observable('');
  this.item = ko.observable({});
  this.tag = ko.computed(function () {
    if (that.command().id === 'give') {
      return new Tag({id:'tag', type:'compound'});
    } else {
      return new Tag({id:'Entity', type:'compound'});
    }
  });
  this.playerVar = ko.observable();
  this.playerName = ko.observable();
  this.player = ko.computed(function() {
    return that.playerVar() ? that.playerVar().id : that.playerName();
  });
  this.amount = ko.observable(0);
  this.metadata = ko.observable(0);
  this.entity = ko.observable('');<commit_msg>fixes #18<commit_after>/* View Model *************************************************************/
function View() {
  var that = this;
  
  // ajax observables
  this.commands = ko.observable({id: "Loading..."});
  this.variables = ko.observable();
  this.entities = ko.observable();
  this.items = ko.observable({id: "Loading..."});
  $.get('commands?sort=id', {}, function success(res) { that.commands(res); });
  $.get('variables?sort=id', {}, function success(res) { that.variables(res); });
  $.get('values?kind__in=entity', {}, function success(res) { that.entities(res); });
  $.get('values?kind__in=block,item', {}, function success(res) { that.items(res); });
  
  // user input observables
  this.command = ko.observable('');
  this.item = ko.observable({});
  this.tag = ko.computed(function () {
    if (that.command().id === 'give') {
      return new Tag({id:'tag', type:'compound'});
    } else {
      return new Tag({id:'Entity', type:'compound'});
    }
  });
  this.playerVar = ko.observable();
  this.playerName = ko.observable();
  this.player = ko.computed(function() {
    return that.playerVar() ? that.playerVar().id : that.playerName();
  });
  this.amount = ko.observable(1);
  this.metadata = ko.observable(0);
  this.entity = ko.observable('');
{'fraction_non_alphanumeric': 0.2517619420516836, 'fraction_numerical': 0.0023492560689115116, 'mean_word_length': 4.214285714285714, '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': '3985238', 'n_tokens_mistral': 815, 'n_tokens_neox': 807, 'n_words': 146}