# Path: grafeno/transformers/pos_extract.py
# class Transformer (Base):
# 
#     def __init__ (self, sempos = default_sempos, **kwds):
#         super().__init__(**kwds)
#         self.__list = sempos.keys()
#         self.__dict = sempos
# 
#     def transform_node (self, msnode):
#         sem = super().transform_node(msnode)
#         pos = msnode.get('pos')
#         if pos in self.__list:
#             sem['concept'] = msnode.get('lemma')
#             sem['sempos'] = self.__dict[pos]
#         return sem


from grafeno.transformers.pos_extract import Transformer as PosExtract
        if not('concept' in p and 'concept' in c and p.get('sempos')=='v'):
            return edge
        if dep in self.predication:
            functor, w, pos_set = self.predication[dep]
            if not pos_set or c.get('sempos') in pos_set:
                edge['functor'], edge['weight'] = functor, w
        elif dep == 'aux' or dep == 'auxpass':
            mod = c['concept']
            if mod == 'have':
                p['aspect'] = 'perfect'
                del c['concept']
            elif mod == 'be':
                p['passive'] = True
                del c['concept']
        return edge

    def post_process (self):
        super().post_process()
        for nid, n in self.nodes.items():
            if n.get('passive'):
                for e in self.edges:
                    if e.get('parent') != nid:
                        continue
                    f = e.get('functor')
                    if f == 'AGENT':
                        e['functor'] = 'THEME'
                    if f == 'COMP' and e.get('class') == 'by':
                        e['functor'] = 'AGENT'
                        del e['class']
                        del e['pval']

# Path: grafeno/transformers/pos_extract.py
# class Transformer (Base):
# 
#     def __init__ (self, sempos = default_sempos, **kwds):
#         super().__init__(**kwds)
#         self.__list = sempos.keys()
#         self.__dict = sempos
# 
#     def transform_node (self, msnode):
#         sem = super().transform_node(msnode)
#         pos = msnode.get('pos')
#         if pos in self.__list:
#             sem['concept'] = msnode.get('lemma')
#             sem['sempos'] = self.__dict[pos]
#         return sem


# Path: grafeno/transformers/thematic.py
from grafeno.transformers.pos_extract import Transformer as PosExtract

        if not('concept' in p and 'concept' in c and p.get('sempos')=='v'):
            return edge
        if dep in self.predication:
            functor, w, pos_set = self.predication[dep]
            if not pos_set or c.get('sempos') in pos_set:
                edge['functor'], edge['weight'] = functor, w
        elif dep == 'aux' or dep == 'auxpass':
            mod = c['concept']
            if mod == 'have':
                p['aspect'] = 'perfect'
                del c['concept']
            elif mod == 'be':
                p['passive'] = True
                del c['concept']
        return edge

    def post_process (self):
        super().post_process()
        for nid, n in self.nodes.items():
            if n.get('passive'):
                for e in self.edges:
                    if e.get('parent') != nid:
                        continue
                    f = e.get('functor')
                    if f == 'AGENT':
                        e['functor'] = 'THEME'
                    if f == 'COMP' and e.get('class') == 'by':
                        e['functor'] = 'AGENT'
                        del e['class']
                        del e['pval']

                del n['passive']