From 2c210c65c7080c279f886a6c094c7665683f550d Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Thu, 17 Oct 2024 16:51:49 +0200 Subject: [PATCH] fix --- foliatools/alpino2folia.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/foliatools/alpino2folia.py b/foliatools/alpino2folia.py index 5de5636..62facff 100644 --- a/foliatools/alpino2folia.py +++ b/foliatools/alpino2folia.py @@ -51,7 +51,9 @@ def extract_dependencies(alpinonode, deplayer, foliasentence): def makefoliadoc(outputfile): baseid = os.path.basename(outputfile).replace('.folia.xml','').replace('.xml','') - if not folia.isncname(baseid): + try: + folia.isncname(baseid): + except ValueError: baseid = folia.makencname(baseid) processor = folia.Processor.create("alpino2folia", version=TOOLVERSION) foliadoc = folia.Document(id=baseid, processor=processor)