def _get_morphology_dict()

in src/morphological_filtering.py [0:0]


    def _get_morphology_dict(token: Token) -> Dict:
        """
        Get the morphology dictionary from a token (generated by spaCy).

        :param token: spaCy token for which to get the morphology dictionary.
        :return: Dictionary of morphology information for the token.
        """
        if '__' not in token.tag_:
            return {}
        morphology = token.tag_.split('__')[1]
        if morphology == '_':
            return {}
        morphology_dict = dict([prop.split('=') for prop in morphology.split('|')])
        return morphology_dict