<commit_before>(ns engine.devel.rope
  (:use engine.data.rope
        lacij.graph.core lacij.graph.svg.graph lacij.layouts.layout
        [engine.core :only [defdispatcher]])
  (:require [clojure.zip :as zip])
  (:import java.io.StringWriter
           javax.xml.transform.dom.DOMSource
           javax.xml.transform.stream.StreamResult
           javax.xml.transform.TransformerFactory))

(def *pdf-example* (rope "a" (rope "bc" (rope "d" "ef"))))

(defn svgdoc->string ; this thing is definitely missing in lacij
  [doc & options]
  (let [src (DOMSource. doc)
        writer (StringWriter.)
        result (StreamResult. writer)
        xformer (.newTransformer (TransformerFactory/newInstance))
        options (apply hash-map options)]
    (doseq [[k v] options]
      (.setOutputProperty xformer (name k) v))
    (.transform xformer src result)
    (.toString writer)))<commit_msg>no earmuffs<commit_after>(ns engine.devel.rope
  (:use engine.data.rope
        lacij.graph.core lacij.graph.svg.graph lacij.layouts.layout
        [engine.core :only [defdispatcher]])
  (:require [clojure.zip :as zip])
  (:import java.io.StringWriter
           javax.xml.transform.dom.DOMSource
           javax.xml.transform.stream.StreamResult
           javax.xml.transform.TransformerFactory))

(def pdf-example (rope "a" (rope "bc" (rope "d" "ef"))))

(defn svgdoc->string ; this thing is definitely missing in lacij
  [doc & options]
  (let [src (DOMSource. doc)
        writer (StringWriter.)
        result (StreamResult. writer)
        xformer (.newTransformer (TransformerFactory/newInstance))
        options (apply hash-map options)]
    (doseq [[k v] options]
      (.setOutputProperty xformer (name k) v))
    (.transform xformer src result)
    (.toString writer)))
{'fraction_non_alphanumeric': 0.12768361581920903, 'fraction_numerical': 0.0, 'mean_word_length': 3.025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '5970596', 'n_tokens_mistral': 568, 'n_tokens_neox': 553, 'n_words': 140}