NAME
Treex::PML::Backend::FS - IO backend for reading/writing FS files.
SYNOPSIS
use Treex::PML; Treex::PML::AddBackends(qw(FS))
my $document = Treex::PML::Factory->createDocumentFromFile('input.fs'); ... $document->save();
DESCRIPTION
This module implements a Treex::PML input/output backend which accepts reads/writes documents in the FS format.
REFERENCE
- Treex::PML::Backend::FS::$emulatePML
-
This variable controls whether a simple PML schema should be created for FS files (default is 1 - yes). Attribute whose name contains one or more slashes is represented as a (possibly nested) structure where each slash represents one level of nesting. Attributes sharing a common name-part followed by a slash are represented as members of the same structure. For example, attributes
a
,b/u/x
,b/v/x
andb/v/y
result in the following structure:{a =
value_of_a, b => { u => { x => value_of_a/u/x }, v => { x => value_of_a/v/x, y => value_of_a/v/y } } }>In the PML schema emulation mode, it is forbidden to have both
a
anda/b
attributes. In such a case the parser reverts to non-emulation mode. - Treex::PML::Backend::FS::ParseFSTree ($fsformat,$line,$ordhash)
-
Parse a given string (line) in FS format and return the root of the resulting FS tree as a node object.
SEE ALSO
Description of FS format: http://ufal.mff.cuni.cz/pdt/Corpora/PDT_1.0/Doc/fs.html
COPYRIGHT AND LICENSE
Copyright (C) 2006-2010 by Petr Pajas, 2010-2024 Jan Stepanek
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.