package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

merlin-5.8-505.tbz
sha256=5642cde8486a84aad98fa5c590b70e8dcc6074d7fbdb3b9b8c46b2c5b42f653b
sha512=1d7a7751157e393d3ae248ef5ae24a6b4e81430666c61cc51a3d0ec35804523317036f3d7a3c7f18a7554337f4e5f5989fb677865b261ece3fd2b317903570ba

doc/merlin-lib.ocaml_utils/Ocaml_utils/Stable_matching/index.html

Module Ocaml_utils.Stable_matchingSource

Sourcemodule Item : sig ... end
Sourcetype left_index = int
Sourcetype right_index = int
Sourcetype rank = int
Sourcetype ('a, 'v) matches = {
  1. left : 'a list;
  2. pairs : ('v * 'v) list;
  3. right : 'a list;
}
Sourcetype ('v, 'k) item_matches = (('v, 'k) Item.t, 'v) matches
Sourcetype unstable_matching = {
  1. first : left_index * right_index;
  2. second : left_index * right_index;
  3. current_rank : rank * rank;
  4. optimal : rank * rank;
}
Sourceval stable_matches : distance:(int -> int -> int) -> (_, int) matches -> (unit, unstable_matching) Result.t
Sourceval strong_stable_matches : distance:(int -> int -> int) -> (_, int) matches -> (unit, unstable_matching) Result.t
Sourceval matches : compatible:(left_index -> right_index -> bool) -> preferences:(right_index -> (left_index * rank) array) -> size:(int * int) -> (int, int) matches

matches ~compatible ~preferences ~size:(ls,rs) computes a matching between a set of ls left items and rs right items favoring the right side. The matches are compatible and weakly stable according to the preferences matrix. The size of the matching is at least 2/3 of the optimal matching size (computing optimal matching with partial preferences and ties is in NP).

Sourceval fuzzy_match_names : compatibility:('k -> 'k -> bool) -> max_right_items:int -> cutoff:(string -> int) -> ('v, 'k) Item.t list -> ('v, 'k) Item.t list -> ('v, 'k) item_matches

fuzzy_match_names ~compatibility ~max_right_item ~cutoff left right calls the matches function using the OSA edit distance to compute preferences with a cutoff function. To avoid quadratic complexity on large module size we limit the right side to the first max_right_item items