<commit_before><commit_msg>missing file<commit_after>const titleProperties = {
  'general.person': [
    'general.lastname',
    'general.firstname'
  ],
  'general.location': [
    'general.address'
  ],
  'general.case': [
    'publicsafety.case'
  ]
};

export default class EntityTypeTitles {

  static getFqn(edmObj) {
    return `${edmObj.type.namespace}.${edmObj.type.name}`;
  }

  static getTitleProps(entityType) {
    return titleProperties[this.getFqn(entityType)];
  }

  static getFormattedRow(row, propertyTypes) {
    if (Object.keys(row)[0].includes('.')) return row;
    const convertedRow = {};
    propertyTypes.forEach((propertyType) => {
      if (row[propertyType.id]) convertedRow[this.getFqn(propertyType)] = row[propertyType.id];
    });
    return convertedRow;
  }

  static getTitle(entityType, row, propertyTypes) {
    const formattedRow = this.getFormattedRow(row, propertyTypes);
    const titleValues = titleProperties[this.getFqn(entityType)].map((propertyTypeFqn) => {
      return formattedRow[propertyTypeFqn];
    });
    if (titleValues.length === 0) return `[${entityType.title}]`;
    return titleValues.join(', ');
  }
}
{'fraction_non_alphanumeric': 0.15047291487532244, 'fraction_numerical': 0.0017196904557179708, 'mean_word_length': 4.173333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '900832', 'n_tokens_mistral': 389, 'n_tokens_neox': 374, 'n_words': 58}