<commit_before>(ns babel.test.es
  (:refer-clojure :exclude [get-in])
  (:require [babel.engine :as engine]
            [babel.espanol.grammar :as esg]
            [babel.espanol.morphology :refer [fo]]
            [clojure.string :as string]
            #?(:clj [clojure.test :refer [deftest is]])
            #?(:cljs [cljs.test :refer-macros [deftest is]])
            #?(:clj [clojure.tools.logging :as log])
            #?(:cljs [babel.logjs :as log]) 
            [dag_unify.core :refer [get-in]]))

(deftest generate-conditional
  (let [result (engine/generate {:synsem {:subcat '()
                                          :sem {:pred :sleep
                                                :subj {:pred :I}
                                                :tense :conditional}}}
                                esg/small
                                :enrich true)]
    (is (= :1st (get-in result [:comp :synsem :agr :person])))
    (is (= :sing (get-in result [:comp :synsem :agr :number])))
    (is (or (= "yo dormiría" (fo result))
            (= "dormiría" (fo result))))))

(deftest llamarse
  (let [result (engine/expression esg/small {:synsem {:sem {:pred :be-called}}})]
    (is (not (empty? (fo result))))))

(deftest llamo
  (let [result (fo (engine/expression esg/small<commit_msg>add test for the preceding change<commit_after>(ns babel.test.es
  (:refer-clojure :exclude [get-in])
  (:require [babel.engine :as engine]
            [babel.espanol.grammar :as esg]
            [babel.espanol.morphology :refer [fo]]
            [clojure.string :as string]
            #?(:clj [clojure.test :refer [deftest is]])
            #?(:cljs [cljs.test :refer-macros [deftest is]])
            #?(:clj [clojure.tools.logging :as log])
            #?(:cljs [babel.logjs :as log]) 
            [dag_unify.core :refer [get-in]]))

(deftest generate-conditional
  (let [result (engine/generate {:synsem {:subcat '()
                                          :sem {:pred :sleep
                                                :subj {:pred :I}
                                                :tense :conditional}}}
                                esg/small
                                :enrich true)]
    (is (= :1st (get-in result [:comp :synsem :agr :person])))
    (is (= :sing (get-in result [:comp :synsem :agr :number])))
    (is (or (= "yo dormiría" (fo result))
            (= "dormiría" (fo result))))))

(deftest zar-preterito
  (let [result (engine/generate 
                {:root {:espanol {:espanol "abrazar"}}
                 :synsem {:sem {:subj {:pred :I}}
                          :infl :preterito}}
                esg/small
                :enrich true)]
    (is (or (= "yo abracé" (fo result))
            (= "abracé" (fo result))))))
                
(deftest llamarse
  (let [result (engine/expression esg/small {:synsem {:sem {:pred :be-called}}})]
    (is (not (empty? (fo result))))))

(deftest llamo
  (let [result (fo (engine/expression esg/small
{'fraction_non_alphanumeric': 0.15544388609715243, 'fraction_numerical': 0.0006700167504187605, 'mean_word_length': 1.670840787119857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1646398', 'n_tokens_mistral': 976, 'n_tokens_neox': 938, 'n_words': 240}