Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Commits
f4d01088
Commit
f4d01088
authored
1 year ago
by
Maja Jablonska
Browse files
Options
Downloads
Patches
Plain Diff
Change conllu.TokenList to conllu.models.TokenList
parent
e12bddad
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!46
Merge COMBO 3.0 into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
combo/data/api.py
+3
-3
3 additions, 3 deletions
combo/data/api.py
with
3 additions
and
3 deletions
combo/data/api.py
+
3
−
3
View file @
f4d01088
...
@@ -54,14 +54,14 @@ class Sentence:
...
@@ -54,14 +54,14 @@ class Sentence:
return
len
(
self
.
tokens
)
return
len
(
self
.
tokens
)
class
_TokenList
(
conllu
.
TokenList
):
class
_TokenList
(
conllu
.
models
.
TokenList
):
@overrides
@overrides
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'
TokenList<
'
+
'
,
'
.
join
(
token
[
'
token
'
]
for
token
in
self
)
+
'
>
'
return
'
TokenList<
'
+
'
,
'
.
join
(
token
[
'
token
'
]
for
token
in
self
)
+
'
>
'
def
sentence2conllu
(
sentence
:
Sentence
,
keep_semrel
:
bool
=
True
)
->
conllu
.
TokenList
:
def
sentence2conllu
(
sentence
:
Sentence
,
keep_semrel
:
bool
=
True
)
->
conllu
.
models
.
TokenList
:
tokens
=
[]
tokens
=
[]
for
token
in
sentence
.
tokens
:
for
token
in
sentence
.
tokens
:
token_dict
=
collections
.
OrderedDict
(
dataclasses
.
asdict
(
token
))
token_dict
=
collections
.
OrderedDict
(
dataclasses
.
asdict
(
token
))
...
@@ -82,7 +82,7 @@ def sentence2conllu(sentence: Sentence, keep_semrel: bool = True) -> conllu.Toke
...
@@ -82,7 +82,7 @@ def sentence2conllu(sentence: Sentence, keep_semrel: bool = True) -> conllu.Toke
metadata
=
sentence
.
metadata
)
metadata
=
sentence
.
metadata
)
def
tokens2conllu
(
tokens
:
List
[
str
])
->
conllu
.
TokenList
:
def
tokens2conllu
(
tokens
:
List
[
str
])
->
conllu
.
models
.
TokenList
:
return
_TokenList
(
return
_TokenList
(
[
collections
.
OrderedDict
({
"
id
"
:
idx
,
"
token
"
:
token
})
for
[
collections
.
OrderedDict
({
"
id
"
:
idx
,
"
token
"
:
token
})
for
idx
,
token
idx
,
token
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment