From a159ed93abeed486f471aa4f25361dd165ae1fd4 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 22 Jun 2023 11:57:17 +0200 Subject: [PATCH] Update regex --- .../activity_pub_poc/parser.clj | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj index cb260b1..b1fff6a 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj @@ -6,15 +6,26 @@ ; pre-format (defn delete-comments-and-newlines [resource-file] - (apply str + (str/join "\n" (remove #(or (re-matches #"^#.*" %) (re-matches #"" %)) (str/split-lines (slurp resource-file))))) ; find definitions +; find definitions algo +; walk through list +; check the current element +; does it have a dot at the end? +; yes +; put it in the current list +; if this does not exist, create it +; the next element goes into a new list +; +; no +; put it in the current list (defn find-definitions [string-input] - (str/split string-input #" \.")) ;ToDo this is crap, splits need tbd differently + (str/split string-input #"\.\n|\.$")) ; make list of vectors/map from well known input-string