proycon / pynlpl

PyNLPl, pronounced as 'pineapple', is a Python library for Natural Language Processing. It contains various modules useful for common, and less common, NLP tasks. PyNLPl can be used for basic tasks such as the extraction of n-grams and frequency lists, and to build simple language model. There are also more complex data types and algorithms. Moreover, there are parsers for file formats common in NLP (e.g. FoLiA/Giza/Moses/ARPA/Timbl/CQL). There are also clients to interface with various NLP specific servers. PyNLPl most notably features a very extensive library for working with FoLiA XML (Format for Linguistic Annotation).

Home Page:https://pypi.python.org/pypi/PyNLPl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No function in folia.py to retrieve all chunks from folia document (or paragraph or sentence)

antske opened this issue · comments

Retrieving annotations of whatever type can be done using the select() method available on every folia element (see http://pynlpl.readthedocs.io/en/latest/folia.html#select-method) or the higher-order annotation()/annotations() methods available on most (see http://pynlpl.readthedocs.io/en/latest/folia.html#annotations).

Obtaining all chunks for the entire document can be done as follows for example:

 for chunk in doc.select(folia.Chunk):
      ...