<commit_before>(ns ai-zootson.facts-test
  (:refer-clojure :exclude [==])
  (:require [midje.sweet :refer :all]
            [clojure.core.logic :refer :all]
            [clojure.core.logic.pldb :as pldb]
            [ai-zootson.facts :refer :all]))

(fact parse-fact
  (tabular
    (fact (parse-fact ?line) => ?expected)
  ?line ?expected
  "Anteater is a synonym for aardvark."
  [[:SUBJECT [:NOUN "anteater"]]
   [:VERB "is"]
   [:OBJECT [:conj [:NOUN "synonym"] "for" [:NOUN "aardvark"]]]]

  "Aardvark is a good swimmer."
  [[:SUBJECT [:NOUN "aardvark"]]
   [:VERB "is"]
   [:OBJECT [:adj [:ADJ "good"] [:NOUN "swimmer"]]]]

  "Cheetah is the fastest land animal."
  [[:SUBJECT [:NOUN "cheetah"]]
   [:VERB "is"]
   [:OBJECT [:adj [:ADJ "fastest"] [:NOUN "land" "animal"]]]]

  "Crayfish are smaller than lobsters."
  [[:SUBJECT [:NOUN "crayfish"]]
   [:VERB "are"]
   [:OBJECT [:than [:NOUN "smaller"] [:NOUN "lobsters"]]]]

  "Pussycats exist."
  [[:SUBJECT [:NOUN "pussycats"]]
   [:VERB "exist"]]

  "An elephants has a trunk."
  [[:SUBJECT [:NOUN "elephants"]]
   [:VERB "has"]
   [:OBJECT [:NOUN "trunk"]]]

  "Elephants have big ears."
  [[:SUBJECT [:NOUN "elephants"]]
   [:VERB "have"]
   [:OBJECT [:adj [:ADJ "big"] [:NOUN "ears"]]]]

  "Male African elephant is the largest living terrestrial animal."
  [[:SUBJECT [:NOUN "male" "african" "elephant"]]
    [:VERB "is"]
    [:OBJECT [:adj [:ADJ "largest"] [:NOUN "living" "terrestrial" "animal"]]]]

  "Eastern lowland gorilla is the largest living primate."
  [[:SUBJECT [:NOUN "eastern" "lowland" "gorilla"]]
   [:VERB "is"]
   [:OBJECT [:adj [:ADJ "largest"] [:NOUN "living" "primate"]]]]

  "Kiwis are nocturnal birds."
  [[:SUBJECT [:NOUN "kiwis"]]
   [:VERB "are"]
   [:OBJECT [:NOUN "nocturnal" "birds"]]]

  "The kiwi is a national symbol of New Zealand."
  [[:SUBJECT [:NOUN "kiwi"]]
   [:VERB "is"]
   [:OBJECT [:conj [:NOUN "national" "symbol"] "of" [:NOUN "new" "zealand"]]]]

  "Ladybird is also known as ladybug."
  [[:SUBJECT [:NOUN "ladybird"]]
   [:VERB "is"]
   [:OBJECT [:conj [:NOUN "also" "known"] "as" [:NOUN "ladybug"]]]]

  "Lynx have short tails."
  [[:SUBJECT [:NOUN "lynx"]]
   [:VERB "have"]
   [:OBJECT [:adj [:ADJ "short"] [:NOUN "tails"]]]]

  "Mongooses feed on insects, worms, snakes, and birds, etc."
  [[:SUBJECT [:NOUN "mongooses"]]
   [:VERB "feed"]
   [:OBJECT [:prep "on"] [:NOUN "insects"] [:NOUN "worms"] [:NOUN "snakes"] [:NOUN "birds"] [:NOUN "etc"]]]

  "Octopuses are intelligent."
  [[:SUBJECT [:NOUN "octopuses"]]
   [:VERB "are"]
   [:OBJECT [:NOUN "intelligent"]]]

  "Octopuses are more intelligent than worms."
  [[:SUBJECT [:NOUN "octopuses"]]
   [:VERB "are"]
   [:OBJECT [:than "more" [:NOUN "intelligent"] [:NOUN "worms"]]]]

  "Vampires and fruitbats are bats."
  [[:SUBJECT [:NOUN "vampires"] [:NOUN "fruitbats"]]
   [:VERB "are"]
   [:OBJECT [:NOUN "bats"]]]

  "Pussycats and girls can meow."
  [[:SUBJECT [:NOUN "pussycats"] [:NOUN "girls"]]
   [:VERB "can"]
   [:OBJECT [:NOUN "meow"]]]
  ))<commit_msg>2 more tests, indent<commit_after>(ns ai-zootson.facts-test
  (:refer-clojure :exclude [==])
  (:require [midje.sweet :refer :all]
            [clojure.core.logic :refer :all]
            [clojure.core.logic.pldb :as pldb]
            [ai-zootson.facts :refer :all]))

