PreprocessSemantics.py
567 Bytes
#! /usr/bin/python
# -*- coding: utf-8 -*-
from 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)