From 1555b59aa7731809c6f9d77457c626ca054bdce0 Mon Sep 17 00:00:00 2001 From: Javier Luna Molina Date: Sun, 1 Dec 2019 22:47:47 +0100 Subject: [PATCH] WIP: Update Inception format list. (#20) * PYCAP-19: Update Inception format list. Set DEFAULT to 'text' * PYCAP-19: Update format list in documentations --- docs/api/formats.md | 31 +++++++++++++++++++++---------- pycaprio/core/mappings.py | 32 +++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/docs/api/formats.md b/docs/api/formats.md index 9a46156..a1d692a 100644 --- a/docs/api/formats.md +++ b/docs/api/formats.md @@ -4,22 +4,33 @@ Documents, annotations and exports can be downloaded/created in different format INCEpTION doesn't specify in their documentation which formats are supported, but the following have been found and included in `pycaprio`: -* `webanno`: Webanno. This is the default format INCEpTION uses -* `nif`: NIF +* `bin`: Binary. +* `conll2000`: CONLL 2000 +* `conll2006`: CONLL 2006 +* `conll2009`: CONLL 2009 +* `conllcorenlp`: CONLL Core NLP +* `conllu`: CONLLu +* `ctsv`: CTSV +* `ctsv3`: CTSV3 +* `dkpro-core-tei`: Dkpro Core TEI +* `html`: HTML * `lif`: LIF -* `dkpro-core-tei`: TEI -* `perseus_2.1`: Perseus -* `conllu`: Conllu -* `text`: Plain text -* `json`: Json -* `xmi`: XMI +* `nif`: NIF +* `pdf`: PDF +* `perseus_2.1`: Perseus 2.1 +* `pubannotation-sections`: Pubannotation sections +* `tcf`: TCF +* `text`: Plain text (**DEFAULT**) +* `textlines`: Text lines +* `tsv`: TSV - Webanno format + -You can find a class with all the formats in `pycaprio.core.mappings.DocumentFormats`: +You can find a class with all the formats in `pycaprio.core.mappings.InceptionFormat`: ```python from pycaprio.core.mappings import InceptionFormat -InceptionFormat.DEFAULT +InceptionFormat.DEFAULT # Defaults to `text` InceptionFormat.TEI ... ``` diff --git a/pycaprio/core/mappings.py b/pycaprio/core/mappings.py index ec20785..7f54c5a 100644 --- a/pycaprio/core/mappings.py +++ b/pycaprio/core/mappings.py @@ -4,17 +4,35 @@ class InceptionFormat: - DEFAULT = 'webanno' - WEBANNO = 'webanno' - NIF = 'nif' - LIF = 'lif' - TEI = 'dkpro-core-tei' - PERSEUS = 'perseus_2.1' + DEFAULT = 'text' + + BIN = 'bin' + CONLL2000 = 'conll2000' + CONLL2006 = 'conll2006' + CONLL2009 = 'conll2009' + CONLLCORENLP = 'conllcorenlp' CONLLU = 'conllu' + CTSV = 'ctsv' + CTSV3 = 'ctsv3' + DKPRO_CORE_TEI = 'dkpro-core-tei' + TEI = 'dkpro-core-tei' + HTML = 'html' + LIF = 'lif' + NIF = 'nif' + PDF = 'pdf' + PERSEUS_2_1 = 'perseus_2.1' + PUBANNOTATION_SECTIONS = 'pubannotation-sections' + TCF = 'tcf' TEXT = 'text' - JSON = 'json' + TEXTLINES = 'textlines' + TSV = 'tsv' + XMI = 'xmi' + PERSEUS = 'perseus_2.1' + WEBANNO = 'tsv' + JSON = 'json' + class AnnotationState: DEFAULT = 'NEW'