Implementations

Libraries

Currently, the following FoLiA library implementations exist. Both follow a highly object-oriented model in which FoLiA XML elements correspond with classes.

  • FoLiApy - A FoLiA library in Python.

Both libraries are shipped as part of our LaMachine software distribution.

Information regarding implementation of certain elements for these two libraries is present in the status boxes throughout this documentation. The following table shows the level of FoLiA support in these libraries:

The following table lists FoLiA library implementations, the last column lists the predecessor of FoLiApy, which was part of PyNLPl.

FoLiA Library Implementations
Category Name FoLiApy libfolia folia-rust pynlpl.formats.folia  
             
General Language Python 3.5+ C++ Rust Python 2.7 and <=3.4  
General Uses official specification yes yes yes yes  
General Maintenance Status active active active deprecated; superseded by FoLiApy  
General Maturity stable stable alpha stable  
General Lead developer Maarten van Gompel Ko van der Sloot Maarten van Gompel Maarten van Gompel  
             
General Supports latest version 2.3 2.3 2.3 1.5  
General Supports earliest version 0.1 0.1 2.0 0.1  
             
Implementation Full in-memory representation? default default default default  
Implementation Streaming parser? optional optional not yet optional  
Implementation Element representation class hierarchy (OOP) class hierarchy (OOP) other class hierarchy (OOP)  
Implementation Memory-saving encoding no no yes no  
             
Supported Features Structure annotation yes yes yes yes  
Supported Features Inline annotation yes yes yes yes  
Supported Features Span annotation yes yes yes yes  
Supported Features Text mark-up yes yes yes yes  
Supported Features Subtoken annotation (e.g. morphology) yes yes yes yes  
Supported Features Alternatives yes yes limited yes  
Supported Features Corrections yes yes limited yes  
Supported Features Substrings yes yes yes yes  
Supported Features Relations yes yes limited yes  
Supported Features Native Metadata yes yes yes yes  
Supported Features Submetadata yes yes no yes  
Supported Features Foreign Metadata yes yes no yes  
Supported Features Provenance data yes yes yes no  
Supported Features Foreign Annotations yes yes no yes  
Supported Features Features yes yes yes yes  
             
Validation Shallow Validation yes yes no yes  
Validation Text Consistency Validation yes yes no yes  
Validation Deep Validation yes no no yes  
Validation … with RDF+XML sets yes no no yes  
Validation … with RDF+turtle sets yes no no yes  
Validation … with legacy XML sets yes no no yes  
Validation RelaxNG schema generation yes no no yes  
             
Serialisation XML (normal form) yes yes yes yes  
Serialisation JSON (not standarised) yes no no yes  
Serialisation RDF no no no no  
             
Querying select() mechanism yes yes yes yes  
Querying FoLiA Query Language (FQL) yes no no yes  
Querying … CQL support through pynlpl no no yes  
Querying Document findwords() method yes yes no yes  
Querying Introspection into FoLiA specification yes yes yes yes  
             
Quality Control Integration tests yes yes yes (limited) yes  
             
Documentation API reference yes no yes yes  
Documentation Tutorial yes no no yes  
             
Legacy D-Coi read compatibility no no no yes  
             
Parsing Details Predefined subsets as attributes yes yes yes yes  
Parsing Details Compression? gz+bz2 gz+bz2 none gz+bz2  
Parsing Details Default set yes yes yes yes  
Parsing Details Set aliases yes yes ? yes  
Parsing Details Default processor yes yes yes no FoLiA v2  
Parsing Details Default annotator (old-style) yes yes no yes  
             
Serialisation Details Predefined subsets as attributes yes yes no yes  
Serialisation Details Default set yes yes yes yes  
Serialisation Details Set aliases yes yes ? yes  
Serialisation Details Default processor yes yes yes no FoLiA v2  
Serialisation Details Default annotator (old-style) yes yes no yes  
Serialisation Details Write explicit form yes no no no  

Tools

The following tool collections are available:

  • FoLiA Tools - A set of Python-based command-line tools for FoLiA processing. Contains a validator, convertors, and more.
  • FoLiAutils - A set of command-line utilities for working with FoLiA, powered by libfolia.