<commit_before>package lv.latcraft.utils

import groovy.transform.CompileStatic
import groovy.transform.TypeChecked

@CompileStatic
@TypeChecked
class SanitizationMethods {

  static final String LV_CHARS = 'āēūīķņčžš'
  static final String TR_CHARS = 'aeuiknczs'

  static String transliterateLatvianLetters(String name) {
    name?.toString()?.tr(LV_CHARS, TR_CHARS)
  }

  static String sanitizeName(String name) {
    name.
      trim().
      split('\\s+').
      collect { String part -> part.trim().capitalize() }.
      join(' ')
  }

  static String sanitizeCompany(String company) {
    sanitizeName(
      company.
        replaceAll('n/a', '').
        replaceAll('LV', '').
        replaceAll('Intelligent Technologies', 'IT').<commit_msg>added LV char transliteration<commit_after>package lv.latcraft.utils

import groovy.transform.CompileStatic
import groovy.transform.TypeChecked

@CompileStatic
@TypeChecked
class SanitizationMethods {

  static final String LV_CHARS = 'āēūīķņčžšļõģŗ'
  static final String TR_CHARS = 'aeuiknczslogr'

  static String transliterateLatvianLetters(String name) {
    name?.toString()?.tr(LV_CHARS, TR_CHARS)
  }

  static String sanitizeName(String name) {
    name.
      trim().
      split('\\s+').
      collect { String part -> part.trim().capitalize() }.
      join(' ')
  }

  static String sanitizeCompany(String company) {
    sanitizeName(
      company.
        replaceAll('n/a', '').
        replaceAll('LV', '').
        replaceAll('Intelligent Technologies', 'IT').
{'fraction_non_alphanumeric': 0.12041884816753927, 'fraction_numerical': 0.0, 'mean_word_length': 3.4447674418604652, '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': '2494770', 'n_tokens_mistral': 512, 'n_tokens_neox': 486, 'n_words': 100}