From bd7b278820762882454768cc98595400b11ea01e Mon Sep 17 00:00:00 2001 From: Christian Egli Date: Mon, 7 Oct 2024 17:38:32 +0200 Subject: [PATCH] Fix a lot of linter warnings --- src/clj/daisyproducer2/db/core.clj | 8 ++--- src/clj/daisyproducer2/documents/abacus.clj | 20 +++++------ .../daisyproducer2/documents/documents.clj | 4 +-- .../documents/metadata_validation.clj | 6 ++-- .../documents/preview/dtbook2sbsform.clj | 4 +-- src/clj/daisyproducer2/hyphenate.clj | 4 +-- src/clj/daisyproducer2/hyphenations.clj | 2 +- src/clj/daisyproducer2/louis.clj | 7 ++-- src/clj/daisyproducer2/pipeline1.clj | 14 ++++---- src/clj/daisyproducer2/pipeline2/core.clj | 2 +- src/clj/daisyproducer2/pipeline2/scripts.clj | 6 ++-- src/clj/daisyproducer2/routes/services.clj | 36 +++++++++---------- .../daisyproducer2/whitelists/hyphenation.clj | 20 +++++------ src/clj/daisyproducer2/whitelists/tables.clj | 8 ++--- src/clj/daisyproducer2/words.clj | 12 +++---- src/clj/daisyproducer2/words/local.clj | 4 +-- src/clj/daisyproducer2/words/unknown.clj | 20 +++++------ .../daisyproducer2/documents/document.cljs | 21 ++++++----- src/cljs/daisyproducer2/documents/image.cljs | 8 ++--- src/cljs/daisyproducer2/documents/markup.cljs | 27 +++++++------- .../daisyproducer2/documents/product.cljs | 1 - .../daisyproducer2/documents/version.cljs | 8 ++--- src/cljs/daisyproducer2/events.cljs | 3 +- src/cljs/daisyproducer2/hyphenations.cljs | 6 ++-- src/cljs/daisyproducer2/words/confirm.cljs | 13 +++---- src/cljs/daisyproducer2/words/global.cljs | 12 +++---- src/cljs/daisyproducer2/words/local.cljs | 17 ++++----- .../daisyproducer2/words/notifications.cljs | 29 ++++++++------- src/cljs/daisyproducer2/words/unknown.cljs | 8 ++--- .../test/abacus_import/properties_test.clj | 10 +++--- test/clj/daisyproducer2/test/words_test.clj | 4 +-- 31 files changed, 165 insertions(+), 179 deletions(-) diff --git a/src/clj/daisyproducer2/db/core.clj b/src/clj/daisyproducer2/db/core.clj index 75a31786..42bf0308 100644 --- a/src/clj/daisyproducer2/db/core.clj +++ b/src/clj/daisyproducer2/db/core.clj @@ -2,7 +2,7 @@ (:require [next.jdbc.date-time] [next.jdbc.result-set] - [clojure.string :as string] + [clojure.string :as str] [clojure.tools.logging :as log] [conman.core :as conman] [camel-snake-kebab.extras :refer [transform-keys]] @@ -29,9 +29,9 @@ (let [prepend #(str %2 %1) append #(str %1 %2)] (cond-> s - (not (string/starts-with? s "^")) (prepend "%") - (not (string/ends-with? s "$")) (append "%") - true (string/replace #"[$^]" "")))) + (not (str/starts-with? s "^")) (prepend "%") + (not (str/ends-with? s "$")) (append "%") + true (str/replace #"[$^]" "")))) (defn get-generated-key "Extract the generated key from the return value of an insert statement. diff --git a/src/clj/daisyproducer2/documents/abacus.clj b/src/clj/daisyproducer2/documents/abacus.clj index 3f35d457..7a03afd8 100644 --- a/src/clj/daisyproducer2/documents/abacus.clj +++ b/src/clj/daisyproducer2/documents/abacus.clj @@ -9,7 +9,7 @@ (:require [clojure.data.zip.xml :refer [text xml1->]] [clojure.java.io :as io] [clojure.spec.alpha :as s] - [clojure.string :as string] + [clojure.string :as str] [clojure.tools.logging :as log] [clojure.xml :as xml] [clojure.zip :as zip] @@ -25,7 +25,7 @@ [medley.core :as medley])) (s/def ::product-number (s/and string? #(re-matches #"^(PS|GD|EB|ET)\d{4,7}$" %))) -(s/def ::isbn (s/and string? (fn [s] (or (string/blank? s) (re-matches #"^SBS[0-9]{6}|(?:978-|979-)?\d{1,5}-\d{1,7}-\d{1,6}-[0-9xX]" s))))) +(s/def ::isbn (s/and string? (fn [s] (or (str/blank? s) (re-matches #"^SBS[0-9]{6}|(?:978-|979-)?\d{1,5}-\d{1,7}-\d{1,6}-[0-9xX]" s))))) (def ^:private root-path [:Task :Transaction :DocumentData]) @@ -50,8 +50,8 @@ (cond (not= production-series-number "0") "PPP" (and (= production-series-number "0") - (not (string/blank? reihe)) - (string/includes? reihe "SJW")) "SJW" + (not (str/blank? reihe)) + (str/includes? reihe "SJW")) "SJW" :else "")) (defn- production-series-number @@ -59,20 +59,20 @@ (cond (not= production-series-number "0") production-series-number (and (= production-series-number "0") - (not (string/blank? reihe)) - (string/includes? reihe "SJW")) (re-find #"\d+" reihe) + (not (str/blank? reihe)) + (str/includes? reihe "SJW")) (re-find #"\d+" reihe) :else "")) (defn- source [{:keys [source]}] (cond - (string/blank? source) "" + (str/blank? source) "" (= source "keine") "" :else source)) (defn- product-type [{:keys [product-number]}] - (condp #(string/starts-with? %2 %1) product-number + (condp #(str/starts-with? %2 %1) product-number "PS" :braille "GD" :large-print "EB" :ebook @@ -101,8 +101,8 @@ (assoc :production-series production-series) (assoc :production-series-number production-series-number) (cond-> product-type (assoc :product-type product-type)) - (cond-> (not (string/blank? verkaufstext)) (assoc :author (-> verkaufstext (string/split #"\[xx\]") first string/trim))) - (cond-> (not (string/blank? verkaufstext)) (assoc :title (-> verkaufstext (string/split #"\[xx\]") second string/trim)))))) + (cond-> (not (str/blank? verkaufstext)) (assoc :author (-> verkaufstext (str/split #"\[xx\]") first str/trim))) + (cond-> (not (str/blank? verkaufstext)) (assoc :title (-> verkaufstext (str/split #"\[xx\]") second str/trim)))))) (defn extract-value "Extract values from a `zipper` from an ABACUS export file for `key`" diff --git a/src/clj/daisyproducer2/documents/documents.clj b/src/clj/daisyproducer2/documents/documents.clj index cd6cc103..9525a9f0 100644 --- a/src/clj/daisyproducer2/documents/documents.clj +++ b/src/clj/daisyproducer2/documents/documents.clj @@ -1,6 +1,6 @@ (ns daisyproducer2.documents.documents (:require [babashka.fs :as fs] - [clojure.string :as string] + [clojure.string :as str] [daisyproducer2.config :refer [env]] [daisyproducer2.db.core :as db] [daisyproducer2.metrics :as metrics] @@ -25,7 +25,7 @@ (defn get-document-for-source-or-title-and-source-edition [{:keys [source title source-edition] :as params}] - (or (and source (not (string/blank? source)) (db/get-document-for-source params)) + (or (and source (not (str/blank? source)) (db/get-document-for-source params)) (and title source-edition (db/get-document-for-title-and-source-edition params)))) (defn initialize-document diff --git a/src/clj/daisyproducer2/documents/metadata_validation.clj b/src/clj/daisyproducer2/documents/metadata_validation.clj index 5d59d8b5..60a26b82 100644 --- a/src/clj/daisyproducer2/documents/metadata_validation.clj +++ b/src/clj/daisyproducer2/documents/metadata_validation.clj @@ -1,7 +1,7 @@ (ns daisyproducer2.documents.metadata-validation "Validate the metadata of DTBook XML files" (:require [clojure.java.io :as io] - [clojure.string :as string] + [clojure.string :as str] [clojure.xml :as xml] [clojure.zip :as zip] [clojure.data.zip.xml :refer [xml1-> attr= attr text]]) @@ -61,9 +61,9 @@ "Return an error message for `key` that has the value `expected` instead of the values in `actuals`" [key expected actuals] - (let [name (string/capitalize (name key))] + (let [name (str/capitalize (name key))] (str name " should be '" expected "' instead of " - (string/join + (str/join " and " (map #(if (some? %) (str "'" % "'") "undefined") actuals))))) diff --git a/src/clj/daisyproducer2/documents/preview/dtbook2sbsform.clj b/src/clj/daisyproducer2/documents/preview/dtbook2sbsform.clj index 7d637a82..0329ed26 100644 --- a/src/clj/daisyproducer2/documents/preview/dtbook2sbsform.clj +++ b/src/clj/daisyproducer2/documents/preview/dtbook2sbsform.clj @@ -6,7 +6,7 @@ (:require [babashka.fs :as fs] [babashka.process :as process] - [clojure.string :as string] + [clojure.string :as str] [clojure.tools.logging :as log] [clojure.java.io :as io])) @@ -49,7 +49,7 @@ (defn- stringify-opts [[k v]] - (let [opt-key (string/replace (name k) #"-" "_")] + (let [opt-key (str/replace (name k) #"-" "_")] (cond (boolean? v) (format "?%s=%s" opt-key (if v "true()" "false()")) (integer? v) (format "?%s=%s" opt-key v) diff --git a/src/clj/daisyproducer2/hyphenate.clj b/src/clj/daisyproducer2/hyphenate.clj index ca68d1a2..29539b53 100644 --- a/src/clj/daisyproducer2/hyphenate.clj +++ b/src/clj/daisyproducer2/hyphenate.clj @@ -5,7 +5,7 @@ hyphenation dictionaries in the file system the hyphenators list needs to be reloaded." (:require [clojure.java.io :as io] - [clojure.string :as string] + [clojure.string :as str] [clojure.tools.logging :as log] [daisyproducer2.config :refer [env]] [mount.core :refer [defstate]]) @@ -33,7 +33,7 @@ (defn- hyphenate* "Hyphenate given `text` using a given `hyphenator`" [text ^Hyphenator hyphenator] - (if (string/blank? text) + (if (str/blank? text) "" (.hyphenate hyphenator text \- nil))) diff --git a/src/clj/daisyproducer2/hyphenations.clj b/src/clj/daisyproducer2/hyphenations.clj index 00fa4ddb..59eaac67 100644 --- a/src/clj/daisyproducer2/hyphenations.clj +++ b/src/clj/daisyproducer2/hyphenations.clj @@ -17,7 +17,7 @@ (defn delete-hyphenation [word spelling] (log/debug "Delete hyphenation" word) (let [deleted (db/delete-hyphenation {:word word :spelling spelling})] - (when (> deleted 0) + (when (pos? deleted) (hyphenations/export)) deleted)) diff --git a/src/clj/daisyproducer2/louis.clj b/src/clj/daisyproducer2/louis.clj index b7ffc062..95e4980a 100644 --- a/src/clj/daisyproducer2/louis.clj +++ b/src/clj/daisyproducer2/louis.clj @@ -1,5 +1,6 @@ (ns daisyproducer2.louis - (:require [clojure.tools.logging :as log]) + (:require [clojure.tools.logging :as log] + [clojure.string :as str]) (:import (org.liblouis Translator))) (def base-tables ["sbs-wordsplit.dis" "sbs-de-core6.cti" "sbs-de-accents.cti", @@ -26,12 +27,12 @@ :else grade2-tables))) (defn translator [tables] - (let [tables-string (apply str (interpose \, tables))] + (let [tables-string (str/join \, tables)] (Translator. ^String tables-string))) (defn translate [word ^Translator translator] (let [length (count word) - inter-character-attributes (int-array (repeat (- length 1) 0))] + inter-character-attributes (int-array (repeat (dec length) 0))] (try (.getBraille (.translate translator word nil nil inter-character-attributes)) ;; log the params that caused the exception and bubble it up diff --git a/src/clj/daisyproducer2/pipeline1.clj b/src/clj/daisyproducer2/pipeline1.clj index 61ab626d..11005f15 100644 --- a/src/clj/daisyproducer2/pipeline1.clj +++ b/src/clj/daisyproducer2/pipeline1.clj @@ -8,7 +8,7 @@ [babashka.fs :as fs] [babashka.process :as process] [clojure.set :as set] - [clojure.string :as s] + [clojure.string :as str] [clojure.tools.logging :as log] [daisyproducer2.config :refer [env]] [medley.core :refer [update-existing]])) @@ -22,16 +22,16 @@ (defn- clean-line [line file] (-> line - (s/replace "[ERROR, Validator]" "") - (s/replace (str "Location: file:" file) "Line:") - s/trim)) + (str/replace "[ERROR, Validator]" "") + (str/replace (str "Location: file:" file) "Line:") + str/trim)) (defn- filter-output [output file] (->> output - s/split-lines + str/split-lines ;; make sure we merge continuation lines with their log line (partition-by continuation-line?) - (map s/join) + (map str/join) (filter #(re-matches #"^\[ERROR, Validator\].*" %)) (map #(clean-line % file)))) @@ -43,7 +43,7 @@ ;; the pipeline1 validator is not so brilliant when it comes to ;; returning error conditions. For that reason we check for ;; existence of the input file before hand - (if (not (and (fs/exists? file) (fs/readable? file))) + (if-not (and (fs/exists? file) (fs/readable? file)) [(format "Input file '%s' does not exist or is not readable" file)] (let [args ["daisy-pipeline" (str (fs/path (env :pipeline1-install-path) diff --git a/src/clj/daisyproducer2/pipeline2/core.clj b/src/clj/daisyproducer2/pipeline2/core.clj index f2e5c206..5b2371d7 100644 --- a/src/clj/daisyproducer2/pipeline2/core.clj +++ b/src/clj/daisyproducer2/pipeline2/core.clj @@ -153,7 +153,7 @@ [[job job-create-form] & body] `(let [~job ~job-create-form] (try - ~@body + (do ~@body) (catch Exception e# (throw (ex-info (format "Failed to run Pipeline2 job because %s" (ex-message e#)) diff --git a/src/clj/daisyproducer2/pipeline2/scripts.clj b/src/clj/daisyproducer2/pipeline2/scripts.clj index 74dd9d2d..d73ab3a7 100644 --- a/src/clj/daisyproducer2/pipeline2/scripts.clj +++ b/src/clj/daisyproducer2/pipeline2/scripts.clj @@ -5,7 +5,7 @@ (:require [clojure.java.io :as io] [clojure.set :as set] - [clojure.string :as string] + [clojure.string :as str] [daisyproducer2.pipeline2.core :as pipeline2] [medley.core :refer [update-existing]])) @@ -17,7 +17,7 @@ (let [completed (pipeline2/wait-for job) results (pipeline2/get-results completed) epub-stream (->> results - (filter #(string/ends-with? % ".epub")) + (filter #(str/ends-with? % ".epub")) first pipeline2/get-stream)] (with-open [in epub-stream @@ -56,7 +56,7 @@ (let [completed (pipeline2/wait-for job) results (pipeline2/get-results completed) odt-stream (->> results - (filter #(string/ends-with? % ".odt")) + (filter #(str/ends-with? % ".odt")) first pipeline2/get-stream)] (with-open [in odt-stream diff --git a/src/clj/daisyproducer2/routes/services.clj b/src/clj/daisyproducer2/routes/services.clj index 7b2d8e8e..5679d4a8 100644 --- a/src/clj/daisyproducer2/routes/services.clj +++ b/src/clj/daisyproducer2/routes/services.clj @@ -191,7 +191,7 @@ :homograph-disambiguation string?}} :handler (fn [{{word :body} :parameters}] (let [deleted (global/delete-word word)] - (if (>= deleted 1) + (if (pos? deleted) (no-content) (not-found))))}}]] @@ -238,7 +238,7 @@ :spelling ::spelling}} :handler (fn [{{word :body} :parameters}] (let [deleted (local/delete-word word)] - (if (>= deleted 1) + (if (pos? deleted) (no-content) ; we found something and deleted it (not-found))))}}] ; couldn't find and delete the requested resource @@ -273,7 +273,7 @@ :isignored boolean?}} :handler (fn [{{word :body} :parameters}] (let [modified (unknown/put-word word)] - (if (> modified 0) + (if (pos? modified) (no-content) (not-found))))}}] @@ -350,9 +350,9 @@ opts :query} :parameters}] (if-let [doc (documents/get-document id)] (try - (let [[name _] (preview/sbsform doc opts)] - (let [url (str "/download/" name)] - (created url {:location url}))) + (let [[name _] (preview/sbsform doc opts) + url (str "/download/" name)] + (created url {:location url})) (catch clojure.lang.ExceptionInfo e (log/error (ex-message e)) (internal-server-error {:status-text (ex-message e)})) @@ -377,9 +377,9 @@ opts :query} :parameters}] (if-let [doc (documents/get-document id)] (try - (let [[name _] (preview/large-print id opts)] - (let [url (str "/download/" name)] - (created url {:location url}))) + (let [[name _] (preview/large-print id opts) + url (str "/download/" name)] + (created url {:location url})) (catch clojure.lang.ExceptionInfo e (log/error (ex-message e)) (internal-server-error {:status-text (ex-message e)})) @@ -402,9 +402,9 @@ opts :query} :parameters}] (if-let [doc (documents/get-document id)] (try - (let [[name _] (preview/open-document id opts)] - (let [url (str "/download/" name)] - (created url {:location url}))) + (let [[name _] (preview/open-document id opts) + url (str "/download/" name)] + (created url {:location url})) (catch clojure.lang.ExceptionInfo e (log/error (ex-message e)) (internal-server-error {:status-text (ex-message e)})) @@ -469,7 +469,7 @@ :parameters {:path {:id int? :version-id int?}} :handler (fn [{{{:keys [id version-id]} :path} :parameters}] (let [deleted (versions/delete-version id version-id)] - (if (> deleted 0) + (if (pos? deleted) (no-content) ; we found something and deleted it (not-found))))}}]] @@ -509,7 +509,7 @@ :handler (fn [{{{:keys [id]} :path} :parameters {{uid :uid} :user} :identity}] (let [deleted (images/delete-all-images id)] - (if (> deleted 0) + (if (pos? deleted) (ok {:deleted deleted}) ; we found something and deleted it (not-found))))}}] ["/:image-id" @@ -525,7 +525,7 @@ :parameters {:path {:id int? :image-id int?}} :handler (fn [{{{:keys [id image-id]} :path} :parameters}] (let [deleted (images/delete-image id image-id)] - (if (> deleted 0) + (if (pos? deleted) (no-content) ; we found something and deleted it (not-found))))}}]] ["/products" @@ -567,7 +567,7 @@ :parameters {:path {:id int? :product-id int?}} :handler (fn [{{{:keys [product-id]} :path} :parameters}] (let [deleted (products/delete-product product-id)] - (if (> deleted 0) + (if (pos? deleted) (no-content) ; we found something and deleted it (not-found))))}}]]] @@ -593,7 +593,7 @@ :spelling ::spelling}} :handler (fn [{{word :body} :parameters}] (let [modified (confirm/put-word word)] - (if (> modified 0) + (if (pos? modified) (no-content) (not-found))))}}] @@ -628,7 +628,7 @@ :hyphenation string?}} :handler (fn [{{{:keys [word spelling]} :body} :parameters}] (let [deleted (hyphenations/delete-hyphenation word spelling)] - (if (> deleted 0) + (if (pos? deleted) (no-content) ; we found something and deleted it ;; if there was no deletion it can mean that either the hyphenation doesn't ;; exist or and this is more likely that the associated word still exists in diff --git a/src/clj/daisyproducer2/whitelists/hyphenation.clj b/src/clj/daisyproducer2/whitelists/hyphenation.clj index bc0902ef..03de6cf6 100644 --- a/src/clj/daisyproducer2/whitelists/hyphenation.clj +++ b/src/clj/daisyproducer2/whitelists/hyphenation.clj @@ -2,7 +2,7 @@ (:require [clojure.core.async :as async] [clojure.java.io :as io] [clojure.java.shell :refer [sh]] - [clojure.string :as string] + [clojure.string :as str] [clojure.tools.logging :as log] [daisyproducer2.db.core :as db] [daisyproducer2.hyphenate :as hyphenate] @@ -28,10 +28,10 @@ "Prepare a hyphenation string for consumption by libhyphen" [s] (-> s - (string/replace #"(.)" "$18") ; place "8" between each char - (string/replace #"^(.*)$" ".$1.") ; suround with . - (string/replace "8-8" "9") ; give hyphens more weight - (string/replace "8." "."))) ; drop the last 8 + (str/replace #"(.)" "$18") ; place "8" between each char + (str/replace #"^(.*)$" ".$1.") ; suround with . + (str/replace "8-8" "9") ; give hyphens more weight + (str/replace "8." "."))) ; drop the last 8 (defn- get-hyphenations [spelling] (->> @@ -42,8 +42,8 @@ (fn [{:keys [word hyphenation]}] (= (hyphenate/hyphenate word spelling) hyphenation))) (map :hyphenation) - (remove string/blank?) ; drop empty ones - (map string/lower-case) ; make sure it's lowercase + (remove str/blank?) ; drop empty ones + (map str/lower-case) ; make sure it's lowercase sort (map prepare-for-libhyphen))) @@ -54,8 +54,8 @@ (doseq [line (line-seq original)] ;; newer versions of substrings.pl cannot handle '#'-style comments, so replace with '%' (let [sanitized (-> line - (string/replace #"^# " "% ") - (string/replace #"^##" "%#"))] + (str/replace #"^# " "% ") + (str/replace #"^##" "%#"))] (.write w sanitized) (.newLine w)))) (doseq [word words] @@ -77,7 +77,7 @@ ;; redirect the output of substrings.pl to /dev/null. Otherwise it can happen that we ;; blow the memory. Idea taken from https://stackoverflow.com/a/7027280 (sh "sh" "-c" - (string/join " " [substrings-program infile outfile "> /dev/null"]))) + (str/join " " [substrings-program infile outfile "> /dev/null"]))) (defn- export* "Export all hyphenation patterns from the database and prepare for diff --git a/src/clj/daisyproducer2/whitelists/tables.clj b/src/clj/daisyproducer2/whitelists/tables.clj index c600a5c7..69a90c90 100644 --- a/src/clj/daisyproducer2/whitelists/tables.clj +++ b/src/clj/daisyproducer2/whitelists/tables.clj @@ -1,6 +1,6 @@ (ns daisyproducer2.whitelists.tables (:require [clojure.java.io :as io] - [clojure.string :as string] + [clojure.string :as str] [clojure.tools.logging :as log] [daisyproducer2.config :refer [env]] [daisyproducer2.db.core :as db] @@ -172,7 +172,7 @@ (->> s (map ascii-to-dots) - (string/join "-"))) + (str/join "-"))) (defn table-filename [grade {:keys [identifier] :as document} {:keys [name? place?] :as opts}] @@ -188,13 +188,13 @@ (defn write-table [^BufferedWriter w grade translate words] (doseq [{:keys [untranslated uncontracted contracted homograph-disambiguation] :as word} words] (let [untranslated (if (words/is-homograph? word) - (string/replace homograph-disambiguation "|" words/braille-dummy-text) + (str/replace homograph-disambiguation "|" words/braille-dummy-text) untranslated) braille (if (= grade 1) uncontracted contracted) ;; Remove the braille dummy text from the braille as ;; liblouis does not produce braille with dummy text ;; FIXME: Why are we keeping the dummy text in the db? If it is just trown away anyway? - braille (string/replace braille words/braille-dummy-text "")] + braille (str/replace braille words/braille-dummy-text "")] (when (not= braille (translate untranslated)) (let [line (format "word %s\t%s" untranslated (to-dots braille))] (.write w line) diff --git a/src/clj/daisyproducer2/words.clj b/src/clj/daisyproducer2/words.clj index 1491f6d4..36f884d0 100644 --- a/src/clj/daisyproducer2/words.clj +++ b/src/clj/daisyproducer2/words.clj @@ -1,6 +1,6 @@ (ns daisyproducer2.words (:require [clojure.set :refer [rename-keys]] - [clojure.string :as string] + [clojure.string :as str] [daisyproducer2.hyphenate :as hyphenate] [daisyproducer2.louis :as louis] [daisyproducer2.validation :as validation])) @@ -32,9 +32,9 @@ append #(str %1 %2)] (when (some? s) (cond-> s - (not (string/starts-with? s start)) + (not (str/starts-with? s start)) (prepend start) - (not (string/ends-with? s end)) + (not (str/ends-with? s end)) (append end))))) (defn complement-ellipsis-braille @@ -42,8 +42,8 @@ on whether `:untranslated` starts or ends with the dummy text, the dummy text is also added to `:uncontracted` and `:contracted`." [{:keys [untranslated uncontracted contracted] :as word}] - (let [starts-with-dummy? (string/starts-with? untranslated braille-dummy-text) - ends-with-dummy? (string/ends-with? untranslated braille-dummy-text) + (let [starts-with-dummy? (str/starts-with? untranslated braille-dummy-text) + ends-with-dummy? (str/ends-with? untranslated braille-dummy-text) uncontracted (cond-> uncontracted starts-with-dummy? (complement-string braille-dummy-text "") @@ -67,7 +67,7 @@ ;; for homographs we have to use the homograph-disambiguation ;; to get the braille untranslated (if (is-homograph? word) - (string/replace homograph-disambiguation "|" braille-dummy-text) + (str/replace homograph-disambiguation "|" braille-dummy-text) untranslated)] (cond-> word (and (contains? word :uncontracted) (nil? (:uncontracted word))) diff --git a/src/clj/daisyproducer2/words/local.clj b/src/clj/daisyproducer2/words/local.clj index 067394b4..dcd631ce 100644 --- a/src/clj/daisyproducer2/words/local.clj +++ b/src/clj/daisyproducer2/words/local.clj @@ -1,5 +1,5 @@ (ns daisyproducer2.words.local - (:require [clojure.string :as string] + (:require [clojure.string :as str] [clojure.tools.logging :as log] [daisyproducer2.db.core :as db] [daisyproducer2.metrics :as metrics] @@ -22,7 +22,7 @@ (let [document (db/get-document {:id id}) spelling (:spelling document) params (cond-> {:id id :limit limit :offset offset :grade grade} - (not (string/blank? search)) (assoc :search (db/search-to-sql search))) + (not (str/blank? search)) (assoc :search (db/search-to-sql search))) words (db/get-local-words params)] (->> words (map words/int-fields-to-boolean) diff --git a/src/clj/daisyproducer2/words/unknown.clj b/src/clj/daisyproducer2/words/unknown.clj index b3642412..9ef9427b 100644 --- a/src/clj/daisyproducer2/words/unknown.clj +++ b/src/clj/daisyproducer2/words/unknown.clj @@ -1,7 +1,7 @@ (ns daisyproducer2.words.unknown (:require [clojure.java.io :as io] [clojure.set :refer [union]] - [clojure.string :as string] + [clojure.string :as str] [clojure.tools.logging :as log] [conman.core :as conman] [daisyproducer2.db.core :as db] @@ -41,12 +41,12 @@ (sequence text) ;; drop everything that is not a letter, space or punctuation (map #(if (valid-char? %) % " ")) - (string/join))) + (str/join))) (defn- extract-xpath [xml xpath] (->> (xpath/select compiler xml xpath {}) - (map (comp str string/lower-case)) + (map (comp str str/lower-case)) set)) (defn extract-homographs [xml] @@ -64,8 +64,8 @@ (->> xml str (re-seq re) - (map string/lower-case) - (map #(string/replace % to-replace words/braille-dummy-text)) + (map str/lower-case) + (map #(str/replace % to-replace words/braille-dummy-text)) set)) (defn extract-ellipsis-words [xml] @@ -83,19 +83,19 @@ (defn filter-special-words [text] (-> text - (string/replace ellipsis-re "") - (string/replace supplement-hyphen-re ""))) + (str/replace ellipsis-re "") + (str/replace supplement-hyphen-re ""))) (defn extract-words [xml] (-> xml str filter-special-words filter-text - (string/split #"(?U)[^\w']") + (str/split #"(?U)[^\w']") (->> ;; drop words shorter than 3 chars (remove (fn [word] (< (count word) 3))) - (map string/lower-case) + (map str/lower-case) set))) (defn get-names @@ -113,7 +113,7 @@ (defn get-homographs [xml document-id] (let [words (-> xml filter-braille extract-homographs) - tuples (map (fn [w] [(string/replace w "|" "") 5 w document-id]) words)] + tuples (map (fn [w] [(str/replace w "|" "") 5 w document-id]) words)] tuples)) (defn get-plain diff --git a/src/cljs/daisyproducer2/documents/document.cljs b/src/cljs/daisyproducer2/documents/document.cljs index 99d13007..eaaebda9 100644 --- a/src/cljs/daisyproducer2/documents/document.cljs +++ b/src/cljs/daisyproducer2/documents/document.cljs @@ -1,6 +1,6 @@ (ns daisyproducer2.documents.document (:require [ajax.core :as ajax] - [clojure.string :as string] + [clojure.string :as str] [daisyproducer2.documents.state :as state] [daisyproducer2.documents.details :as details] [daisyproducer2.documents.image :as image] @@ -100,20 +100,19 @@ :let [v (case k :spelling (words/spelling-brief-string (get document k)) (get document k))] - :when (not (string/blank? v))] + :when (not (str/blank? v))] ^{:key k} [:tr [:th (tr [k])] [:td v]])]]]) (defn buttons [document] - (let [errors? @(rf/subscribe [::notifications/errors?])] - (if errors? - [notifications/error-notification] - [:div.block - [:div.field.is-grouped - [:p.control - [state/button document]] - [:p.control - [details/synchronize-button document]]]]))) + (if-let [errors? @(rf/subscribe [::notifications/errors?])] + [notifications/error-notification] + [:div.block + [:div.field.is-grouped + [:p.control + [state/button document]] + [:p.control + [details/synchronize-button document]]]])) (defn page [] (let [document @(rf/subscribe [::current])] diff --git a/src/cljs/daisyproducer2/documents/image.cljs b/src/cljs/daisyproducer2/documents/image.cljs index 60934efe..23573c9f 100644 --- a/src/cljs/daisyproducer2/documents/image.cljs +++ b/src/cljs/daisyproducer2/documents/image.cljs @@ -1,6 +1,6 @@ (ns daisyproducer2.documents.image (:require [ajax.core :as ajax] - [clojure.string :as string] + [clojure.string :as str] [daisyproducer2.auth :as auth] [daisyproducer2.i18n :refer [tr]] [daisyproducer2.ajax :refer [as-transit]] @@ -18,7 +18,7 @@ :http-xhrio (as-transit {:method :get :uri (str "/api/documents/" document-id "/images") - :params (if (string/blank? search) {} {:search search}) + :params (if (str/blank? search) {} {:search search}) :on-success [::fetch-images-success] :on-failure [::fetch-images-failure]})}))) @@ -220,7 +220,7 @@ (rf/reg-sub ::image-file-names :<- [::image-files] - (fn [files] (->> files (map #(.-name %)) (string/join ", ")))) + (fn [files] (->> files (map #(.-name %)) (str/join ", ")))) (rf/reg-event-db ::set-image-files @@ -280,7 +280,7 @@ [:tr [:td (let [href (str "/archive/" content) - file-name (last (string/split content #"/"))] + file-name (last (str/split content #"/"))] [:a {:href href :target "_blank"} file-name])] [:td {:width "5%"} [buttons uuid]]]) diff --git a/src/cljs/daisyproducer2/documents/markup.cljs b/src/cljs/daisyproducer2/documents/markup.cljs index 28cdfb3b..513b4d45 100644 --- a/src/cljs/daisyproducer2/documents/markup.cljs +++ b/src/cljs/daisyproducer2/documents/markup.cljs @@ -158,20 +158,19 @@ :on-change #(save! (get-value %))}]]])) (defn markup-notification [] - (let [problems @(rf/subscribe [::markup-validation])] - (when problems - (let [{:keys [message errors]} problems] - [:div.block - [:div.notification.is-danger - [:button.delete - {:on-click (fn [e] (rf/dispatch [::ack-validation]))}] - [:p [:strong message]] - (if (seq errors) - [:ul - (for [e errors] - ^{:key e} - [:li (str e)])] - [:p (str errors)])]])))) + (when-let [problems @(rf/subscribe [::markup-validation])] + (let [{:keys [message errors]} problems] + [:div.block + [:div.notification.is-danger + [:button.delete + {:on-click (fn [e] (rf/dispatch [::ack-validation]))}] + [:p [:strong message]] + (if (seq errors) + [:ul + (for [e errors] + ^{:key e} + [:li (str e)])] + [:p (str errors)])]]))) (defn markup [{id :id :as document}] (let [loading? @(rf/subscribe [::notifications/loading? :markup]) diff --git a/src/cljs/daisyproducer2/documents/product.cljs b/src/cljs/daisyproducer2/documents/product.cljs index a60cabca..8f86f84e 100644 --- a/src/cljs/daisyproducer2/documents/product.cljs +++ b/src/cljs/daisyproducer2/documents/product.cljs @@ -1,6 +1,5 @@ (ns daisyproducer2.documents.product (:require [ajax.core :as ajax] - [clojure.string :as string] [daisyproducer2.auth :as auth] [daisyproducer2.i18n :refer [tr]] [daisyproducer2.ajax :refer [as-transit]] diff --git a/src/cljs/daisyproducer2/documents/version.cljs b/src/cljs/daisyproducer2/documents/version.cljs index 64448643..a28dab4d 100644 --- a/src/cljs/daisyproducer2/documents/version.cljs +++ b/src/cljs/daisyproducer2/documents/version.cljs @@ -1,6 +1,6 @@ (ns daisyproducer2.documents.version (:require [ajax.core :as ajax] - [clojure.string :as string] + [clojure.string :as str] [cljs-time.format :as tf] [cljs-time.coerce :as tc] [daisyproducer2.auth :as auth] @@ -19,7 +19,7 @@ :http-xhrio (as-transit {:method :get :uri (str "/api/documents/" document-id "/versions") - :params (if (string/blank? search) {} {:search search}) + :params (if (str/blank? search) {} {:search search}) :on-success [::fetch-versions-success] :on-failure [::fetch-versions-failure]})}))) @@ -72,7 +72,7 @@ (rf/reg-event-fx ::ack-add-version (fn [{:keys [db]} [_ document]] - {:db (-> db (notifications/clear-button-state :version :save)) + {:db (notifications/clear-button-state db :version :save) :dispatch-n (list [::fetch-versions (:id document)] [:common/navigate! :document-versions document])})) @@ -150,7 +150,7 @@ [version-comment] [:div.control [:button.button.is-success - {:disabled (or (string/blank? comment) (nil? file) (not authenticated?)) + {:disabled (or (str/blank? comment) (nil? file) (not authenticated?)) :class klass :on-click (fn [e] (rf/dispatch [::add-version document file comment]))} [:span.icon {:aria-hidden true} [:i.mi.mi-backup]] diff --git a/src/cljs/daisyproducer2/events.cljs b/src/cljs/daisyproducer2/events.cljs index 474c65a0..75998640 100644 --- a/src/cljs/daisyproducer2/events.cljs +++ b/src/cljs/daisyproducer2/events.cljs @@ -3,8 +3,7 @@ [re-frame.core :as rf] [ajax.core :as ajax] [reitit.frontend.easy :as rfe] - [reitit.frontend.controllers :as rfc] - [clojure.string :as string])) + [reitit.frontend.controllers :as rfc])) ;;;;;;;;;;;;;;;;; ;; Dispatchers ;; diff --git a/src/cljs/daisyproducer2/hyphenations.cljs b/src/cljs/daisyproducer2/hyphenations.cljs index cb5c980b..690c00f5 100644 --- a/src/cljs/daisyproducer2/hyphenations.cljs +++ b/src/cljs/daisyproducer2/hyphenations.cljs @@ -7,7 +7,7 @@ [daisyproducer2.pagination :as pagination] [daisyproducer2.validation :as validation] [daisyproducer2.words.notifications :as notifications] - [clojure.string :as string])) + [clojure.string :as str])) (defn- get-search [db] (get-in db [:search :hyphenation])) (defn- get-spelling [db] (get-in db [:current :spelling] 1)) @@ -209,7 +209,7 @@ :on-key-down #(when (= (.-which %) 27) (reset!))}]]])) (defn lookup-button [label href search] - (let [disabled (when (string/blank? search) "disabled")] + (let [disabled (when (str/blank? search) "disabled")] [:a.button {:href (str href search) :disabled disabled :target "_blank" } @@ -285,7 +285,7 @@ save! #(rf/dispatch [::set-corrected %])] (fn [] (let [corrected @(rf/subscribe [::corrected]) - blank? (string/blank? corrected) + blank? (str/blank? corrected) valid? (or blank? @(rf/subscribe [::valid?])) same-as-suggested? (and (not blank?) @(rf/subscribe [::same-as-suggested?])) klass (when (or (not valid?) same-as-suggested?) "is-danger")] diff --git a/src/cljs/daisyproducer2/words/confirm.cljs b/src/cljs/daisyproducer2/words/confirm.cljs index 7c47a9a8..366f5509 100644 --- a/src/cljs/daisyproducer2/words/confirm.cljs +++ b/src/cljs/daisyproducer2/words/confirm.cljs @@ -26,8 +26,7 @@ (rf/reg-event-db ::fetch-words-success (fn [db [_ words]] - (let [words (->> words - (map #(assoc % :uuid (str (random-uuid))))) + (let [words (map #(assoc % :uuid (str (random-uuid))) words) next? (-> words count (= pagination/page-size))] (-> db (assoc-in [:words :confirm] (zipmap (map :uuid words) words)) @@ -47,9 +46,8 @@ ::save-word (fn [{:keys [db]} [_ id]] (let [word (get-in db [:words :confirm id]) - cleaned (-> word - (select-keys [:untranslated :uncontracted :contracted :type :homograph-disambiguation - :document-id :hyphenated :spelling :islocal]))] + cleaned (select-keys word [:untranslated :uncontracted :contracted :type :homograph-disambiguation + :document-id :hyphenated :spelling :islocal])] {:db (notifications/set-button-state db id :save) :http-xhrio {:method :put :format (ajax/json-request-format) @@ -71,9 +69,8 @@ ::delete-word (fn [{:keys [db]} [_ id]] (let [word (get-in db [:words :confirm id]) - cleaned (-> word - (select-keys [:untranslated :uncontracted :contracted :type :homograph-disambiguation - :document-id :hyphenated :spelling])) + cleaned (select-keys word [:untranslated :uncontracted :contracted :type :homograph-disambiguation + :document-id :hyphenated :spelling]) document-id (:document-id word)] {:db (notifications/set-button-state db id :delete) :http-xhrio {:method :delete diff --git a/src/cljs/daisyproducer2/words/global.cljs b/src/cljs/daisyproducer2/words/global.cljs index 77165ed7..fd79155b 100644 --- a/src/cljs/daisyproducer2/words/global.cljs +++ b/src/cljs/daisyproducer2/words/global.cljs @@ -1,6 +1,6 @@ (ns daisyproducer2.words.global (:require [ajax.core :as ajax] - [clojure.string :as string] + [clojure.string :as str] [daisyproducer2.auth :as auth] [daisyproducer2.i18n :refer [tr]] [daisyproducer2.pagination :as pagination] @@ -20,7 +20,7 @@ {:db (notifications/set-loading db :global) :http-xhrio {:method :get :uri "/api/words" - :params (if (string/blank? search) + :params (if (str/blank? search) {:offset offset :limit pagination/page-size} {:offset offset :limit pagination/page-size :search search}) :response-format (ajax/json-response-format {:keywords? true}) @@ -51,8 +51,7 @@ ::save-word (fn [{:keys [db]} [_ id]] (let [word (get-in db [:words :global id]) - cleaned (-> word - (select-keys [:untranslated :uncontracted :contracted :type :homograph-disambiguation]))] + cleaned (select-keys word [:untranslated :uncontracted :contracted :type :homograph-disambiguation])] {:db (notifications/set-button-state db id :save) :http-xhrio {:method :put :format (ajax/json-request-format) @@ -68,8 +67,7 @@ ::delete-word (fn [{:keys [db]} [_ id]] (let [word (get-in db [:words :global id]) - cleaned (-> word - (select-keys [:untranslated :uncontracted :contracted :type :homograph-disambiguation]))] + cleaned (select-keys word [:untranslated :uncontracted :contracted :type :homograph-disambiguation])] {:db (notifications/set-button-state db id :delete) :http-xhrio {:method :delete :format (ajax/json-request-format) @@ -130,7 +128,7 @@ (fn [{:keys [db]} [_ new-search-value]] (let [length (count new-search-value)] (cond-> {:db (assoc-in db [:search :global] new-search-value)} - (or (= length 0) (> length 2)) + (or (zero? length) (> length 2)) ;; do not fetch the productions from the server for very small strings, ;; unless the string has been reset to the empty string (assoc :dispatch-n diff --git a/src/cljs/daisyproducer2/words/local.cljs b/src/cljs/daisyproducer2/words/local.cljs index 0d7fe234..51ec0ff9 100644 --- a/src/cljs/daisyproducer2/words/local.cljs +++ b/src/cljs/daisyproducer2/words/local.cljs @@ -1,6 +1,6 @@ (ns daisyproducer2.words.local (:require [ajax.core :as ajax] - [clojure.string :as string] + [clojure.string :as str] [daisyproducer2.auth :as auth] [daisyproducer2.i18n :refer [tr]] [daisyproducer2.pagination :as pagination] @@ -26,7 +26,7 @@ :params (cond-> {:grade grade :offset offset :limit pagination/page-size} - (not (string/blank? search)) (assoc :search search)) + (not (str/blank? search)) (assoc :search search)) :response-format (ajax/json-response-format {:keywords? true}) :on-success [::fetch-words-success] :on-failure [::fetch-words-failure]}}))) @@ -34,8 +34,7 @@ (rf/reg-event-db ::fetch-words-success (fn [db [_ words]] - (let [words (->> words - (map #(assoc % :uuid (str (random-uuid))))) + (let [words (map #(assoc % :uuid (str (random-uuid))) words) next? (-> words count (= pagination/page-size))] (-> db (assoc-in [:words :local] (zipmap (map :uuid words) words)) @@ -55,9 +54,8 @@ ::save-word (fn [{:keys [db]} [_ id]] (let [word (get-in db [:words :local id]) - cleaned (-> word - (select-keys [:untranslated :uncontracted :contracted :type :homograph-disambiguation - :document-id :islocal :hyphenated :spelling])) + cleaned (select-keys word [:untranslated :uncontracted :contracted :type :homograph-disambiguation + :document-id :islocal :hyphenated :spelling]) document-id (:document-id word)] {:db (notifications/set-button-state db id :save) :http-xhrio {:method :put @@ -74,9 +72,8 @@ ::delete-word (fn [{:keys [db]} [_ id]] (let [word (get-in db [:words :local id]) - cleaned (-> word - (select-keys [:untranslated :uncontracted :contracted :type :homograph-disambiguation - :document-id :hyphenated :spelling])) + cleaned (select-keys word [:untranslated :uncontracted :contracted :type :homograph-disambiguation + :document-id :hyphenated :spelling]) document-id (:document-id word)] {:db (notifications/set-button-state db id :delete) :http-xhrio {:method :delete diff --git a/src/cljs/daisyproducer2/words/notifications.cljs b/src/cljs/daisyproducer2/words/notifications.cljs index d38f737c..cfca90d4 100644 --- a/src/cljs/daisyproducer2/words/notifications.cljs +++ b/src/cljs/daisyproducer2/words/notifications.cljs @@ -54,18 +54,17 @@ (assoc-in [:errors id :errors] errors))))) (defn error-notification [] - (let [errors @(rf/subscribe [::errors])] - (when errors - [:div.block - (for [[k v] errors] - ^{:key k} - [:div.notification.is-danger - [:button.delete - {:on-click (fn [e] (rf/dispatch [::ack-error k]))}] - [:p [:strong (:message v)]] - (if (seq (:errors v)) - [:ul - (for [e (:errors v)] - ^{:key e} - [:li (str e)])] - [:p (str v)])])]))) + (when-let [errors @(rf/subscribe [::errors])] + [:div.block + (for [[k v] errors] + ^{:key k} + [:div.notification.is-danger + [:button.delete + {:on-click (fn [e] (rf/dispatch [::ack-error k]))}] + [:p [:strong (:message v)]] + (if (seq (:errors v)) + [:ul + (for [e (:errors v)] + ^{:key e} + [:li (str e)])] + [:p (str v)])])])) diff --git a/src/cljs/daisyproducer2/words/unknown.cljs b/src/cljs/daisyproducer2/words/unknown.cljs index 902b7dab..46cd0922 100644 --- a/src/cljs/daisyproducer2/words/unknown.cljs +++ b/src/cljs/daisyproducer2/words/unknown.cljs @@ -30,8 +30,7 @@ (rf/reg-event-db ::fetch-words-success (fn [db [_ words]] - (let [words (->> words - (map #(assoc % :uuid (str (random-uuid))))) + (let [words (map #(assoc % :uuid (str (random-uuid))) words) next? (-> words count (= pagination/page-size))] (-> db (assoc-in [:words :unknown] (zipmap (map :uuid words) words)) @@ -51,9 +50,8 @@ ::save-word (fn [{:keys [db]} [_ id]] (let [word (get-in db [:words :unknown id]) - cleaned (-> word - (select-keys [:untranslated :uncontracted :contracted :type :homograph-disambiguation - :document-id :islocal :hyphenated :spelling])) + cleaned (select-keys word [:untranslated :uncontracted :contracted :type :homograph-disambiguation + :document-id :islocal :hyphenated :spelling]) document-id (:document-id word)] {:db (notifications/set-button-state db id :save) :http-xhrio {:method :put diff --git a/test/clj/daisyproducer2/test/abacus_import/properties_test.clj b/test/clj/daisyproducer2/test/abacus_import/properties_test.clj index 50932a93..da7876f0 100644 --- a/test/clj/daisyproducer2/test/abacus_import/properties_test.clj +++ b/test/clj/daisyproducer2/test/abacus_import/properties_test.clj @@ -1,7 +1,7 @@ (ns daisyproducer2.test.abacus-import.properties-test (:require [clojure.data.xml :as xml] - [clojure.string :as string] + [clojure.string :as str] [clojure.test :refer :all] [clojure.test.check.generators :as gen] [com.gfredericks.test.chuck.clojure-test :as chuck] @@ -24,13 +24,13 @@ (def product-number (chuck-gen/string-from-regex #"(PS|GD|EB|ET)[0-9]{4,7}")) (def language (gen/elements ["de" "de-CH" "it" "rm-sursilv"])) (def aufwand (gen/elements ["" "D"])) -(def daisy_producer (gen/elements ["ja" "nein"])) +(def daisy-producer (gen/elements ["ja" "nein"])) (def reihe (chuck-gen/string-from-regex #"SJW[0-9]+")) (defn- valid-date-tuple? [[year month day]] (try (time/local-date year month day) true (catch Exception e false))) (def date (gen/fmap (fn [[year month day]] (format "%d-%02d-%02d" year month day)) (gen/such-that valid-date-tuple? (gen/tuple (gen/choose 1900 2500) (gen/choose 1 12) (gen/choose 1 31))))) -(def import-gen (gen/tuple product-number gen/string gen/string language sbs-isbn date (gen/return "") (gen/return "") gen/nat reihe aufwand daisy_producer)) +(def import-gen (gen/tuple product-number gen/string gen/string language sbs-isbn date (gen/return "") (gen/return "") gen/nat reihe aufwand daisy-producer)) (defn- xml-sample [{:keys [product-number title creator source language date @@ -59,7 +59,7 @@ (defn- normalize-whitespace [s] - (string/replace s (re-pattern (str "[\\s\u00A0]+")) " ")) + (str/replace s (re-pattern (str "[\\s\u00A0]+")) " ")) (deftest abacus-import-with-properties (chuck/checking "ABACUS import is correct" 200 @@ -78,7 +78,7 @@ ;; production-series-number is = 0 and then the production-series is SJW or the ;; production-series-number is empty (is (or (and (not= (:production-series-number imported) 0) (= (:production-series imported) "PPP")) - (and (= (:production-series-number imported) 0) (= (:production-series imported) "SJW")) + (and (zero? (:production-series-number imported)) (= (:production-series imported) "SJW")) (= (= (:production-series-number imported) ""))))))) diff --git a/test/clj/daisyproducer2/test/words_test.clj b/test/clj/daisyproducer2/test/words_test.clj index d7c03f51..d838fdd4 100644 --- a/test/clj/daisyproducer2/test/words_test.clj +++ b/test/clj/daisyproducer2/test/words_test.clj @@ -26,8 +26,8 @@ #{"┊hęllo" "┊wie" "gehts'┊" "heute┊"}))) (testing "Filtering special words" - (is (= (filter-special-words "...HĘllo Leute ...wie gehts'... euch hEute... wahrlich gross- äh, nein gross-artig") - " Leute euch wahrlich äh, nein gross-artig"))) + (is (= " Leute euch wahrlich äh, nein gross-artig" + (filter-special-words "...HĘllo Leute ...wie gehts'... euch hEute... wahrlich gross- äh, nein gross-artig")))) (testing "Extracting plain words" (is (= (extract-words "...HĘllo Leute ...wie gehts'... euch hEute... wahrlich gross- äh, nein gross-artig")