Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
teiwa
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alice Brenon
teiwa
Commits
7f8047ee
Commit
7f8047ee
authored
3 years ago
by
Alice Brenon
Browse files
Options
Downloads
Patches
Plain Diff
Fix CoNLL and WebAnno formats to pass the regression tests
parent
5e208092
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Text/TEIWA/Source/Common.hs
+2
-2
2 additions, 2 deletions
lib/Text/TEIWA/Source/Common.hs
lib/Text/TEIWA/Source/WebAnno.hs
+4
-3
4 additions, 3 deletions
lib/Text/TEIWA/Source/WebAnno.hs
with
6 additions
and
5 deletions
lib/Text/TEIWA/Source/Common.hs
+
2
−
2
View file @
7f8047ee
...
@@ -18,7 +18,7 @@ import Data.Char (isPunctuation)
...
@@ -18,7 +18,7 @@ import Data.Char (isPunctuation)
import
Data.Text.Lazy
as
Text
(
Text
,
concat
,
head
,
length
)
import
Data.Text.Lazy
as
Text
(
Text
,
concat
,
head
,
length
)
import
Text.Parsec
(
import
Text.Parsec
(
Line
,
ParsecT
,
Stream
,
char
,
endOfLine
,
getParserState
,
many1
,
noneOf
Line
,
ParsecT
,
Stream
,
char
,
endOfLine
,
getParserState
,
many1
,
noneOf
,
sourceLine
,
statePos
,
try
,
sepEndBy
,
sourceLine
,
statePos
,
try
)
)
import
Text.TEIWA.Config
(
Config
(
..
))
import
Text.TEIWA.Config
(
Config
(
..
))
import
Text.TEIWA.Error
(
Error
(
..
))
import
Text.TEIWA.Error
(
Error
(
..
))
...
@@ -48,7 +48,7 @@ sentence row = many comment *> many1 row
...
@@ -48,7 +48,7 @@ sentence row = many comment *> many1 row
comment
=
char
'#'
*>
many
(
noneOf
"
\r\n
"
)
<*
eol
comment
=
char
'#'
*>
many
(
noneOf
"
\r\n
"
)
<*
eol
sentences
::
Stream
s
m
Char
=>
ParsecT
s
u
m
Row
->
ParsecT
s
u
m
[
Sentence
]
sentences
::
Stream
s
m
Char
=>
ParsecT
s
u
m
Row
->
ParsecT
s
u
m
[
Sentence
]
sentences
row
=
many
(
many1
eol
*>
sentence
row
)
sentences
row
=
sentence
row
`
sepEndBy
`
many1
eol
teiTagger
::
Text
->
Attributes
->
Text
teiTagger
::
Text
->
Attributes
->
Text
teiTagger
t
_
teiTagger
t
_
...
...
This diff is collapsed.
Click to expand it.
lib/Text/TEIWA/Source/WebAnno.hs
+
4
−
3
View file @
7f8047ee
...
@@ -23,10 +23,11 @@ header = do
...
@@ -23,10 +23,11 @@ header = do
"ID"
"ID"
,
"SPAN"
,
"SPAN"
,
"FORM"
,
"FORM"
,
"LABEL"
,
"LEMMA"
,
"POS"
]
]
where
where
version
=
skipMany1
digit
`
sepBy1
`
char
'.'
*>
eol
version
=
skipMany1
digit
`
sepBy1
`
char
'.'
*>
eol
comment
=
char
'#'
*>
many
(
noneOf
"
\r\n
"
)
<*
eol
comment
=
char
'#'
*>
many
(
noneOf
"
\r\n
"
)
<*
eol
field
::
Stream
s
m
Char
=>
ParsecT
s
u
m
Field
field
::
Stream
s
m
Char
=>
ParsecT
s
u
m
Field
...
@@ -45,7 +46,7 @@ webAnno :: Format
...
@@ -45,7 +46,7 @@ webAnno :: Format
webAnno
=
do
webAnno
=
do
context
<-
Context
.
ofHeader
=<<
header
context
<-
Context
.
ofHeader
=<<
header
Annotations
<$>
(
Annotations
<$>
(
sentences
row
>>=
mapM
(
(
many
eol
*>
sentences
row
)
>>=
mapM
(
fmap
(
Node
s_
.
Annotations
)
.
mapM
(
tagToken
context
)
fmap
(
Node
s_
.
Annotations
)
.
mapM
(
tagToken
context
)
)
)
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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