File tree Expand file tree Collapse file tree
server/src/main/kotlin/org/ivdnt/galahad/formats/tei Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,12 +64,12 @@ class TeiConverter(export: DocumentExport) : LayerConverter(export) {
6464 // <linkGrp targFunc="head argument" type="UD-SYN">
6565 // <link target="#d1.p1.s1.w1 #d1.p1.s1.w2" ana="ud-syn:det"/>
6666 // </linkGrp>
67- if (Annotation .DEPREL in export.tagger.annotations) {
67+ if (Annotation .DEPREL in export.tagger.annotations && sentence.terms.any { it.deprel != null } ) {
6868 writer.writeStartElement(" linkGrp" )
6969 writer.writeAttribute(" targFunc" , " head argument" )
7070 writer.writeAttribute(" type" , " UD-SYN" )
7171 sentence.terms.forEach { t ->
72- if (t.deprel?.lowercase() != " root" ) {
72+ if (t.deprel != null && t.deprel ?.lowercase() != " root" ) {
7373 writer.writeStartElement(" link" )
7474 writer.writeAttribute(" target" , " #${sentence.terms[t.head!! .toInt() - 1 ].id} #${t.id} " )
7575 writer.writeAttribute(" ana" , " ud-syn:${t.deprel} " )
You can’t perform that action at this time.
0 commit comments