let uris = ref [] in
try
while true do
- uris := (input_line fd) :: !uris
+ let (uri,comp) =
+ match (Str.split (Str.regexp "[ \t]+") (input_line fd)) with
+ [uri] -> (uri,"")
+ | [uri;comp] -> (uri,".gz")
+ in
+ uris := (uri,comp) :: !uris
done ;
[] (* only to make the compiler happy *)
with
| he::tl ->
let map = mk_urls_of_uris tl in
let uris = read_index he in
- let url_of_uri uri =
- let url = uri ^ ".xml" in
+ let url_of_uri (uri,comp) =
+ let url = uri ^ ".xml" ^ comp in
let url' = Str.replace_first (Str.regexp "cic:") he url in
let url'' = Str.replace_first (Str.regexp "theory:") he url' in
url''
in
List.fold_right
- (fun uri m -> MapOfStrings.add uri (url_of_uri uri) m)
+ (fun (uri,comp) m -> MapOfStrings.add uri (url_of_uri (uri,comp)) m)
uris map
;;