<commit_before>define([
  'discussions',
  'globals',
  'helpers',
  'person',
  'plumbing'
], function(discussions, globals, helpers, person, plumbing) {
  /**
   * @ngdoc overview
   * @name memories
   * @description
   * Functions related to memories
   *
   * {@link https://familysearch.org/developers/docs/api/resources#memories FamilySearch API Docs}
   */

  var maybe = helpers.maybe; // shorthand

  var exports = {};

  /**
   * @ngdoc function
   * @name memories.types:type.MemoryRef
   * @description
   *
   * A {@link memories.types:type.Memory Memory} id and a Memory Persona Id.
   * See {@link memories.functions:getMemoryPersonas getMemoryPersonas} for more information about Memory Personas.
   */
  var MemoryRef = exports.MemoryRef = function(location, personaId) {
    if (personaId) {
      // MemoryRef(memoryId, personaId)
      this.resource = helpers.getAPIServerUrl('/platform/memories/memories/' + location + '/personas/' + personaId);
      this.resourceId = personaId;
    }
    else {
      // MemoryRef(location)
      this.resource = location;
      this.resourceId = helpers.getLastUrlSegment(location);
    }
  };

  exports.MemoryRef.prototype = {
    constructor: MemoryRef,
    /**
     * @ngdoc property
     * @name memories.types:type.MemoryRef#resourceId
     * @propertyOf memories.types:type.MemoryRef
     * @return {String} Id of the Memory Persona to which this person is connected
     */

    /**
     * @ngdoc function
     * @name memories.types:type.MemoryRef#getMemoryId
     * @methodOf memories.types:type.MemoryRef
     * @function
     * @return {String} Id of the memory; pass into {@link memories.functions:getMemory getMemory} for details
     */
    getMemoryId:  function() {
      return this.resource ? this.resource.replace(/^.*\/memories\/([^\/]*)\/personas\/.*$/, '$1') : this.resource; }
  };

  /**
   * @ngdoc function
   * @name memories.functions:getPersonMemoryRefs<commit_msg>remove access token from memory ref<commit_after>define([
  'discussions',
  'globals',
  'helpers',
  'person',
  'plumbing'
], function(discussions, globals, helpers, person, plumbing) {
  /**
   * @ngdoc overview
   * @name memories
   * @description
   * Functions related to memories
   *
   * {@link https://familysearch.org/developers/docs/api/resources#memories FamilySearch API Docs}
   */

  var maybe = helpers.maybe; // shorthand

  var exports = {};

  /**
   * @ngdoc function
   * @name memories.types:type.MemoryRef
   * @description
   *
   * A {@link memories.types:type.Memory Memory} id and a Memory Persona Id.
   * See {@link memories.functions:getMemoryPersonas getMemoryPersonas} for more information about Memory Personas.
   */
  var MemoryRef = exports.MemoryRef = function(location, personaId) {
    if (personaId) {
      // MemoryRef(memoryId, personaId)
      this.resource = helpers.getAPIServerUrl('/platform/memories/memories/' + location + '/personas/' + personaId);
      this.resourceId = personaId;
    }
    else {
      // MemoryRef(location)
      // we must remove the access token in order to pass this into addPersonMemoryRef
      this.resource = location.replace(/\?.*$/, '');
      this.resourceId = helpers.getLastUrlSegment(location);
    }
  };

  exports.MemoryRef.prototype = {
    constructor: MemoryRef,
    /**
     * @ngdoc property
     * @name memories.types:type.MemoryRef#resourceId
     * @propertyOf memories.types:type.MemoryRef
     * @return {String} Id of the Memory Persona to which this person is connected
     */

    /**
     * @ngdoc function
     * @name memories.types:type.MemoryRef#getMemoryId
     * @methodOf memories.types:type.MemoryRef
     * @function
     * @return {String} Id of the memory; pass into {@link memories.functions:getMemory getMemory} for details
     */
    getMemoryId:  function() {
      return this.resource ? this.resource.replace(/^.*\/memories\/([^\/]*)\/personas\/.*$/, '$1') : this.resource; }
  };

  /**
   * @ngdoc function
   * @name memories.functions:getPersonMemoryRefs
{'fraction_non_alphanumeric': 0.13199603764239723, 'fraction_numerical': 0.0004952947003467063, 'mean_word_length': 3.088056680161943, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7271430', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1209, 'n_words': 279}