Skip to content

Commit

Permalink
alpino2folia: sanitize FoLiA ID from filename
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Oct 17, 2024
1 parent 2931de2 commit b885781
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions foliatools/alpino2folia.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def extract_dependencies(alpinonode, deplayer, foliasentence):

def makefoliadoc(outputfile):
baseid = os.path.basename(outputfile).replace('.folia.xml','').replace('.xml','')
if not folia.isncname(baseid):
baseid = folia.makencname(baseid)
processor = folia.Processor.create("alpino2folia", version=TOOLVERSION)
foliadoc = folia.Document(id=baseid, processor=processor)
foliadoc.append(folia.Text(foliadoc, id=baseid+'.text'))
Expand Down

0 comments on commit b885781

Please sign in to comment.