Lingua::MAF - Multi-Annotation Framework format writer


Lingua-MAF documentation  | view source Contained in the Lingua-MAF distribution.

Index


NAME

Top

Lingua::MAF - Multi-Annotation Framework format writer

VERSION

Top

Version 0.1

DESCRIPTION

Top

This module allows to easily produces MAF-format documents. MAF (Morpho-Syntactic Annotation Framework) is a standard proposal developed by ISO TC37SC4 commitee, see http://www.tc37sc4.org for further details.

SYNOPSIS

Top

    use Lingua::MAF;

    my $maf = Lingua::MAF->new(
	author   => 'me',
	language => 'english',
	format   => {
	    reduced  => 1,
	    compact  => 1,
	}
    );

    $maf->add_token(
	id      => 't1',
	content => 'content1',
	pleft   => 0,
	pright  => 6
    );
    $maf->add_word_form(
	source => 0,
	target => 1,
	tokens => [ 't1' ]
	form   => 'form1',
	entry  => 'entry1',
	tag    => 'tag1'
    );
    $maf->add_word_form(
	source => 1,
	target => 2,
	tokens => [ 't1' ]
	form   => 'form2',
	entry  => 'entry2',
	tag    => 'tag2'
    );
    $maf->flush();

Constructor

Top

Lingua::MAF->new(%options)

Creates and returns a new Lingua::MAF object. %options is an hash with the following keys:

author

The author of the document

language

The language of the document

format

The format of this document, as an hashref with the following keys:

tagset

add the full tagset at the beginning of the document

reduced

use reduced fsm format

compact

use compact tag format

standoff

use standoff format

embedded_token

use embedded token format

Other methods

Top

$maf->add_token(%token)

Adds a token to the document. %token is a hash with the following keys:

id
content
pleft
pright

$maf->add_word_form(%word_form)

Adds a word form to the document. %word_form is a hash with the following keys:

source
target
tokens
form
entry
tag
author

$maf->paste_fsm_twig($fsm)

Directly paste an fsm twig extracted from another MAF document.

$maf->flush_fsm()

Merge current word forms and related tokens into a finite state automata, flushed to STDOUT.

$maf->flush_document()

Flush current document to STDOUT.

COPYRIGHT AND LICENSE

Top

AUTHORS

Top

Guillaume Rousse <grousse@cpan.org>

Eric de la Clergerie, <Eric.De_La_Clergerie@inria.fr>


Lingua-MAF documentation  | view source Contained in the Lingua-MAF distribution.