<commit_before>#!/usr/bin/env python
#to-braille - converts text to English Braile. encoding=utf8

import sys, re

def dot(s):
  '''
  convert a string of "dots" to a braille character.

  Does not expect multiple characters to be described by the dots. 
  DOES work for 8bit dots (i.e. European Braille).
  '''
  if type(s) == int:
    s = str(s)

  num = 0x2800
  for n in (1,2,3,4,5,6,7,8):
    if str(n) in s:
      num |= 2**(n-1)

  return unichr(num)

def dots(s):
  '''
  convert a sequence of Braille dot patterns (string) to the
  corresponding Braille characters. NOTE: The dots for each cell must be
  separated by whitespace.
  '''
  res = ''
  for word in s.split():
    res += dot(word)

  return res

class brl:
  '''
  Assortment of string constants, each of which is a Braille cell.
  Unlike the other strings, these do not correspond to Latin letters, or
  the numerals.
  '''
  capital = dot(6)<commit_msg>dots() now allows multiple word in/output<commit_after>#!/usr/bin/env python
#to-braille - converts text to English Braile. encoding=utf8

import sys, re

def dot(s):
  '''
  convert a string of "dots" to a braille character.

  Does not expect multiple characters to be described by the dots. 
  DOES work for 8bit dots (i.e. European Braille).
  '''
  if type(s) == int:
    s = str(s)

  num = 0x2800
  for n in (1,2,3,4,5,6,7,8):
    if str(n) in s:
      num |= 2**(n-1)

  return unichr(num)

def dots(s):
  '''
  convert a sequence of Braille dot patterns (string) to the
  corresponding Braille characters. NOTE: The dots for each cell must be
  separated by a single space. To include a literal space, use two dots
  instead.
  '''
  res = ''
  for word in s.split(' '):
    if word:
      res += dot(word)
    else:
      res += ' '

  return res

class brl:
  '''
  Assortment of string constants, each of which is a Braille cell.
  Unlike the other strings, these do not correspond to Latin letters, or
  the numerals.
  '''
  capital = dot(6)
{'fraction_non_alphanumeric': 0.11055022715800102, 'fraction_numerical': 0.01817264008076729, 'mean_word_length': 2.9403578528827037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2514316', 'n_tokens_mistral': 703, 'n_tokens_neox': 664, 'n_words': 269}