Lemmatise un mot f

        :param f: Mot à lemmatiser
        :param pos: Récupère la POS
        :param get_lemma_object: Retrieve Lemma object instead of string representation of lemma
        :param lower: Need to check lowercase version
769904
def lemmatise(self, f, pos=False, get_lemma_object=False, lower=True):
        
        if lower:
            # We do not run numeral on lower
            yield from self._lemmatise_roman_numerals(f, pos=pos, get_lemma_object=get_lemma_object)

            # We run on the lower version
            if f.lower() != f:
                yield from self.lemmatise(f.lower(), pos=pos, get_lemma_object=get_lemma_object, lower=False)

        f = deramise(f)
        yield from self._lemmatise(f, pos=pos, get_lemma_object=get_lemma_object)
        yield from self._lemmatise_assims(f, pos=pos, get_lemma_object=get_lemma_object)
        yield from self._lemmatise_desassims(f, pos=pos, get_lemma_object=get_lemma_object)
        yield from self._lemmatise_contractions(f, pos=pos, get_lemma_object=get_lemma_object)

        yield from self._lemmatise_suffixe(f, pos=pos, get_lemma_object=get_lemma_object)
1223786
def lemmatize(self, text, best_guess=True, return_frequencies=False):
		
		if isinstance(text, str):
			tokens = wordpunct_tokenize(text)
		elif isinstance(text, list):
			tokens= text
		else:
			raise TypeError("lemmatize only works with strings or lists of string tokens.")

		return [self._lemmatize_token(token, best_guess, return_frequencies) for token in tokens]
572803
def parse_ok(l1, l3):
    '''
        
    '''
    return {
        'annee': l1.text.split(' : ')[1].split()[2],
        'siren valide': ''.join(
            l1.text.split(' : ')[1].split(u'\xab')[0].split()[-4:-1]),
        'categorie': ' '.join(
            l1.text.split(' : ')[1].split(u'\xab')[1].split()[:-1]),
        'raison sociale': l3.text.split(' : ')[1][:-1],
        'statut': 'ok'}
604282
def get_syn_ids_by_lemma(self, lemma):
        """"""
        if not isinstance(lemma,unicode):
            lemma = unicode(lemma,'utf-8')


        http, resp, content = self.connect()

        params   = ""
        fragment = ""

        path = "cdb_syn"
        if self.debug:
            printf( "cornettodb/views/query_remote_syn_lemma: db_opt: %s" % path )

        query_opt = "dict_search"
        if self.debug:
            printf( "cornettodb/views/query_remote_syn_lemma: query_opt: %s" % query_opt )
    
        qdict = {}
        qdict[ "action" ] = "queryList"
        qdict[ "word" ]   = lemma.encode('utf-8')


        query = urllib.urlencode( qdict )

        db_url_tuple = ( self.scheme, self.host + ':' + str(self.port), path, params, query, fragment )
        db_url = urlparse.urlunparse( db_url_tuple )
        if self.debug:
            printf( "db_url: %s" % db_url )

        resp, content = http.request( db_url, "GET" )
        if self.debug:
            printf( "resp:\n%s" % resp )
            printf( "content:\n%s" % content )
        #    printf( "content is of type: %s" % type( content ) )

        dict_list = []
        dict_list = eval( content )        # string to list

        synsets = []
        items = len( dict_list )
        if self.debug:
            printf( "items: %d" % items )

        # syn dict: like lu dict, but without pos: part-of-speech
        for dict in dict_list:
            if self.debug:
                printf( dict )

            seq_nr = dict[ "seq_nr" ]   # sense number
            value  = dict[ "value" ]    # lexical unit identifier
            form   = dict[ "form" ]     # lemma
            label  = dict[ "label" ]    # label to be shown

            if self.debug:
                printf( "seq_nr: %s" % seq_nr )
                printf( "value:  %s" % value )
                printf( "form:   %s" % form )
                printf( "label:  %s" % label )

            if value != "":
                synsets.append( value )

        return synsets
