<commit_before>(in-package :lem-capi)

(defun shift-bit-p (modifiers)
  (/= 0 (logand modifiers sys:gesture-spec-shift-bit)))

(defun control-bit-p (modifiers)
  (/= 0 (logand modifiers sys:gesture-spec-control-bit)))

(defun meta-bit-p (modifiers)
  (/= 0 (logand modifiers sys:gesture-spec-meta-bit)))

(defparameter *data-sym-table*
  (alexandria:alist-hash-table
   `((,(char-code #\Return) . "Return")
     (,(char-code #\Tab) . "Tab")
     (,(char-code #\Escape) . "Escape")
     (,(char-code #\Backspace) . "Backspace")
     (,(char-code #\Space) . "Space")
     (:next . "PageDown")
     (:prior . "PageUp"))))

(defparameter *keyboard-table*
  (alexandria:plist-hash-table
   (list #\1 #\!
         #\2 #\"
         #\3 #\#
         #\4 #\$
         #\5 #\%
         #\6 #\&
         #\7 #\'
         #\8 #\(
         #\9 #\)
         #\- #\=
         #\^ #\~
         #\\ #\|
         #\@ #\`
         #\[ #\{
         #\; #\+
         #\: #\*
         #\] #\}
         #\, #\<
         #\. #\>
         #\/ #\?
         #\\ #\_)))

(defun convert-gesture-spec-data (data shiftp)
  (cond ((not shiftp)
         (values data nil))
        ((alpha-char-p (code-char data))
         (values (char-upcase (code-char data)) nil))
        (t<commit_msg>tweak<commit_after>(in-package :lem-capi)

(defun shift-bit-p (modifiers)
  (/= 0 (logand modifiers sys:gesture-spec-shift-bit)))

(defun control-bit-p (modifiers)
  (/= 0 (logand modifiers sys:gesture-spec-control-bit)))

(defun meta-bit-p (modifiers)
  (/= 0 (logand modifiers sys:gesture-spec-meta-bit)))

(defparameter *data-sym-table*
  (alexandria:alist-hash-table
   `((,(char-code #\Return) . "Return")
     (,(char-code #\Tab) . "Tab")
     (,(char-code #\Escape) . "Escape")
     (,(char-code #\Backspace) . "Backspace")
     (,(char-code #\Space) . "Space")
     (:next . "PageDown")
     (:prior . "PageUp"))))

(defparameter *keyboard-table*
  (alexandria:plist-hash-table
   (list #\1 #\!
         #\2 #\"
         #\3 #\#
         #\4 #\$
         #\5 #\%
         #\6 #\&
         #\7 #\'
         #\8 #\(
         #\9 #\)
         #\- #\=
         #\^ #\~
         #\\ #\_
         #\@ #\`
         #\[ #\{
         #\; #\+
         #\: #\*
         #\] #\}
         #\, #\<
         #\. #\>
         #\/ #\?
         #\\ #\_)))

(defun convert-gesture-spec-data (data shiftp)
  (cond ((not shiftp)
         (values data nil))
        ((alpha-char-p (code-char data))
         (values (char-upcase (code-char data)) nil))
        (t
{'fraction_non_alphanumeric': 0.23583399840383082, 'fraction_numerical': 0.009577015163607342, 'mean_word_length': 1.5765673175745119, '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': '1748235', 'n_tokens_mistral': 1012, 'n_tokens_neox': 963, 'n_words': 153}