<commit_before>package hmda.parser.institution

import hmda.model.institution._

object InstitutionCsvParser {

  def apply(s: String): Institution = {
    val values = s.split('|').map(_.trim).toList
    val acticityYear = values.head.toInt
    val lei = values(1)
    val agencyCode = values(2).toInt
    val institutionTypeCode = values(3).toInt
    val instId2017 = values(4)
    val taxId = values(5)
    val rssd = values(6).toInt
    val emailDomains = values(7)
    val respondentName = values(8)
    val respondentState = values(9)
    val respondentCity = values(10)
    val parentIdRssd = values(11).toInt
    val parentName = values(12)
    val assets = values(13).toInt
    val otherLenderCode = values(14).toInt
    val topHolderIdRssd = values(15).toInt
    val topHolderName = values(16)
    val hmdaFiler = values(17)

    val emails =
      if (emailDomains.isEmpty) List() else emailDomains.split(',').toList

    Institution(
      acticityYear,
      lei,
      Agency.valueOf(agencyCode.toInt),
      InstitutionType.valueOf(institutionTypeCode),
      if (instId2017 == "") None else Some(instId2017),
      if (taxId == "") None else Some(taxId),
      rssd.toInt,
      emails,
      Respondent(
        if (respondentName == "") None else Some(respondentName),
        if (respondentState == "") None else Some(respondentState),
        if (respondentCity == "") None else Some(respondentCity)
      ),
      Parent(parentIdRssd, if (parentName == "") None else Some(parentName)),
      assets,
      otherLenderCode,
      TopHolder(
        topHolderIdRssd,
        if (topHolderName == "") None else Some(topHolderName)
      ),
      if (hmdaFiler == "") false
      else
        hmdaFiler match {
          case "t" => true
          case _   => false
        }
    )

  }

}<commit_msg>Fix tests<commit_after>package hmda.parser.institution

import hmda.model.institution._

object InstitutionCsvParser {

  def apply(s: String): Institution = {
    val values = s.split('|').map(_.trim).toList
    val acticityYear = values.head.toInt
    val lei = values(1)
    val agencyCode = values(2).toInt
    val institutionTypeCode = values(3).toInt
    val instId2017 = values(4)
    val taxId = values(5)
    val rssd = values(6).toInt
    val emailDomains = values(7)
    val respondentName = values(8)
    val respondentState = values(9)
    val respondentCity = values(10)
    val parentIdRssd = values(11).toInt
    val parentName = values(12)
    val assets = values(13).toInt
    val otherLenderCode = values(14).toInt
    val topHolderIdRssd = values(15).toInt
    val topHolderName = values(16)
    val hmdaFiler = values(17)

    val emails =
      if (emailDomains.isEmpty) List() else emailDomains.split(',').toList

    Institution(
      acticityYear,
      lei,
      Agency.valueOf(agencyCode.toInt),
      InstitutionType.valueOf(institutionTypeCode),
      if (instId2017 == "") None else Some(instId2017),
      if (taxId == "") None else Some(taxId),
      rssd.toInt,
      emails,
      Respondent(
        if (respondentName == "") None else Some(respondentName),
        if (respondentState == "") None else Some(respondentState),
        if (respondentCity == "") None else Some(respondentCity)
      ),
      Parent(parentIdRssd, if (parentName == "") None else Some(parentName)),
      assets,
      otherLenderCode,
      TopHolder(
        topHolderIdRssd,
        if (topHolderName == "") None else Some(topHolderName)
      ),
      if (hmdaFiler == "") false
      else
        hmdaFiler match {
          case "t"     => true
          case "f"     => false
          case "true"  => true
          case "false" => false
          case _       => false
        }
    )

  }

}
{'fraction_non_alphanumeric': 0.11352074966532798, 'fraction_numerical': 0.019812583668005354, 'mean_word_length': 2.595765158806545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '4046314', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1165, 'n_words': 276}