Formats

Corpus Gesproken Nederlands

GIZA++

class formats.giza.IntersectionAlignment(source2target, target2source, encoding=False)
reset()
class formats.giza.MultiWordAlignment(filename, encoding=False)

Source to Target alignment: reads source-target.A3.final files, in which each source word may be aligned to multiple target words (adapted from code by Sander Canisius)

reset()
targetword(index, targetwords, alignment)
Return the aligned targeword for a specified index in the source words. Multiple words are concatenated together with a space in between
targetwords(index, targetwords, alignment)
Return the aligned targetwords for a specified index in the source words
class formats.giza.WordAlignment(filename, encoding=False)

Target to Source alignment: reads target-source.A3.final files, in which each source word is aligned to one target word

reset()
targetword(index, targetwords, alignment)
Return the aligned targetword for a specified index in the source words
formats.giza.parseAlignment(tokens)

Moses

class formats.moses.PhraseTable(filename, quiet=False, delimiter='|||', score_column=5, align2_column=4)
exists(phrase)
Query if a certain phrase exist in the phrase table
translations(phrase)
Return a list of (translation, score, null_alignment) tuples

SoNaR

class formats.sonar.Corpus(corpusdir, extension='pos', restrict_to_collection='', conditionf=<function <lambda> at 0x2f04410>)
class formats.sonar.CorpusDocument(filename, encoding='iso-8859-15')

This class represent one document/text of the Corpus

paragraphs(with_id=False)
Extracts paragraphs, returns list of plain-text(!) paragraphs
sentences()
Iterate over all sentences (sentence_id, sentence) in the document, sentence is a list of 4-tuples (word,id,pos,lemma)
words()
class formats.sonar.CorpusDocumentX(filename, tree=None, index=True)

This class represent one document/text of the Corpus, loaded into memory at once and retaining the full structure

paragraphs(node=None)
iterate over paragraphs
save(filename=None)
sentences(node=None)
iterate over sentences
validate(formats_dir='../formats/')
checks if the document is valid
words(node=None)
iterate over words
xpath(expression)
Executes an xpath expression using the correct namespaces
class formats.sonar.CorpusX(corpusdir, extension='pos', restrict_to_collection='', conditionf=<function <lambda> at 0x2f04410>)
formats.sonar.ns(namespace)
Resolves the namespace identifier to a full URL

Taggerdata

class formats.taggerdata.Taggerdata(filename, encoding='utf-8', mode='r')
align(referencewords, datatuple)
align the reference sentence with the tagged data
next()
reset()
write(sentence)

TiMBL

class formats.timbl.TimblOutput(stream, delimiter=' ', ignorecolumns=[], ignorevalues=[])

A class for reading Timbl classifier output, supports the +v+db option and ignores comments starting with #

parseDistribution(instance, start)

Table Of Contents

Previous topic

Evaluation & Experiments

Next topic

Language Models

This Page