Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcaml-grew
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
7
Issues
7
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
grew
libcaml-grew
Commits
88095ac7
Commit
88095ac7
authored
Feb 17, 2018
by
Bruno Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add graph casting
parent
56a459cb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
src/grew_graph.ml
src/grew_graph.ml
+3
-0
src/grew_graph.mli
src/grew_graph.mli
+2
-0
src/grew_grs.ml
src/grew_grs.ml
+4
-1
No files found.
src/grew_graph.ml
View file @
88095ac7
...
...
@@ -991,6 +991,9 @@ module G_graph = struct
bprintf
buff
"}
\n
"
;
Buffer
.
contents
buff
let
cast
new_domain
graph
=
match
graph
.
domain
with
|
Some
dom
when
dom
==
new_domain
->
(* ====== NO CAST NEEDED ====== *)
graph
|
_
->
(* ====== CASTING NEEDED ====== *)
of_conll
~
domain
:
new_domain
(
to_conll
graph
)
end
(* module G_graph *)
...
...
src/grew_graph.mli
View file @
88095ac7
...
...
@@ -195,6 +195,8 @@ module G_graph: sig
val
to_dep
:
?
filter
:
(
string
->
bool
)
->
?
main_feat
:
string
->
?
deco
:
G_deco
.
t
->
t
->
string
val
to_conll
:
t
->
Conll
.
t
val
to_conll_string
:
t
->
string
val
cast
:
Domain
.
t
->
t
->
t
end
(* module G_graph *)
module
Delta
:
sig
...
...
src/grew_grs.ml
View file @
88095ac7
...
...
@@ -1138,7 +1138,10 @@ module Grs = struct
let
gwh_simple_rewrite
grs
strat
graph
=
let
domain
=
domain
grs
in
let
gwh
=
Graph_with_history
.
from_graph
graph
in
let
casted_graph
=
match
domain
with
|
None
->
graph
|
Some
dom
->
G_graph
.
cast
dom
graph
in
let
gwh
=
Graph_with_history
.
from_graph
casted_graph
in
let
set
=
gwh_strat_simple_rewrite
?
domain
(
top
grs
)
(
Parser
.
strategy
strat
)
gwh
in
List
.
map
(
fun
gwh
->
gwh
.
Graph_with_history
.
graph
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment