Lemmatise un mot f avec sa désassimilation

        :param f: Mot à lemmatiser
        :yield: Match formated like in _lemmatise()
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
575169
def subfn(pattern, format, string, *args, **kwargs):  # noqa A002
    """"""

    flags = args[4] if len(args) > 4 else kwargs.get('flags', 0)
    is_replace = _is_replace(format)
    is_string = isinstance(format, (str, bytes))
    if is_replace and not format.use_format:
        raise ValueError("Compiled replace is not a format object!")

    pattern = compile_search(pattern, flags)
    rflags = FORMAT if is_string else 0
    return _regex.subn(
        pattern, (compile_replace(pattern, format, flags=rflags) if is_replace or is_string else format), string,
        *args, **kwargs
    )
1104636
def match_file(self, f, update_file=False):
        
        if self.map_func is not None:
            val = self.map_func(f)
        else:
            m = self.regex.search(f.path)
            val = m.group(1) if m is not None else None

        return self._astype(val)
1304335
def requirements(fname):
    
    with open(fname) as f:
        for line in f:
            match = re.search('#egg=(.*)$', line)
            if match:
                yield match.groups()[0]
            else:
                yield line.strip()
162887
def TakeWhile(self: dict, f):
    
    if is_to_destruct(f):
        f = destruct_func(f)

    for e in self.items():
        if not f(e):
            break
        yield e
846414
def map(self, f):
        
        return self._replace(recver=self.recver.map(f))
153733
def _get_two_lines(f):
    
    l0 = f.readline()
    l1 = f.readline()
    return l0, l1
313003
def compose(*funcs):
    
    # slightly optimized for most common cases and hence verbose
    if len(funcs) == 2: f0,f1=funcs; return lambda *a,**kw: f0(f1(*a,**kw))
    elif len(funcs) == 3: f0,f1,f2=funcs; return lambda *a,**kw: f0(f1(f2(*a,**kw)))
    elif len(funcs) == 0: return lambda x:x     # XXX single kwarg
    elif len(funcs) == 1: return funcs[0]
    else:
        def composed(*args,**kwargs):
            y = funcs[-1](*args,**kwargs)
            for f in funcs[:0:-1]: y = f(y)
            return y
        return composed
471313
def parse_restriction_dist(self, f):
        
        parsed_data = dict()
        firstline = True
        for l in f['f']:
            if firstline:    #skip first line
                firstline = False
                continue
            s = l.split("\t")
            if len(s) > 1:
                nuc = float(s[0].strip())
                v1 = float(s[1].strip())
                v2 = float(s[2].strip())
                v = v1 + v2
                #parsed_data.update({nuc:v1})
                #parsed_data.update({nuc:v2})
                parsed_data.update({nuc:v})
        return parsed_data
956683
def genre(self):
        
        _genre = ""
        if " m." in self._indMorph:
            _genre += "m"
        if " f." in self._indMorph:
            _genre += "f"
        if " n." in self._indMorph:
            _genre += "n"
        _genre = _genre.strip()
        if self._renvoi and not _genre:
            lr = self._lemmatiseur.lemme(self._renvoi)
            if lr:
                return lr.genre()

        return _genre
634060
def output_str(f):
    
    if six.PY2:
        #@functools.wraps(f)
        def new_f(*args, **kwargs):
            return f(*args, **kwargs).encode("utf-8")
    else:
        new_f = f
    return new_f
554242
def lemmatize(text_string):
    '''
        
    '''
    if text_string is None or text_string == "":
        return ""
    elif isinstance(text_string, str):
        return LEMMATIZER.lemmatize(text_string)
    else:
        raise InputError("string not passed as primary argument")
422010
def lemmatize(self, tokens):
        """"""
        entries = self.entries
        forms_and_lemmas = self.forms_and_lemmas

        lemma_list = [x[0] for x in entries]
        """Provide a lemma for each token"""
        lemmatized = []
        for token in tokens:
            """check for a match between token and list of lemmas"""
            if token in lemma_list:
                lemmed = (token, token)
                lemmatized.append(lemmed)
            else:
                """if no match check for a match between token and list of lemma forms"""
                lemma = [k for k, v in forms_and_lemmas.items() if token in v]
                if lemma != []:
                    lemmed = (token, lemma)
                    lemmatized.append(lemmed)
                elif lemma == []:
                    """if no match apply regular expressions and check for a match against the list of lemmas again"""
                    regexed = regex(token)
                    if regexed in lemma_list:
                        lemmed = (token, regexed)
                        lemmatized.append(lemmed)
                    else:
                        lemmed = (token, "None")
                        lemmatized.append(lemmed)
        return lemmatized
1270247
def f2format(filename):
    
    print('Now converting %r...' % filename)

    # fetch encoding
    encoding = os.getenv('F2FORMAT_ENCODING', LOCALE_ENCODING)

    lineno = dict()     # line number -> file offset
    content = list()    # file content
    with open(filename, 'r', encoding=encoding) as file:
        lineno[1] = 0
        for lnum, line in enumerate(file, start=1):
            content.append(line)
            lineno[lnum+1] = lineno[lnum] + len(line)

    # now, do the dirty works
    string = ''.join(content)
    text = convert(string, lineno)

    # dump back to the file
    with open(filename, 'w', encoding=encoding) as file:
        file.write(text)
393230
def _wrap(f):
  
  def wrapper(*args, **kwargs):
    """
    Issues a deprecation warning and passes through the arguments.
    """
    warnings.warn(str(f) + " is deprecated. Switch to calling the equivalent function in tensorflow. "
                  " This function was originally needed as a compatibility layer for old versions of tensorflow, "
                  " but support for those versions has now been dropped.")
    return f(*args, **kwargs)
  return wrapper
1144853
def preprocess_french(trans, fr_nlp, remove_brackets_content=True):
    

    if remove_brackets_content:
        trans = pangloss.remove_content_in_brackets(trans, "[]")
    # Not sure why I have to split and rejoin, but that fixes a Spacy token
    # error.
    trans = fr_nlp(" ".join(trans.split()[:]))
    #trans = fr_nlp(trans)
    trans = " ".join([token.lower_ for token in trans if not token.is_punct])

    return trans
1313559
function (f) {
            var args = f.args;
            return string.format("%s%s", f.f, args.length === 0 ? '()' : this.literal(args));
        }