<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import { needsUnicodeFont } from '../util/unicode'

const MAX_STREET_NAME_WIDTH = 50

export default class StreetName extends React.PureComponent {
  /**
   * Some processing needed to display street name
   *
   * @public for main street name ¯\_(ツ)_/¯
   * @params {string} name - Street name to check
   */
  static normalizeStreetName (name) {
    if (!name) {
      return ''
    }

    name = name.trim()

    if (name.length > MAX_STREET_NAME_WIDTH) {
      name = name.substr(0, MAX_STREET_NAME_WIDTH) + '…'
    }

    return name
  }

  render () {
    let classString = 'street-name-text ' + (!needsUnicodeFont(this.props.name) ? '' : 'fallback-unicode-font')

    return (
      <div
        ref={(ref) => { this.el = ref }}
        className='street-name'
        {...this.props}
      >
        <div className={classString}>{StreetName.normalizeStreetName(this.props.name)}</div>
      </div>
    )
  }
}

StreetName.propTypes = {
  name: PropTypes.string.isRequired
}<commit_msg>Further simply StreetName (remove unused code)<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import { needsUnicodeFont } from '../util/unicode'

const MAX_STREET_NAME_WIDTH = 50

export default class StreetName extends React.PureComponent {
  /**
   * Some processing needed to display street name
   *
   * @public for main street name ¯\_(ツ)_/¯
   * @params {string} name - Street name to check
   */
  static normalizeStreetName (name) {
    if (!name) return ''

    name = name.trim()

    if (name.length > MAX_STREET_NAME_WIDTH) {
      name = name.substr(0, MAX_STREET_NAME_WIDTH) + '…'
    }

    return name
  }

  render () {
    let classString = 'street-name-text ' + (!needsUnicodeFont(this.props.name) ? '' : 'fallback-unicode-font')

    return (
      <div className='street-name' {...this.props}>
        <div className={classString}>{StreetName.normalizeStreetName(this.props.name)}</div>
      </div>
    )
  }
}

StreetName.propTypes = {
  name: PropTypes.string.isRequired
}
{'fraction_non_alphanumeric': 0.1333014811275681, 'fraction_numerical': 0.002866698518872432, 'mean_word_length': 2.9885714285714284, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '3815368', 'n_tokens_mistral': 711, 'n_tokens_neox': 674, 'n_words': 156}