<commit_before>(in-package :lem)

(defun buffer-end (buffer)
  (make-marker buffer
               (point-max buffer)
               :kind :temporary))

(defun eobp/marker (marker)
  (marker= marker
           (buffer-end (marker-buffer marker))))

(defun line-offset (marker n)
  (line-start marker)
  (if (plusp n)
      (dotimes (_ n (values marker t))
        (when (last-line-p marker)
          (return (values (line-end marker) nil)))
        (incf (marker-linum marker)))
      (dotimes (_ (- n) (values marker t))
        (when (first-line-p marker)
          (return (values marker nil)))
        (decf (marker-linum marker)))))

(defun points-to-string (start-marker end-marker)
  (region-string (marker-point start-marker)
                 (marker-point end-marker)))<commit_msg>バッファの指定を忘れていた<commit_after>(in-package :lem)

(defun buffer-end (buffer)
  (make-marker buffer
               (point-max buffer)
               :kind :temporary))

(defun eobp/marker (marker)
  (marker= marker
           (buffer-end (marker-buffer marker))))

(defun line-offset (marker n)
  (line-start marker)
  (if (plusp n)
      (dotimes (_ n (values marker t))
        (when (last-line-p marker)
          (return (values (line-end marker) nil)))
        (incf (marker-linum marker)))
      (dotimes (_ (- n) (values marker t))
        (when (first-line-p marker)
          (return (values marker nil)))
        (decf (marker-linum marker)))))

(defun points-to-string (start-marker end-marker)
  (assert (eq (marker-buffer start-marker)
              (marker-buffer end-marker)))
  (region-string (marker-point start-marker)
                 (marker-point end-marker)
                 (marker-buffer start-marker)))
{'fraction_non_alphanumeric': 0.1413551401869159, 'fraction_numerical': 0.0, 'mean_word_length': 2.345703125, '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': '3282320', 'n_tokens_mistral': 543, 'n_tokens_neox': 541, 'n_words': 143}