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).
https://pypi.python.org/pypi/PyNLPl
GNU General Public License v3.0
479 stars 67 forks source link

Formats.Giza: IntersectionAlignment does not append the 0-0 alignment #7

Closed yuliagrishina closed 9 years ago

yuliagrishina commented 9 years ago

The result of the intersection of the WordAlignment and the MultiWordAlignment does not contain the intersection of 0-0 (is always "None"). This happens because of the line 297 in the code (revalignment[0] = 0): if revalignment[i] and revalignment[i] in x:

Worked well for me with just if revalignment[i] in x:

proycon commented 9 years ago

Thanks for the fix! I'll apply it