else
sprintf "%s&%s=%s" url param_name param_value
+ (** HTML encoding, e.g.: "<" -> "<" *)
+let html_encode = Netencoding.Html.encode_from_latin1
+
let send_results results
?(id_to_uris = CicTextualParser2.EnvironmentP3.of_string "")
(req: Http_types.request) outchan
let subst =
(tag "SEARCH_ENGINE_URL", my_own_url) ::
(tag "ADVANCED", advanced) ::
- (tag "EXPRESSION", req#param "expression") ::
+ (tag "EXPRESSION", html_encode (req#param "expression")) ::
add_param_substs req#params @
(if advanced = "no" then
[ tag "SIMPLE_CHECKED", "checked='true'";
tag "ADVANCED", advanced;
tag "INTERPRETATIONS", html_interpretations;
tag "CURRENT_CHOICES", req#param "choices";
- tag "EXPRESSION", req#param "expression";
+ tag "EXPRESSION", html_encode (req#param "expression");
tag "QUERY_KIND", query_kind;
tag "QUERY_SUMMARY", "disambiguation";
tag "ACTION", string_tail req#path ]
in
let module Disambiguate' = Disambiguate.Make(Chat) in
let ast = CicTextualParser2.parse_term (Stream.of_string term_str) in
+ prerr_endline "prima della disambiguazione";
let (id_to_uris, metasenv, term) =
match
Disambiguate'.disambiguate_term dbd context metasenv ast id_to_uris
| [id_to_uris,metasenv,term,_] -> id_to_uris,metasenv,term
| _ -> assert false
in
+ prerr_endline "dopo la disambiguazione";
let uris =
match req#path with
| "/match" -> MetadataQuery.match_term ~dbd term