<commit_before>module ProteinTranslation(proteins) where

import Data.List (unfoldr)

proteins :: String -> Maybe [String]
proteins = Just . takeWhile (not . null) . map protein . chunks 3

protein :: String -> String
protein "AUG" = "Methionine"
protein "UUU" = "Phenylalanine"
protein "UUC" = "Phenylalanine"
protein "UUA" = "Leucine"
protein "UUG" = "Leucine"
protein "UCU" = "Serine"
protein "UCC" = "Serine"
protein "UCA" = "Serine"
protein "UCG" = "Serine"
protein "UAU" = "Tyrosine"
protein "UAC" = "Tyrosine"
protein "UGU" = "Cysteine"
protein "UGC" = "Cysteine"
protein "UGG" = "Tryptophan"
protein "UAA" = []
protein "UAG" = []
protein "UGA" = []

chunks :: Int -> [a] -> [[a]]
chunks n = takeWhile (not . null) . unfoldr (Just . splitAt n)<commit_msg>used guards to remove duplication of certain proteins<commit_after>module ProteinTranslation(proteins) where

import Data.List (unfoldr)

proteins :: String -> Maybe [String]
proteins = Just . takeWhile (not . null) . map protein . chunks 3

protein :: String -> String
protein chunk
  | chunk == "AUG" = "Methionine"
  | chunk == "UGG" = "Tryptophan"
  | chunk `elem` ["UUU", "UUC"] = "Phenylalanine"
  | chunk `elem` ["UUA", "UUG"] = "Leucine"
  | chunk `elem` ["UCU", "UCC", "UCA", "UCG"] = "Serine"
  | chunk `elem` ["UAU", "UAC"] = "Tyrosine"
  | chunk `elem` ["UGU", "UGC"] = "Cysteine"
  | chunk `elem` ["UAA", "UAG", "UGA"] = []

chunks :: Int -> [a] -> [[a]]
chunks n = takeWhile (not . null) . unfoldr (Just . splitAt n)
{'fraction_non_alphanumeric': 0.1863270777479893, 'fraction_numerical': 0.0013404825737265416, 'mean_word_length': 4.275618374558304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3627643', 'n_tokens_mistral': 608, 'n_tokens_neox': 554, 'n_words': 164}