Skip to content

Commit 830a947

Browse files
committed
bugfix: als optie NO_ENHANCED, dan ook geen enhanced voor interpunctie
1 parent bca0bb2 commit 830a947

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

v2/alud.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func udTry(alpino_doc []byte, filename, sentid string, options int) (conllu stri
152152
enhancedDependencies(q)
153153
}
154154
if options&OPT_NO_FIX_PUNCT == 0 {
155-
fixpunct(q)
155+
fixpunct(q, options&OPT_NO_ENHANCED == 0)
156156
}
157157
if options&OPT_NO_DETOKENIZE == 0 {
158158
untokenize(q)

v2/fixpunct.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var (
5151
finalPunct = ".?!"
5252
)
5353

54-
func fixpunct(q *context) {
54+
func fixpunct(q *context, doEnhanced bool) {
5555

5656
nodes := make([]*pNode, 0)
5757
rootDescendants := make([]*pNode, 0)
@@ -158,7 +158,9 @@ func fixpunct(q *context) {
158158
// TODO: klopt dit?
159159
if root.f.udRelation != "root" {
160160
root.f.udRelation = "root"
161-
root.f.udEnhanced = number(root.f.udHeadPosition) + ":root"
161+
if doEnhanced {
162+
root.f.udEnhanced = number(root.f.udHeadPosition) + ":root"
163+
}
162164
for _, node2 := range rootDescendants {
163165
if node2.parent.f.End > 0 && node2.f.udRelation == "root" {
164166
node2.f.udRelation = "punct"
@@ -167,9 +169,11 @@ func fixpunct(q *context) {
167169
}
168170

169171
// update DEPS
170-
for _, node := range rootDescendants {
171-
if node.f.udPos == "PUNCT" {
172-
node.f.udEnhanced = number(node.f.udHeadPosition) + ":" + node.f.udRelation
172+
if doEnhanced {
173+
for _, node := range rootDescendants {
174+
if node.f.udPos == "PUNCT" {
175+
node.f.udEnhanced = number(node.f.udHeadPosition) + ":" + node.f.udRelation
176+
}
173177
}
174178
}
175179
}

v2/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Zie:
1515
1616
*/
1717

18-
var version = "2.8.0"
18+
var version = "2.8.1"

0 commit comments

Comments
 (0)