183376
def _lemmatise_desassims(self, f, *args, **kwargs):
        
        forme_assimilee = self.desassims(f)
        if forme_assimilee != f:
            for proposal in self._lemmatise(forme_assimilee, *args, **kwargs):
                yield proposal
869541
def pos(self):
        
        if not self._pos and self._renvoi:
            lr = self._lemmatiseur.lemme(self._renvoi)
            if lr:
                return lr.pos()
        return self._pos
654478
def get_location(model_obj):
    
    the_model = get_model(model_obj)
    line, col = the_model._tx_parser.pos_to_linecol(
        model_obj._tx_position)
    return {"line": line, "col": col, "filename": the_model._tx_filename}
126397
def findloop(m):
    
    from _ast import For, While, FunctionDef, ClassDef, ListComp    
    from _ast import DictComp
    if isinstance(m, (FunctionDef, ClassDef)):
        return False
    elif isinstance(m, (For, While, ListComp, DictComp)):
        return True
    elif hasattr(m, "value"):
        return findloop(m.value)
    elif hasattr(m, "__iter__"):
        for sm in m:
            present = findloop(sm)
            if present:
                break
        else:
            present = False
        return present
    elif hasattr(m, "body") or hasattr(m, "orelse"):
        body = hasattr(m, "body") and findloop(m.body)
        orelse = hasattr(m, "orelse") and findloop(m.orelse)
        return body or orelse
    else:
        return False
174193
def find(self, sought, view='lemma'):
        '''
        
        '''
        hits = []
        for sentence in self._sentences:
            hits += sentence.find(sought, view)
        return hits
525063
def get_perms_object(obj, action):
    
    def get_one(pf):
        if isinstance(pf, str):
            return pf
        else:
            return str(reduce(lambda o, f: getattr(o, f), pf, obj))
    return Object([get_one(pf) for pf in obj.__class__.TutelaryMeta.pfs])
625466
def _get_parser(f):
    
    _COMMAND_GROUPS[f.__module__].load()

    if f.__name__ not in _COMMAND_GROUPS[f.__module__].parsers:
        parser = _COMMAND_GROUPS[f.__module__].parser_generator.add_parser(f.__name__, help=f.__doc__,
                                                                           description=f.__doc__)
        parser.set_defaults(func=f)

        _COMMAND_GROUPS[f.__module__].parsers[f.__name__] = parser

    return _COMMAND_GROUPS[f.__module__].parsers[f.__name__]
1353593
def _get_argspec(f):
    
    if sys.version_info[0] < 3:
        argspec = inspect.getargspec(f)
    else:
        # `getargspec` is deprecated since python3.0 (incompatible with function annotations).
        # See SPARK-23569.
        argspec = inspect.getfullargspec(f)
    return argspec
1017015
def lisFichierLexique(self, filepath):
        
        orig = int(filepath.endswith("ext.la"))
        lignes = lignesFichier(filepath)
        for ligne in lignes:
            self.parse_lemme(ligne, orig)
1091397
def _get_text_pos(self, charno, lineno):
        
        return self._get_char_x(charno), self._get_line_y(lineno)
570517
def get_func_posargs_name(f):
    """"""
    sigparams = inspect.signature(f).parameters
    for p in sigparams:
        if sigparams[p].kind == inspect.Parameter.VAR_POSITIONAL:
            return sigparams[p].name
    return None
29168
def get_lemma_by_id(self, mongo_id):
        '''
        
        '''
        cache_hit = None
        if self._lemma_cache is not None:
            cache_hit = self._lemma_cache.get(mongo_id)
        if cache_hit is not None:
            return cache_hit
        lemma_dict = self._mongo_db.lexunits.find_one({'_id': mongo_id})
        if lemma_dict is not None:
            lemma = Lemma(self, lemma_dict)
            if self._lemma_cache is not None:
                self._lemma_cache.put(mongo_id, lemma)
            return lemma
311015
def _get_keywords_with_score(extracted_lemmas, lemma_to_word):
    
    keywords = {}
    for score, lemma in extracted_lemmas:
        keyword_list = lemma_to_word[lemma]
        for keyword in keyword_list:
            keywords[keyword] = score
    return keywords