+ (* A hash to check for fields which aren't always available by
+ * counting the number of times we see each field.
+ *)
+ let count, get =
+ let h = Hashtbl.create 13 in
+ let count field_name =
+ let r =
+ try Hashtbl.find h field_name
+ with Not_found -> let r = ref 0 in Hashtbl.add h field_name r; r in
+ incr r
+ in
+ let get field_name = try !(Hashtbl.find h field_name) with Not_found -> 0 in
+ count, get
+ in
+