NAME

Treex::Tool::Parser::MSTperl::Parser - pure Perl implementation of MST parser

VERSION

version 0.09407

DESCRIPTION

This is a Perl implementation of the MST Parser described in McDonald et al.: Non-projective Dependency Parsing using Spanning Tree Algorithms 2005 in Proc. HLT/EMNLP.

METHODS

$parser->load_model('modelfile.model');

Loads an unlabelled and/or a labelled model (= sets feature weights) using "load" in Treex::Tool::Parser::MSTperl::ModelBase.

A model has to be loaded before sentences can be parsed.

$parser->parse_sentence($sentence);

Parses a sentence (instance of Treex::Tool::Parser::MSTperl::Sentence). It sets the parent field of each node (instance of Treex::Tool::Parser::MSTperl::Node), i.e. a word in the sentence, and also returns these parents as an array reference.

Any parse information already contained in the sentence gets discarded (explicitely, by calling "copy_nonparsed" in Treex::Tool::Parser::MSTperl::Sentence).

$parser->parse_sentence_internal($sentence);

Does the actual parsing, returning a parsed instance of Treex::Tool::Parser::MSTperl::Sentence. The parse_sentence sub is actually only a wrapper for this method which extracts the parents of the nodes and returns these.

AUTHORS

Rudolf Rosa <rosa@ufal.mff.cuni.cz>

Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz>

COPYRIGHT AND LICENSE

Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.