<commit_before>// @flow
import React from 'react'
import {Text, View, ScrollView, StyleSheet} from 'react-native'
import {fastGetTrimmedText} from '../../../lib/html'
import {Cell, Section, TableView} from 'react-native-tableview-simple'
import {Card} from '../../components/card'
import moment from 'moment'
import openUrl from '../../components/open-url'
import Communications from 'react-native-communications'
import * as c from '../../components/colors'
import type {JobType} from './types'

const styles = StyleSheet.create({
  selectable: {
    paddingVertical: 10,
  },
  name: {
    textAlign: 'center',
    marginTop: 20,
    marginBottom: 15,
    paddingHorizontal: 5,
    color: c.black,
    fontSize: 32,
    fontWeight: '300',
  },
  subtitle: {
    textAlign: 'center',
    marginBottom: 15,
    paddingHorizontal: 5,
    color: c.black,
    fontSize: 16,
    fontWeight: '300',
  },
  card: {
    marginBottom: 20,
  },
  cardBody: {
    color: c.black,
    paddingTop: 13,
    paddingBottom: 13,
    paddingLeft: 16,
    paddingRight: 16,
    fontSize: 16,
  },
  lastUpdated: {
    paddingBottom: 20,
  },
  footer: {
    fontSize: 10,
    color: c.iosDisabledText,
    textAlign: 'center',
  },
})

function renderTitle(title: string, category: string) {
  const trimmedTitle = fastGetTrimmedText(title)
  const trimmedDetail = fastGetTrimmedText(category)
  return trimmedTitle || trimmedDetail
    ? <View>
        <Text style={styles.name}>{trimmedTitle}</Text>
        <Text style={styles.subtitle}>{trimmedDetail}</Text>
      </View>
    : null
}

function renderContact(
  title: string,
  office: string,
  contact: string,
  email: string,
) {
  const trimmedOffice = fastGetTrimmedText(office)
  const trimmedContact =
    fastGetTrimmedText(contact) || fastGetTrimmedText(email)
  return trimmedOffice || trimmedContact
    ? <Card header="Contact" style={styles.card}>
        <Text
          style={styles.cardBody}
          onPress={() => openEmail(email, title)}
        >
          {trimmedContact} {email ? `(${fixupEmailFormat(email)})` : ''}
          {'\n'}
          {trimmedOffice}
        </Text>
      </Card>
    : null
}
<commit_msg>don't trim an already trimmed value<commit_after>// @flow
import React from 'react'
import {Text, View, ScrollView, StyleSheet} from 'react-native'
import {fastGetTrimmedText} from '../../../lib/html'
import {Cell, Section, TableView} from 'react-native-tableview-simple'
import {Card} from '../../components/card'
import moment from 'moment'
import openUrl from '../../components/open-url'
import Communications from 'react-native-communications'
import * as c from '../../components/colors'
import type {JobType} from './types'

const styles = StyleSheet.create({
  selectable: {
    paddingVertical: 10,
  },
  name: {
    textAlign: 'center',
    marginTop: 20,
    marginBottom: 15,
    paddingHorizontal: 5,
    color: c.black,
    fontSize: 32,
    fontWeight: '300',
  },
  subtitle: {
    textAlign: 'center',
    marginBottom: 15,
    paddingHorizontal: 5,
    color: c.black,
    fontSize: 16,
    fontWeight: '300',
  },
  card: {
    marginBottom: 20,
  },
  cardBody: {
    color: c.black,
    paddingTop: 13,
    paddingBottom: 13,
    paddingLeft: 16,
    paddingRight: 16,
    fontSize: 16,
  },
  lastUpdated: {
    paddingBottom: 20,
  },
  footer: {
    fontSize: 10,
    color: c.iosDisabledText,
    textAlign: 'center',
  },
})

function renderTitle(title: string, category: string) {
  const trimmedTitle = fastGetTrimmedText(title)
  const trimmedDetail = fastGetTrimmedText(category)
  return trimmedTitle || trimmedDetail
    ? <View>
        <Text style={styles.name}>{trimmedTitle}</Text>
        <Text style={styles.subtitle}>{trimmedDetail}</Text>
      </View>
    : null
}

function renderContact(
  title: string,
  office: string,
  contact: string,
  email: string,
) {
  const trimmedOffice = fastGetTrimmedText(office)
  const trimmedContact =
    fastGetTrimmedText(contact) || email
  return trimmedOffice || trimmedContact
    ? <Card header="Contact" style={styles.card}>
        <Text
          style={styles.cardBody}
          onPress={() => openEmail(email, title)}
        >
          {trimmedContact} {email ? `(${fixupEmailFormat(email)})` : ''}
          {'\n'}
          {trimmedOffice}
        </Text>
      </Card>
    : null
}

{'fraction_non_alphanumeric': 0.1396788990825688, 'fraction_numerical': 0.01651376146788991, 'mean_word_length': 3.0605214152700184, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '5892787', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1361, 'n_words': 337}