projects
/
SXSI
/
xpathcomp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
499800c
)
Also serialize results in counting mode (prints the count in the output file)
author
Kim Nguyễn
<kn@lri.fr>
Fri, 19 Oct 2012 13:06:54 +0000
(15:06 +0200)
committer
Kim Nguyễn
<kn@lri.fr>
Fri, 19 Oct 2012 13:06:54 +0000
(15:06 +0200)
src/main.ml
patch
|
blob
|
history
src/nodeSet.ml
patch
|
blob
|
history
diff --git
a/src/main.ml
b/src/main.ml
index
0fbebad
..
2534d01
100644
(file)
--- a/
src/main.ml
+++ b/
src/main.ml
@@
-55,7
+55,7
@@
let main v query_string output =
if !Options.count_only then
let module R = ResJIT.Count in
let module M = Runtime.Make(R) in
if !Options.count_only then
let module R = ResJIT.Count in
let module M = Runtime.Make(R) in
- mk_runtime M.bottom_up_run auto v (query, pattern) R.NS.length R.NS.serialize
Non
e
+ mk_runtime M.bottom_up_run auto v (query, pattern) R.NS.length R.NS.serialize
!Options.output_fil
e
else
let module R = ResJIT.Mat in
let module M = Runtime.Make(R) in
else
let module R = ResJIT.Mat in
let module M = Runtime.Make(R) in
@@
-72,7
+72,7
@@
let main v query_string output =
if !Options.twopass then
mk_runtime M.twopass_top_down_run auto v Tree.root R.NS.length R.NS.serialize None
else
if !Options.twopass then
mk_runtime M.twopass_top_down_run auto v Tree.root R.NS.length R.NS.serialize None
else
- mk_runtime M.top_down_run auto v Tree.root R.NS.length R.NS.serialize
Non
e
+ mk_runtime M.top_down_run auto v Tree.root R.NS.length R.NS.serialize
!Options.output_fil
e
else
let module R = ResJIT.Mat in
let module M = Runtime.Make(R) in
else
let module R = ResJIT.Mat in
let module M = Runtime.Make(R) in
diff --git
a/src/nodeSet.ml
b/src/nodeSet.ml
index
0828029
..
b8979cc
100644
(file)
--- a/
src/nodeSet.ml
+++ b/
src/nodeSet.ml
@@
-52,7
+52,12
@@
module Count : S with type t = int =
let fold _ _ _ = failwith "fold not implemented"
let map _ _ = failwith "map not implemented"
let length x = x
let fold _ _ _ = failwith "fold not implemented"
let map _ _ = failwith "map not implemented"
let length x = x
- let serialize _ _ _ = ()
+ let serialize f _ x =
+ let o = open_out f in
+ output_string o "<xml_result>\n";
+ output_string o (string_of_int x);
+ output_string o "\n</xml_result>\n";
+ close_out o
end
type clist =
end
type clist =