<commit_before>kd = require 'kd'
_  = require 'lodash'
facade = require('./accounteditshortcutsfacade')
EventType = require './accounteditshortcutseventtype'
globals = require 'globals'

# Class name to set for duplicate/colliding items.
DUP_CLASS_NAME = 'collides'

# The maximum description string length.
DESCRIPTION_TRUNC_LEN = 30

# The separator pattern to truncate to.
DESCRIPTION_TRUNC_SEP = ' '

# On Mac we display corresponding unicode chars for the following keys.
MAC_UNICODE =
  shift   : '&#x21E7;'
  command : '&#x2318;'
  alt     : '&#x2325;'
  ctrl    : '^'

# Determines the text conversion method to use when displaying bindings.
convertCase = _.capitalize

# Generates a compiled template function.
renderBinding =
  _.template '<% _.forEach(keys, function (key) { %><span><%= key %></span><% }) %>'

# Returns a html string presentation for the given binding array or string.
#
presentBinding = (keys) ->

  if _.isString keys then keys = keys.split '+'

  renderBinding keys:
    if globals.os isnt 'mac'
    then _.map keys, (value) -> convertCase value
    else _.map keys, (value) -> MAC_UNICODE[value] or convertCase value<commit_msg>account/shortcuts: add missing unicode symbols for mac<commit_after>kd = require 'kd'
_  = require 'lodash'
facade = require('./accounteditshortcutsfacade')
EventType = require './accounteditshortcutseventtype'
globals = require 'globals'

# Class name to set for duplicate/colliding items.
DUP_CLASS_NAME = 'collides'

# The maximum description string length.
DESCRIPTION_TRUNC_LEN = 30

# The separator pattern to truncate to.
DESCRIPTION_TRUNC_SEP = ' '

# On Mac we display corresponding unicode chars for the following keys.
# See: http://macbiblioblog.blogspot.nl/2005/05/special-key-symbols.html
#
MAC_UNICODE =
  shift       : '&#x21E7;'
  command     : '&#x2318;'
  alt         : '&#x2325;'
  ctrl        : '&#x2303'
  tab         : '&#x21e5'
  'caps lock' : '&#x21ea'
  space       : '&#x2423'
  enter       : '&#x23ce'
  backspace   : '&#x232b'
  home        : '&#x21f1'
  end         : '&#x21f2'
  'page up'   : '&#x21de'
  'page down' : '&#x21df'
  left        : '&#x2190'
  up          : '&#x2191'
  right       : '&#x2192'
  down        : '&#x2193'
  esc         : '&#x238b'
  'num lock'  : '&#x21ed'

# Determines the text conversion method to use when displaying bindings.
convertCase = _.capitalize

# Generates a compiled template function.
renderBinding =
  _.template '<% _.forEach(keys, function (key) { %><span><%= key %></span><% }) %>'

# Returns a html string presentation for the given binding array or string.
#
presentBinding = (keys) ->

  if _.isString keys then keys = keys.split '+'

  renderBinding keys:
    if globals.os isnt 'mac'
    then _.map keys, (value) -> convertCase value
    else _.map keys, (value) -> MAC_UNICODE[value] or convertCase value
{'fraction_non_alphanumeric': 0.1270175438596491, 'fraction_numerical': 0.028421052631578948, 'mean_word_length': 3.4270186335403725, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '4551394', 'n_tokens_mistral': 1019, 'n_tokens_neox': 951, 'n_words': 282}