Partitioning OCaml codes
Module Asak . Clustering
module Distance : sig ... end
module Hash : sig ... end
module HMap : Map.S with type key = Hash.t
val initial_cluster : ('a * Lambda_hash.fingerprint) list -> 'a list HMap.t

Create initial clusters, grouping labels by fingerprint.

val cluster : ?filter_small_trees:int -> ('a * Lambda_hash.hash) list -> 'a list Wtree.wtree list

Given a list of AST hashes (identified by a key), perform a kind of complete-linkage clustering using a particular semimetric.

  • parameter filter_small_trees

    If specified, will remove hashes that do not have at least this weight.

  • returns

    A list of trees, where two keys are in the same tree only if they share at least one hash and in the same leaf if they share exactly the same hash list.

    The list is sorted with biggest trees first.

val print_cluster : ( 'a -> string ) -> 'a list Wtree.wtree list -> unit

Print recursively a cluster given a printer for the labels.