<commit_before>#lang racket

;(provide )

#|
This module provides utilities relating to morse code.
|#

(define morse-map
  (list
    (cons "a" ".-")
    (cons "b" "-...")
    (cons "c" "-.-.")
    (cons "d" "-..")
    (cons "e" ".")
    (cons "f" "..-.")
    (cons "g" "--.")
    (cons "h" "....")
    (cons "i" "..")
    (cons "j" ".---")
    (cons "k" "-.-")
    (cons "l" ".-..")
    (cons "m" "--")
    (cons "n" "-.")
    (cons "o" "---")
    (cons "p" ".--.")
    (cons "q" "--.-")
    (cons "r" ".-.")<commit_msg>added assocdr and some convert functions<commit_after>#lang racket

;(provide )

#|
This module provides utilities relating to morse code.
|#

(define (contains-morse (line) (regexp-match contains-morse-pattern line)))

(define (convert (s)
                 (let ([wordlist (string-split s "  ")]
                       [assocdr (lambda (v lst)
                                  (cond
                                    [(null? lst) #f]
                                    [(equal? (cdar lst) v) (caar lst)]
                                    [else (assocdr v (cdr lst))]))]
                       [convert-char (lambda (s) 

; Regex to match a line if line contains morse code.
(define contains-morse-pattern #px"[-. ]{5}")

; Regex to parse out the morse code from a line.
(define get-morse-pattern #px"[-. ]+")

(define morse-map
  (list
    (cons "a" ".-")
    (cons "b" "-...")
    (cons "c" "-.-.")
    (cons "d" "-..")
    (cons "e" ".")
    (cons "f" "..-.")
    (cons "g" "--.")
    (cons "h" "....")
    (cons "i" "..")
    (cons "j" ".---")
    (cons "k" "-.-")
    (cons "l" ".-..")
    (cons "m" "--")
    (cons "n" "-.")
    (cons "o" "---")
    (cons "p" ".--.")
    (cons "q" "--.-")
    (cons "r" ".-.")
{'fraction_non_alphanumeric': 0.25588066551921973, 'fraction_numerical': 0.0005737234652897303, 'mean_word_length': 1.4563380281690141, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1633883', 'n_tokens_mistral': 670, 'n_tokens_neox': 651, 'n_words': 167}