Skip to content

Commit

Permalink
Added forwarders to the CLARIN switchboard (proycon/clam#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Jan 12, 2021
1 parent 54de316 commit 942fe7a
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions clamservices/config/alpino.config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
port: 8806
root: "{{VIRTUAL_ENV}}/alpino.clam"
switchboard_forward_url: "https://switchboard.clarin.eu/#/alpino/$BACKLINK/$MIMETYPE/nld"
4 changes: 4 additions & 0 deletions clamservices/config/alpino.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

DEBUG = False
FLATURL = None
SWITCHBOARD_FORWARD_URL = None

if 'ALPINO_HOME' in os.environ:
ALPINO_HOME = os.environ['ALPINO_HOME']
Expand Down Expand Up @@ -103,6 +104,7 @@ class AlpinoXMLCollection(CLAMMetaData):
),
OutputTemplate('foliaoutput',FoLiAXMLFormat,'FoLiA XML Output',
FoLiAViewer(),
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL),allowdefault=False) if SWITCHBOARD_FORWARD_URL else None,
extension='.folia.xml', #set an extension or set a filename:
removeextension='.tok',
multi=True,
Expand All @@ -118,6 +120,7 @@ class AlpinoXMLCollection(CLAMMetaData):
#------------------------------------------------------------------------------------------------------------------------
OutputTemplate('tokoutput', PlainTextFormat,"Plaintext tokenised output, one sentence per line",
SetMetaField('encoding','utf-8'),
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL),allowdefault=False) if SWITCHBOARD_FORWARD_URL else None,
removeextensions='.txt',
extension='.tok',
multi=True,
Expand All @@ -130,6 +133,7 @@ class AlpinoXMLCollection(CLAMMetaData):
OutputTemplate('foliaoutput',FoLiAXMLFormat,'FoLiA XML Output',
FoLiAViewer(),
FLATViewer(url=FLATURL, mode='viewer') if FLATURL else None,
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL),allowdefault=False) if SWITCHBOARD_FORWARD_URL else None,
extension='.folia.xml', #set an extension or set a filename:
removeextension='.txt',
multi=True,
Expand Down
1 change: 1 addition & 0 deletions clamservices/config/frog.config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
port: 8801
root: "{{VIRTUAL_ENV}}/frog.clam"
bindir: "{{VIRTUAL_ENV}}/bin"
switchboard_forward_url: "https://switchboard.clarin.eu/#/frog/$BACKLINK/$MIMETYPE/nld"
3 changes: 3 additions & 0 deletions clamservices/config/frog.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@

DEBUG = False
FLATURL = None
SWITCHBOARD_FORWARD_URL = None

#load external configuration file
loadconfig(__name__)
Expand Down Expand Up @@ -118,6 +119,7 @@
OutputTemplate('foliaoutput', FoLiAXMLFormat,"FoLiA Document",
FoLiAViewer(),
FLATViewer(url=FLATURL, mode='viewer') if FLATURL else None,
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL)) if SWITCHBOARD_FORWARD_URL else None,
removeextensions=['.txt'],
extension='.xml',
copymetadata=True,
Expand Down Expand Up @@ -150,6 +152,7 @@
OutputTemplate('foliaoutput', FoLiAXMLFormat,"FoLiA Document",
FoLiAViewer(),
FLATViewer(url=FLATURL, mode='viewer') if FLATURL else None,
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL)) if SWITCHBOARD_FORWARD_URL else None,
extension='.xml',
copymetadata=True,
multi=True,
Expand Down
1 change: 1 addition & 0 deletions clamservices/config/spacy.config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
port: 8807
root: "{{VIRTUAL_ENV}}/spacy.clam"
bindir: "{{VIRTUAL_ENV}}/bin"
switchboard_forward_url: "https://switchboard.clarin.eu/#/spacy/$BACKLINK/$MIMETYPE"
3 changes: 3 additions & 0 deletions clamservices/config/spacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

DEBUG = False
FLATURL = None
SWITCHBOARD_FORWARD_URL = None

#load external configuration file
loadconfig(__name__)
Expand All @@ -69,6 +70,7 @@
OutputTemplate('foliaoutput', FoLiAXMLFormat,"FoLiA Document",
FoLiAViewer(),
FLATViewer(url=FLATURL, mode='viewer') if FLATURL else None,
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL),allowdefault=False) if SWITCHBOARD_FORWARD_URL else None,
removeextensions=['.txt'],
extension='.folia.xml',
copymetadata=True,
Expand All @@ -83,6 +85,7 @@
OutputTemplate('foliaoutput', FoLiAXMLFormat,"FoLiA Document",
FoLiAViewer(),
FLATViewer(url=FLATURL, mode='viewer') if FLATURL else None,
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL),allowdefault=False) if SWITCHBOARD_FORWARD_URL else None,
extension='.folia.xml',
copymetadata=True,
multi=True,
Expand Down
1 change: 1 addition & 0 deletions clamservices/config/ucto.config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
port: 8802
root: "{{VIRTUAL_ENV}}/ucto.clam"
bindir: "{{VIRTUAL_ENV}}/bin"
switchboard_forward_url: "https://switchboard.clarin.eu/#/ucto/$BACKLINK/$MIMETYPE/$LANGUAGE"
4 changes: 4 additions & 0 deletions clamservices/config/ucto.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@

FLATURL = None

SWITCHBOARD_FORWARD_URL = None

#Load externa configuration file
loadconfig(__name__)

Expand Down Expand Up @@ -105,6 +107,7 @@
then=OutputTemplate('foliatokoutput', FoLiAXMLFormat, "Tokenised Text Document (FoLiA XML)",
SetMetaField('tokenisation','ucto'),
FLATViewer(url=FLATURL, mode='viewer') if FLATURL else None,
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL)) if SWITCHBOARD_FORWARD_URL else None,
copymetadata=True,
removeextension='txt',
extension='xml',
Expand Down Expand Up @@ -136,6 +139,7 @@
ParameterCondition(uppercase=True,
then=SetMetaField('uppercase','yes')
),
ForwardViewer(id='switchboardforwarder',name="Open in CLARIN Switchboard",forwarder=Forwarder('switchboard','CLARIN Switchboard',SWITCHBOARD_FORWARD_URL),allowdefault=False) if SWITCHBOARD_FORWARD_URL else None,
copymetadata=True,
removeextension='txt',
extension='tok',
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(fname):

setup(
name = "CLAMServices",
version = "2.2.3",
version = "2.2.4",
author = "Maarten van Gompel",
author_email = "[email protected]",
description = ("A collection of CLAM Webservices for various of our NLP tools"),
Expand All @@ -35,5 +35,5 @@ def read(fname):
],
package_data = {'clamservices':['wrappers/*.sh','wsgi/*.wsgi','config/*.yml'] },
include_package_data=True,
install_requires=['CLAM >= 3.0.22', 'natsort']
install_requires=['CLAM >= 3.1.0', 'natsort']
)

0 comments on commit 942fe7a

Please sign in to comment.