<commit_before># coding=utf8

import os
import re
from itertools import chain
from difflib import get_close_matches
from collections import namedtuple

import pyfribidi

from util import flatten
from textutil import reverse_numbers, asblocks, fix_superscripts
from pdftools import pdftotext, pdfinfo

def readable(txt):
    if isinstance(txt, list):
        txt = '\n'.join(txt)
    return '\n'.join([pyfribidi.log2vis(unicode(l)) for l in txt.split('\n')])

def show_blocks(bs):
    return readable(flatten(zip(bs, ['\n']*len(bs))))
def show_block(bs):
    return readable(bs)<commit_msg>remove dependancy on pyfribidi in parsing gov bill code.<commit_after># coding=utf8

import os
import re
from itertools import chain
from difflib import get_close_matches
from collections import namedtuple

#import pyfribidi

from util import flatten
from textutil import reverse_numbers, asblocks, fix_superscripts
from pdftools import pdftotext, pdfinfo

def readable(txt):
    if isinstance(txt, list):
        txt = '\n'.join(txt)
    #return '\n'.join([pyfribidi.log2vis(unicode(l)) for l in txt.split('\n')])
    return '\n'.join([unicode(l) for l in txt.split('\n')])

def show_blocks(bs):
    return readable(flatten(zip(bs, ['\n']*len(bs))))
def show_block(bs):
    return readable(bs)
{'fraction_non_alphanumeric': 0.11457521434138737, 'fraction_numerical': 0.003117692907248636, 'mean_word_length': 5.056603773584905, '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': '4560398', 'n_tokens_mistral': 430, 'n_tokens_neox': 423, 'n_words': 127}