<commit_before>;; Copyright (c) <NAME>. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.

(ns conexp.fca.contexts
  (:use conexp.base))

(ns-doc
 "Provides the implementation of formal contexts and functions on
  them.")

;;;

(deftype Context [objects attributes incidence]
  Object
  (equals [this other]
    (generic-equals [this other] Context [objects attributes incidence]))
  (hashCode [this]
    (hash-combine-hash Context objects attributes incidence)))

(defn context?
  "Returns true iff thing is a context."
  [thing]
  (instance? Context thing))

(defmulti objects
  "Returns the objects of a formal context.."
  {:arglists '([context])}
  type)

(defmethod objects Context [^Context ctx]
  (.objects ctx))<commit_msg>Fixed type in docstring of objects<commit_after>;; Copyright (c) <NAME>. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.

(ns conexp.fca.contexts
  (:use conexp.base))

(ns-doc
 "Provides the implementation of formal contexts and functions on
  them.")

;;;

(deftype Context [objects attributes incidence]
  Object
  (equals [this other]
    (generic-equals [this other] Context [objects attributes incidence]))
  (hashCode [this]
    (hash-combine-hash Context objects attributes incidence)))

(defn context?
  "Returns true iff thing is a context."
  [thing]
  (instance? Context thing))

(defmulti objects
  "Returns the objects of a formal context."
  {:arglists '([context])}
  type)

(defmethod objects Context [^Context ctx]
  (.objects ctx))
{'fraction_non_alphanumeric': 0.10197663971248877, 'fraction_numerical': 0.0035938903863432167, 'mean_word_length': 4.215456674473068, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3280346', 'n_tokens_mistral': 644, 'n_tokens_neox': 618, 'n_words': 282}