#include <XmlLingDefFormatter.h>
Inheritance diagram for LinguisticDefinition::XmlLingDefFormatter:
Public Member Functions | |
XmlLingDefFormatter () | |
LingDef | createLingDef (const std::string &xmlData, const std::string &isoLanguageCode="") |
Creates a LingDef object for an XML document. | |
LingDef | createLingDef (xmlDocPtr doc, const std::string &isoLanguageCode="") |
Creates a LingDef object for an XML document. | |
bool | populateLingDef (const std::string &xmlData, LingDef &lingDef) |
A quick access function, to avoid copying the result object. | |
bool | populateLingDef (xmlDocPtr doc, LingDef &lingDef) |
A quick access function, to avoid copying the result object. | |
std::string | output (const LingDef &) const |
void | output (const LingDef &, std::ostream &) const |
An example XML:
<LingDef xml:lang="ar">
<Pos id="base" type="virtual">
<Misc>
<Enum name="langlevel">
<Value name="z0"/>
<Value name="z1"/>
<Value name="z2"/>
</Enum>
<Boolean name="void_translation"/>
</Misc>
</Pos>
<Pos id="noun" inherits="base" type="element">
<Name short="N">NOUN</Name>
<Morphology>
<Enum name="gender" allowNone="false" allowSeveral="true">
<Value name="masc" short="m" default="true"/>
<Value name="fem" short="f"/>
</Enum>
<Enum name="number">
<Value name="sing" short="s" default="true"/>
<Value name="plur" short="p"/>
</Enum>
</Morphology>
</Pos>
</LingDef>
For each node, it is possible to set the property xml:lang
, which allows deactivation of that node and its children if the language does not match. The property can be either positive or negative: 'ar' would cause the node to be used only for Arabic, '!ar' all languages but Arabic, 'ar,fa,ur' Arabic, Farsi and Urdu, '!ar,!fa,!ur' all but Arabic Farsi and Urdu.
Definition at line 60 of file XmlLingDefFormatter.h.
XmlLingDefFormatter::XmlLingDefFormatter | ( | ) |
Definition at line 9 of file XmlLingDefFormatter.cc.
LingDef LinguisticDefinition::XmlLingDefFormatter::createLingDef | ( | xmlDocPtr | doc, | |
const std::string & | isoLanguageCode = "" | |||
) |
Creates a LingDef object for an XML document.
doc | The XML document, as a constructed xmlDoc | |
isoLanguageCode | The ISO language code for the language to use |
LingDef LinguisticDefinition::XmlLingDefFormatter::createLingDef | ( | const std::string & | xmlData, | |
const std::string & | isoLanguageCode = "" | |||
) |
void LinguisticDefinition::XmlLingDefFormatter::output | ( | const LingDef & | , | |
std::ostream & | ||||
) | const [virtual] |
Implements LinguisticDefinition::LingDefFormatter.
string XmlLingDefFormatter::output | ( | const LingDef & | ) | const [virtual] |
Implements LinguisticDefinition::LingDefFormatter.
Definition at line 659 of file XmlLingDefFormatter.cc.
bool XmlLingDefFormatter::populateLingDef | ( | xmlDocPtr | doc, | |
LingDef & | lingDef | |||
) |
A quick access function, to avoid copying the result object.
doc | The XML document, as a constructed xmlDoc | |
lingDef | A pre-constructed LingDef object, which will be populated |
Definition at line 53 of file XmlLingDefFormatter.cc.
bool LinguisticDefinition::XmlLingDefFormatter::populateLingDef | ( | const std::string & | xmlData, | |
LingDef & | lingDef | |||
) |
A quick access function, to avoid copying the result object.
xmlData | The XML document, as a string | |
lingDef | A pre-constructed LingDef object, which will be populated |