<commit_before>#!/usr/bin/env python

# Generate tld rules
# Copyright (C) 2012 Red Hat, Inc.
# Based on tld-parser.c Copyright (C) 2012 Igalia S.L.

import sys

SOUP_TLD_RULE_NORMAL = 0
SOUP_TLD_RULE_MATCH_ALL = 1 << 0
SOUP_TLD_RULE_EXCEPTION = 1 << 1

tlds_file = open(sys.argv[1])
inc_file = open(sys.argv[2], 'w')

first = True
for rule in tlds_file:
    rule = rule.strip()
    if rule == '' or rule.startswith('//'):
        continue<commit_msg>tld-parser.py: Force file io to use utf-8<commit_after>#!/usr/bin/env python

# Generate tld rules
# Copyright (C) 2012 Red Hat, Inc.
# Based on tld-parser.c Copyright (C) 2012 Igalia S.L.

import sys
import codecs

SOUP_TLD_RULE_NORMAL = 0
SOUP_TLD_RULE_MATCH_ALL = 1 << 0
SOUP_TLD_RULE_EXCEPTION = 1 << 1

tlds_file = codecs.open(sys.argv[1], encoding='utf-8')
inc_file = codecs.open(sys.argv[2], 'w', encoding='utf-8')

first = True
for rule in tlds_file:
    rule = rule.strip()
    if rule == '' or rule.startswith('//'):
        continue
{'fraction_non_alphanumeric': 0.13883299798792756, 'fraction_numerical': 0.03319919517102616, 'mean_word_length': 3.7836538461538463, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2319461', 'n_tokens_mistral': 431, 'n_tokens_neox': 398, 'n_words': 103}