Update regex
This commit is contained in:
parent
888082ab84
commit
a159ed93ab
1 changed files with 13 additions and 2 deletions
|
@ -6,15 +6,26 @@
|
||||||
|
|
||||||
; pre-format
|
; pre-format
|
||||||
(defn delete-comments-and-newlines [resource-file]
|
(defn delete-comments-and-newlines [resource-file]
|
||||||
(apply str
|
(str/join "\n"
|
||||||
(remove
|
(remove
|
||||||
#(or (re-matches #"^#.*" %) (re-matches #"" %))
|
#(or (re-matches #"^#.*" %) (re-matches #"" %))
|
||||||
(str/split-lines
|
(str/split-lines
|
||||||
(slurp resource-file)))))
|
(slurp resource-file)))))
|
||||||
|
|
||||||
; find definitions
|
; 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]
|
(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
|
; make list of vectors/map from well known input-string
|
||||||
|
|
Loading…
Reference in a new issue