germanetpy.synsetLoader¶
Functions
|
Checks which orthform the tag contains, and adds it to the lexunit object. |
|
Converts the given String into a boolean. |
|
Creates a compound info object. |
|
Given the XML data, creates a Lexunit object. |
|
Constructs an Emum object of a given attribute :rtype: FastEnum :type enum: FastEnum :type attributes: XML attributes :param attributes: XML attributes of a certain XML node :param elment: A String :param enum: The Enum object that should be initialized :return: The corresponding Enum object or None |
Returns attribute value if attribute exists :type attributes: XML attributes :param attributes: XML attributes of a certain XML node :param elment: A String :return: The corresponding object or None |
|
|
Takes the XML tree and walks trough it to create the Lexunit objects. |
Classes
|
This Enum represents the syntactic wordcategory a modifier of a compound can belong to. |
|
|
|
This Enum represents the properties a compound constituent can have. |
|
This enum represents the lexical relation (short: LexRel) that a Lexunit can have in GermaNet. |
|
This class holds the lexical unit object of GermaNet. |
|
This class holds a Synset object. |
|
This Enum class contains the three part-of-speech tags (WortCategory), a Synset can have in GermaNet. |
|
This Enum class contains the semantic wordclasses / semantic fields a Synset can have in GermaNet. |
- germanetpy.synsetLoader.get_attribute_element(attributes, element: str, enum)[source]¶
Constructs an Emum object of a given attribute :rtype: FastEnum :type enum: FastEnum :type attributes: XML attributes :param attributes: XML attributes of a certain XML node :param elment: A String :param enum: The Enum object that should be initialized :return: The corresponding Enum object or None
- germanetpy.synsetLoader.get_attribute_element_without_enum(attributes, element: str)[source]¶
Returns attribute value if attribute exists :type attributes: XML attributes :param attributes: XML attributes of a certain XML node :param elment: A String :return: The corresponding object or None
- germanetpy.synsetLoader.create_compound_info(child) CompoundInfo[source]¶
Creates a compound info object. This has a modifier (String) and a head (String). Each modifier and the head can have a property (CompoundProperty) and a category (CompoundCategory). :param child: the XML element :return: A CompoundInfo object
- germanetpy.synsetLoader.load_lexunits(germanet, tree)[source]¶
Takes the XML tree and walks trough it to create the Lexunit objects. :type tree: Element Tree :type germanet: Germanet :param germanet: the germanet object :param tree: XML tree
- germanetpy.synsetLoader.create_lexunit(germanet, attributes, lex_root, synset) Lexunit[source]¶
Given the XML data, creates a Lexunit object. :type attributes: XML attributes :type germanet: Germanet :param germanet: The germanet object. :param attributes: The XML attributes. :param lex_root: The XML root :param synset: the corresponding synset object :return: a lexical unit object
- germanetpy.synsetLoader.add_orth_forms(germanet, lexunit: Lexunit, child_value: str, tag: str)[source]¶
Checks which orthform the tag contains, and adds it to the lexunit object. Adds the lexunit id to the corresponding dictionary.
- Parameters:
germanet (Germanet) – The germanet object containing the Orthform variant dictionaries.
lexunit – the Lexunit object the Orthform variant needs to be added to
child_value – the value of the XML element that contains this Orthform variant
tag – the value of the XML tag specifying the type of Orthform variant