package sherlodoc
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Search engine for OCaml documentation
Install
dune-project
Dependency
Authors
Maintainers
Sources
odoc-3.2.1.tbz
sha256=d45eb125514839fd9ac27702bb4938d1b4f3b6978e9b16ab9673ea067245affc
sha512=3555386b4770a7caa8ec903683bde5ecdc41d5e57ffaee617d5da225c747bbd1e9c1d2677f4df97e96bbdfc69f580ea83b1b92b933ea40a436a658788b677bbc
doc/src/sherlodoc.query/dynamic_cost.ml.html
Source file dynamic_cost.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30module Entry = Db.Entry type query = { name : string list ; type_paths : Type_distance.t option } let of_query { Query_parser.name; typ } = let type_paths = match typ with | `typ t -> Some (Type_distance.paths_of_type t) | _ -> None in { name; type_paths } let type_distance query_type entry = match query_type, Entry.Kind.get_type entry.Entry.kind with | Some query_paths, Some entry_type -> Some (Type_distance.v ~query_paths ~entry:entry_type) | Some _, None -> Some 1000 | _ -> None let score query entry = let name_matches = Name_cost.best_matches query.name entry.Db.Entry.name in let type_cost = match type_distance query.type_paths entry with | Some cost -> cost | None -> 0 in 5 * (name_matches + type_cost)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>