<commit_before>(ns xebang.apps)

(defn process [bangs ^String raw-query]
  (let [words (.split raw-query " ")
        bang  (-> words first symbol)
        query (->> words
                   (rest)
                   (interpose " ")
                   (apply str))]
      (cond
       (contains? bangs bang) (.replace (bangs bang) "{{{s}}}" query)
       (.startsWith raw-query "!") (.replace "https://duckduckgo.com/?q={{{s}}}" "{{{s}}}" raw-query)
       :else (.replace "https://duckduckgo.com/?q={{{s}}}" "{{{s}}}" raw-query))))

(def catalog
  {'!weather "http://www.weather.com/weather/hourbyhour/graph/{{{s}}}"})<commit_msg>added devdocs.io links for !js !css !html<commit_after>(ns xebang.apps)

(defn process [bangs ^String raw-query]
  (let [words (.split raw-query " ")
        bang  (-> words first symbol)
        query (->> words
                   (rest)
                   (interpose " ")
                   (apply str))]
      (cond
       (contains? bangs bang) (.replace (bangs bang) "{{{s}}}" query)
       (.startsWith raw-query "!") (.replace "https://duckduckgo.com/?q={{{s}}}" "{{{s}}}" raw-query)
       :else (.replace "https://duckduckgo.com/?q={{{s}}}" "{{{s}}}" raw-query))))

(def catalog
  {'!weather "http://www.weather.com/weather/hourbyhour/graph/{{{s}}}"
   '!devdocs "http://devdocs.io/#q={{{s}}}"
   '!js      "http://devdocs.io/#q=js {{{s}}}"
   '!css     "http://devdocs.io/#q=css {{{s}}}"
   '!html    "http://devdocs.io/#q=html {{{s}}}"})
{'fraction_non_alphanumeric': 0.24054054054054055, 'fraction_numerical': 0.0, 'mean_word_length': 2.420323325635104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '2054877', 'n_tokens_mistral': 557, 'n_tokens_neox': 529, 'n_words': 106}