<commit_before>'use strict';


/**
 * Upload `contact` (containing contact data) onto Cluestr.
 *
 * 
 * @param {Object} contact Contact to upload, plus cluestrClient
 * @param {Function} cb Callback to call once contacts has been uploaded.
 */
module.exports = function(contact, cluestrClient, cb) {
  console.log("Uploading ", contact.url);
  var identifier = contact.url;
  
  if(contact.deleted) {
    return cluestrClient.deleteDocument(identifier, cb);
  }

  // Build contact "the right way"
  contact = {
    identifier: identifier,
    metadatas: contact,
    actions: {
      'show': contact.url
    }
  };
  delete contact.metadatas.url;
  delete contact.metadatas.id;

  cluestrClient.sendDocument(contact, cb);
};
<commit_msg>Auto set semantic document type to contact<commit_after>'use strict';


/**
 * Upload `contact` (containing contact data) onto Cluestr.
 *
 * 
 * @param {Object} contact Contact to upload, plus cluestrClient
 * @param {Function} cb Callback to call once contacts has been uploaded.
 */
module.exports = function(contact, cluestrClient, cb) {
  console.log("Uploading ", contact.url);
  var identifier = contact.url;
  
  if(contact.deleted) {
    return cluestrClient.deleteDocument(identifier, cb);
  }

  // Build contact "the right way"
  contact = {
    identifier: identifier,
    metadatas: contact,
    semantic_document_type: 'contact',
    actions: {
      'show': contact.url
    }
  };
  delete contact.metadatas.url;
  delete contact.metadatas.id;

  cluestrClient.sendDocument(contact, cb);
};

{'fraction_non_alphanumeric': 0.11772315653298836, 'fraction_numerical': 0.0, 'mean_word_length': 3.702127659574468, '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': '968744', 'n_tokens_mistral': 492, 'n_tokens_neox': 474, 'n_words': 128}