1234567891011121314151617181920212223242526272829303132333435363738394041(* Copyright (C) 2020, Francois Berenger
Yamanishi laboratory,
Department of Bioscience and Bioinformatics,
Faculty of Computer Science and Systems Engineering,
Kyushu Institute of Technology,
680-4 Kawazu, Iizuka, Fukuoka, 820-8502, Japan. *)openPrintftypet=Singleofint(* encoding radius *)|Multiofint*int(* start-stop encoding radii *)letof_strings=ifBatString.containss':'thenletistr,jstr=BatString.splits~by:":"inleti,j=int_of_stringistr,int_of_stringjstrinassert(i>=0&&j>=0&&i<=j);Multi(i,j)elseSingle(int_of_strings)(* Example first line: ^#radius=0..1$
i.e. the radius indicator is everything after "#radius=" *)letof_dictionary_headerfn=letheader=Utls.get_first_linefninletprfx="#radius="inletprfx_len=String.lengthprfxinUtls.enforce(BatString.starts_withheaderprfx)"Scale.of_dictionary_header: not a circular FP dictionary header; \
--pairs CLI option probably missing";lets=BatString.lchop~n:prfx_lenheaderinof_stringsletto_string=function|Singlei->sprintf"%d"i|Multi(i,j)->sprintf"%d:%d"ijletto_list=function|Singlei->[i]|Multi(i,j)->BatList.rangei`Toj