# 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
# TODO: rename to rel pronoun

class Transformer (PosExtract):

    def __init__ (self, **kwds):
        super().__init__(**kwds)
        self.graph.questions = []

    def transform_node (self, msnode):
        sem = super().transform_node(msnode)
        tag_pos = msnode.get('tag', msnode.get('pos'))
        if tag_pos and tag_pos.startswith('w'):
            sem['concept'] = '?'
            sem['sempos'] = 'n'

# 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/interrogative.py
from grafeno.transformers.pos_extract import Transformer as PosExtract

# TODO: rename to rel pronoun

class Transformer (PosExtract):

    def __init__ (self, **kwds):
        super().__init__(**kwds)
        self.graph.questions = []

    def transform_node (self, msnode):
        sem = super().transform_node(msnode)
        tag_pos = msnode.get('tag', msnode.get('pos'))
        if tag_pos and tag_pos.startswith('w'):
            sem['concept'] = '?'
            sem['sempos'] = 'n'

        return sem