def get_chars_hashed_by_yoffset(csv_reader, precision, pages=None):
    """ Hash the characters by the y-offset height rounded to [precision] decimals. """ 
    line_hash = {}
    
    for i, row in enumerate(csv_reader):
        if pages:
            if int(row['pageid']) not in pages:
                continue
        
        if row['object_type'] == 'char':
            
            y_rounded = round(float(row['y0']), precision)

            hash_key = "%s@%s" % (row['pageid'], y_rounded)
            try:
                line_hash[hash_key]['count'] += 1
                line_hash[hash_key]['chars'].append(row)

            except KeyError:
                line_hash[hash_key] = {'count':1, 'chars':[row]}
 
    return line_hash