<commit_before>(in-package #:eloquent.mvc.router)

(defun components-to-rules (components)
  (map-components #'(lambda (method uri-template action)
                      (let ((action (eloquent.mvc.prelude:find-symbol* action))
                            (method (eloquent.mvc.prelude:make-keyword method)))
                        (make-instance '<rule>
                                     :action action
                                     :method method
                                     :uri-template uri-template)))
                  components))

(defun map-components (function components)<commit_msg>The symbol of action in router must be exported<commit_after>(in-package #:eloquent.mvc.router)

(defun components-to-rules (components)
  (map-components #'(lambda (method uri-template action)
                      (let ((action (find-action action))
                            (method (eloquent.mvc.prelude:make-keyword method)))
                        (make-instance '<rule>
                                     :action action
                                     :method method
                                     :uri-template uri-template)))
                  components))

(defun find-action (action)
  (declare (type string action))
  (multiple-value-bind (symbol status)
      (eloquent.mvc.prelude:find-symbol* action)
    (assert (eq status :external))
    symbol))

(defun map-components (function components)
{'fraction_non_alphanumeric': 0.10222531293463143, 'fraction_numerical': 0.0, 'mean_word_length': 1.5927927927927927, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1165465', 'n_tokens_mistral': 367, 'n_tokens_neox': 351, 'n_words': 84}