Fix other read-string uses in PSB2 problems
Since removing 'read-string' and 'str' from middle-character and twitter seemed to help diversify the outputs, we chose to replace all other occurrences of this pattern from the other PSB2 problems. Additionally, this conversion with 'read-string' and 'str' was completely unnecessary since the program was already taking from the top of the string stack.
This commit is contained in:
parent
404e640cfb
commit
c6f08d4ca3
@ -78,19 +78,14 @@
|
||||
(:step-limit argmap))
|
||||
:string))
|
||||
inputs)
|
||||
parsed-outputs (map (fn [output]
|
||||
(try (read-string output)
|
||||
#?(:clj (catch Exception e 1000.0)
|
||||
:cljs (catch js/Error. e 1000.0))))
|
||||
outputs)
|
||||
errors (map (fn [correct-output output]
|
||||
(if (= output :no-stack-item)
|
||||
10000
|
||||
(metrics/levenshtein-distance correct-output output)))
|
||||
correct-outputs
|
||||
parsed-outputs)]
|
||||
outputs)]
|
||||
(assoc individual
|
||||
:behaviors parsed-outputs
|
||||
:behaviors outputs
|
||||
:errors errors
|
||||
:total-error #?(:clj (apply +' errors)
|
||||
:cljs (apply + errors)))))
|
||||
|
@ -46,19 +46,14 @@
|
||||
(:step-limit argmap))
|
||||
:string))
|
||||
inputs)
|
||||
parsed-outputs (map (fn [output]
|
||||
(try (read-string output)
|
||||
#?(:clj (catch Exception e 1000.0)
|
||||
:cljs (catch js/Error. e 1000.0))))
|
||||
outputs)
|
||||
errors (map (fn [correct-output output]
|
||||
(if (= output :no-stack-item)
|
||||
10000
|
||||
(metrics/levenshtein-distance (str correct-output) (str output))))
|
||||
(metrics/levenshtein-distance correct-output output)))
|
||||
correct-outputs
|
||||
parsed-outputs)]
|
||||
outputs)]
|
||||
(assoc individual
|
||||
:behaviors parsed-outputs
|
||||
:behaviors outputs
|
||||
:errors errors
|
||||
:total-error #?(:clj (apply +' errors)
|
||||
:cljs (apply + errors)))))
|
||||
|
@ -74,19 +74,14 @@
|
||||
(:step-limit argmap))
|
||||
:string))
|
||||
inputs)
|
||||
parsed-outputs (map (fn [output]
|
||||
(try (read-string output)
|
||||
#?(:clj (catch Exception e 1000.0)
|
||||
:cljs (catch js/Error. e 1000.0))))
|
||||
outputs)
|
||||
errors (map (fn [correct-output output]
|
||||
(if (= output :no-stack-item)
|
||||
10000
|
||||
(metrics/levenshtein-distance correct-output output)))
|
||||
correct-outputs
|
||||
parsed-outputs)]
|
||||
outputs)]
|
||||
(assoc individual
|
||||
:behaviors parsed-outputs
|
||||
:behaviors outputs
|
||||
:errors errors
|
||||
:total-error #?(:clj (apply +' errors)
|
||||
:cljs (apply + errors)))))
|
||||
|
@ -46,19 +46,14 @@
|
||||
(:step-limit argmap))
|
||||
:string))
|
||||
inputs)
|
||||
parsed-outputs (map (fn [output]
|
||||
(try (read-string output)
|
||||
#?(:clj (catch Exception e 1000.0)
|
||||
:cljs (catch js/Error. e 1000.0))))
|
||||
outputs)
|
||||
errors (map (fn [correct-output output]
|
||||
(if (= output :no-stack-item)
|
||||
10000
|
||||
(metrics/levenshtein-distance (str correct-output) (str output))))
|
||||
(metrics/levenshtein-distance correct-output output)))
|
||||
correct-outputs
|
||||
parsed-outputs)]
|
||||
outputs)]
|
||||
(assoc individual
|
||||
:behaviors parsed-outputs
|
||||
:behaviors outputs
|
||||
:errors errors
|
||||
:total-error #?(:clj (apply +' errors)
|
||||
:cljs (apply + errors)))))
|
||||
|
@ -59,19 +59,14 @@
|
||||
(:step-limit argmap))
|
||||
:string))
|
||||
inputs)
|
||||
parsed-outputs (map (fn [output]
|
||||
(try (read-string output)
|
||||
#?(:clj (catch Exception e 1000.0)
|
||||
:cljs (catch js/Error. e 1000.0))))
|
||||
outputs)
|
||||
errors (map (fn [correct-output output]
|
||||
(if (= output :no-stack-item)
|
||||
10000
|
||||
(metrics/levenshtein-distance (str correct-output) (str output))))
|
||||
(metrics/levenshtein-distance correct-output output)))
|
||||
correct-outputs
|
||||
parsed-outputs)]
|
||||
outputs)]
|
||||
(assoc individual
|
||||
:behaviors parsed-outputs
|
||||
:behaviors outputs
|
||||
:errors errors
|
||||
:total-error #?(:clj (apply +' errors)
|
||||
:cljs (apply + errors)))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user