<commit_before>import re
import collections

fileName = "blog-list.md"
headerStub = """
## যাদের ব্লগ থেকে লেখা সংগ্রহ করা হয়েছেঃ

#### ব্লগের তালিকা (লেখকের নামের ক্রমানুসারে):

"""

def main():
    authorNames = getAuthorList()
    sortedNames = collections.OrderedDict(sorted(authorNames.items()))
    writeToFile(sortedNames)


def getAuthorList():
    nameDict = {}
    with open(fileName, "r") as file:
        for line in file:
            nameMatched = re.match(r'^- \[(.*)\]\((.*)\)', line, re.UNICODE)
            if nameMatched:
                nameDict[nameMatched.group(1)] = nameMatched.group(2)
    return nameDict


def writeToFile(sortedNames):
    with open(fileName, "w") as file:
        file.write(headerStub)

        for k, v in sortedNames.items():
            line = "- [{0}]({1})".format(k, v)
            file.write(line + '\n')


if __name__ == '__main__':
    main()<commit_msg>comment added in sorting script<commit_after>#This script helps to create the lexicographic order in the author list file
#How to: Just add a blog link in the existing 'blog-list.md' file and run this script

import re
import collections

fileName = "blog-list.md"

headerStub = """
## যাদের ব্লগ থেকে লেখা সংগ্রহ করা হয়েছেঃ

#### ব্লগের তালিকা (লেখকের নামের ক্রমানুসারে):

"""

def main():
    authorNames = getAuthorList()
    sortedNames = collections.OrderedDict(sorted(authorNames.items()))
    writeToFile(sortedNames)


def getAuthorList():
    nameDict = {}
    with open(fileName, "r") as file:
        for line in file:
            nameMatched = re.match(r'^- \[(.*)\]\((.*)\)', line, re.UNICODE) #Find only the blog links
            if nameMatched:
                nameDict[nameMatched.group(1)] = nameMatched.group(2)
    return nameDict


def writeToFile(sortedNames):
    with open(fileName, "w") as file:
        file.write(headerStub)

        for k, v in sortedNames.items():
            line = "- [{0}]({1})".format(k, v)
            file.write(line + '\n')


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.1670785961443401, 'fraction_numerical': 0.003954522985664854, 'mean_word_length': 2.8998073217726397, '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': '4688384', 'n_tokens_mistral': 788, 'n_tokens_neox': 810, 'n_words': 177}