Skip to content
Snippets Groups Projects
  • Kasia Krasnowska's avatar
    multiple changes: · ca00bbcc
    Kasia Krasnowska authored
    * added local filtering
    * added missing control heuristics and reporting for compar etc.
    * udpated phrase descriptions
    * switched to new Morfeusz homonym identifiers
    ca00bbcc
PreprocessSemantics.py 576 B
#! /usr/bin/python
# -*- coding: utf-8 -*-

from importer.Frame import Frame


class Semantics:

    def __init__(self, base, pos, frames):
        self._frames = frames
        self._base = base
        self._pos = pos

    @classmethod
    def fromTree(cls, base, pos, frames_tree, meanings):
        arguments = {}
        
        frames = []
        for frame_subtree in frames_tree._children[0]._children[0]._children:
            frame = Frame.fromTree(base, pos, frame_subtree)
            frames.append(frame)
        
        return cls(base, pos, frames)