<commit_before>#!/usr/bin/python

"""
DNA representation of 256-ASCII Character Encoding

<NAME>
15 July 2013
Updated 16 July 2013

DNA is represented alphabetically as base 4:
    A - 0
    C - 1
    G - 2
    T - 3
    
4-base codons will be used to represent the 256 Extended ASCII encodings

"""

import itertools

"""======================================================================="""

"""Variables for language translation"""
"""
basevals = {'A':0,
            'C':1,
            'G':2,
            'T':3}
"""            
basevals = {'T':0,
            'A':1,
            'G':2,
            'C':3}
bases = ['A','C','G','T']
# retrieve all length 4 dna base strings
codons = []
CODONSIZE = 4
for lst in list(itertools.product(bases, repeat=CODONSIZE)):
    final = ''
    # using itertools.product, seqlst looks like 
    # [['A','A','A','A',],['A','A','A','T'],['A','A','A','G'],...] 
    # convert each sublist into a string like
    # ['AAAA','AAAT','AAAG',...]
    for base in lst:
        final += base
    codons.append(final)<commit_msg>minor documentation changes<commit_after>#!/usr/bin/python

"""
DNA representation of 256-ASCII Character Encoding

<NAME>
15 July 2013
Updated 17 July 2013

DNA is represented alphabetically as base 4:
    A - 0
    C - 1
    G - 2
    T - 3
    
4-base codons will be used to represent the 256 Extended ASCII encodings

"""

import itertools

"""======================================================================="""

"""Variables for language translation"""

# TEMPORARY FIX, SHOULD FOCUS ON UNIFORM MAPPING OF CHARACTERS
"""
basevals = {'A':0,
            'C':1,
            'G':2,
            'T':3}
"""            
basevals = {'T':0,
            'A':1,
            'G':2,
            'C':3}
bases = ['A','C','G','T']
# retrieve all length 4 dna base strings
codons = []
CODONSIZE = 4
for lst in list(itertools.product(bases, repeat=CODONSIZE)):
    final = ''
    # using itertools.product, seqlst looks like 
    # [['A','A','A','A',],['A','A','A','T'],['A','A','A','G'],...] 
    # convert each sublist into a string like
    # ['AAAA','AAAT','AAAG',...]
    for base in lst:
        final += base
    codons.append(final)
{'fraction_non_alphanumeric': 0.2310502283105023, 'fraction_numerical': 0.031050228310502283, 'mean_word_length': 2.7261904761904763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1145832', 'n_tokens_mistral': 784, 'n_tokens_neox': 706, 'n_words': 204}