Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcaml-grew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
grew
libcaml-grew
Commits
a612bbc7
Commit
a612bbc7
authored
Jan 02, 2018
by
Bruno Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
put sent_id in meta data in function of_brown
parent
51f5b973
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/grew_graph.ml
src/grew_graph.ml
+4
-6
No files found.
src/grew_graph.ml
View file @
a612bbc7
...
...
@@ -429,16 +429,14 @@ module G_graph = struct
let
of_brown
?
domain
?
sentid
brown
=
let
units
=
Str
.
split
(
Str
.
regexp
" "
)
brown
in
let
conll_lines
=
List
.
mapi
(
fun
i
item
->
match
Str
.
full_split
re
item
with
(
fun
i
item
->
match
Str
.
full_split
re
item
with
|
[
Str
.
Text
form
;
Str
.
Delim
pos
;
Str
.
Text
lemma
]
->
let
pos
=
String
.
sub
pos
1
((
String
.
length
pos
)
-
2
)
in
let
feats
=
match
(
i
,
sentid
)
with
|
(
0
,
Some
id
)
->
[(
"sentid"
,
id
)]
|
_
->
[]
in
Conll
.
build_line
~
id
:
(
i
+
1
,
None
)
~
form
~
lemma
~
xpos
:
pos
~
feats
~
deps
:
([(
i
,
"SUC"
)])
()
Conll
.
build_line
~
id
:
(
i
+
1
,
None
)
~
form
~
lemma
~
xpos
:
pos
~
feats
:
[]
~
deps
:
([(
i
,
"SUC"
)])
()
|
_
->
Error
.
build
"[Graph.of_brown] Cannot parse Brown item >>>%s<<< (expected
\"
phon/POS/lemma
\"
) in >>>%s<<<"
item
brown
)
units
in
of_conll
?
domain
{
Conll
.
file
=
None
;
meta
=
[]
;
lines
=
conll_lines
;
multiwords
=
[]
}
let
meta
=
match
sentid
with
Some
id
->
[
"# sent_id = "
^
id
]
|
None
->
[]
in
of_conll
?
domain
{
Conll
.
file
=
None
;
meta
;
lines
=
conll_lines
;
multiwords
=
[]
}
(* -------------------------------------------------------------------------------- *)
let
of_pst
?
domain
pst
=
...
...
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