(fact parse-fact
  (tabular
    (fact (parse-fact ?line) => ?expected)
    ?line ?expected
    "Anteater is a synonym for aardvark."
    [[:SUBJECT [:NOUN "anteater"]]
     [:VERB "is"]
     [:OBJECT [:conj [:NOUN "synonym"] "for" [:NOUN "aardvark"]]]]

    "Aardvark is a good swimmer."
    [[:SUBJECT [:NOUN "aardvark"]]
     [:VERB "is"]
     [:OBJECT [:adj [:ADJ "good"] [:NOUN "swimmer"]]]]

    "Cheetah is the fastest land animal."
    [[:SUBJECT [:NOUN "cheetah"]]
     [:VERB "is"]
     [:OBJECT [:adj [:ADJ "fastest"] [:NOUN "land" "animal"]]]]

    "Crayfish are smaller than lobsters."
    [[:SUBJECT [:NOUN "crayfish"]]
     [:VERB "are"]
     [:OBJECT [:than [:NOUN "smaller"] [:NOUN "lobsters"]]]]

    "Pussycats exist."
    [[:SUBJECT [:NOUN "pussycats"]]
     [:VERB "exist"]]

    "An elephants has a trunk."
    [[:SUBJECT [:NOUN "elephants"]]
     [:VERB "has"]
     [:OBJECT [:NOUN "trunk"]]]

    "Elephants have big ears."
    [[:SUBJECT [:NOUN "elephants"]]
     [:VERB "have"]
     [:OBJECT [:adj [:ADJ "big"] [:NOUN "ears"]]]]

    "Male African elephant is the largest living terrestrial animal."
    [[:SUBJECT [:NOUN "male" "african" "elephant"]]
     [:VERB "is"]
     [:OBJECT [:adj [:ADJ "largest"] [:NOUN "living" "terrestrial" "animal"]]]]

    "Eastern lowland gorilla is the largest living primate."
    [[:SUBJECT [:NOUN "eastern" "lowland" "gorilla"]]
     [:VERB "is"]
     [:OBJECT [:adj [:ADJ "largest"] [:NOUN "living" "primate"]]]]

    "Kiwis are nocturnal birds."
    [[:SUBJECT [:NOUN "kiwis"]]
     [:VERB "are"]
     [:OBJECT [:NOUN "nocturnal" "birds"]]]

    "The kiwi is a national symbol of New Zealand."
    [[:SUBJECT [:NOUN "kiwi"]]
     [:VERB "is"]
     [:OBJECT [:conj [:NOUN "national" "symbol"] "of" [:NOUN "new" "zealand"]]]]

    "Ladybird is also known as ladybug."
    [[:SUBJECT [:NOUN "ladybird"]]
     [:VERB "is"]
     [:OBJECT [:conj [:NOUN "also" "known"] "as" [:NOUN "ladybug"]]]]

    "Lynx have short tails."
    [[:SUBJECT [:NOUN "lynx"]]
     [:VERB "have"]
     [:OBJECT [:adj [:ADJ "short"] [:NOUN "tails"]]]]

    "Mongooses feed on insects, worms, snakes, and birds, etc."
    [[:SUBJECT [:NOUN "mongooses"]]
     [:VERB "feed"]
     [:OBJECT [:prep "on"] [:NOUN "insects"] [:NOUN "worms"] [:NOUN "snakes"] [:NOUN "birds"] [:NOUN "etc"]]]

    "Octopuses are intelligent."
    [[:SUBJECT [:NOUN "octopuses"]]
     [:VERB "are"]
     [:OBJECT [:NOUN "intelligent"]]]

    "Octopuses are more intelligent than worms."
    [[:SUBJECT [:NOUN "octopuses"]]
     [:VERB "are"]
     [:OBJECT [:than "more" [:NOUN "intelligent"] [:NOUN "worms"]]]]

    "Vampires and fruitbats are bats."
    [[:SUBJECT [:NOUN "vampires"] [:NOUN "fruitbats"]]
     [:VERB "are"]
     [:OBJECT [:NOUN "bats"]]]

    "Pussycats and girls can meow."
    [[:SUBJECT [:NOUN "pussycats"] [:NOUN "girls"]]
     [:VERB "can"]
     [:OBJECT [:NOUN "meow"]]]

    "Crayfish are smaller than dolphins."
    [[:SUBJECT [:NOUN "crayfish"]]
     [:VERB "are"]
     [:OBJECT [:than [:NOUN "smaller"] [:NOUN "dolphins"]]]]

    "The cheetah are faster than girls."
    [[:SUBJECT [:NOUN "cheetah"]]
     [:VERB "are"]
     [:OBJECT [:than [:NOUN "faster"] [:NOUN "girls"]]]]
  ))
{'fraction_non_alphanumeric': 0.21872601688411358, 'fraction_numerical': 0.00015349194167306216, 'mean_word_length': 3.5155925155925156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6935689', 'n_tokens_mistral': 2809, 'n_tokens_neox': 2607, 'n_words': 698}