PreprocessEntry.py 758 Bytes
#! /usr/bin/python
# -*- coding: utf-8 -*-

from importer.Meanings import Meanings
from importer.PreprocessSemantics import Semantics

class Entry:

    def __init__(self, entry_tree):
        self._base = entry_tree._children[0]._children[0]._content
        self._pos = entry_tree._children[0]._children[1]._content
        self._status = entry_tree._children[1]._children[0]._children[0]._content
        print('preprocessing: ' + self._base)
        if len(entry_tree._children) >= 7:
            self._meanings = Meanings.fromTree(entry_tree._children[5])
            self._semantics = Semantics.fromTree(self._base, self._pos, entry_tree._children[4], self._meanings)
        else:
            self._meanings = None
            self._semantics = None