define list of lemmas
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
1091875
def check_list(self, node_list, pattern_list):
        
        if len(node_list) != len(pattern_list):
            return False
        else:
            return all(Check(node_elt,
                             self.placeholders).visit(pattern_list[i])
                       for i, node_elt in enumerate(node_list))
1142483
public boolean containsLemma(String lemma) {
        return !Strings.isNullOrEmpty(lemma) && db.containsLemma(lemma.toLowerCase());
    }
805513
def _register_lemme(self, lemma):
        
        if lemma.cle() not in self.lemmatiseur._lemmes:
            self.ajRadicaux(lemma)
            self.lemmatiseur._lemmes[lemma.cle()] = lemma
1328583
def _complete_cases(self, text, line, istart, iend):
        """"""
        if text == "":
            return list(self.live.keys())
        else:
            return [c for c in self.live if c.startswith(text)]
347191
def lexeme(self, verb, parse=True):
        
        a = []
        b = self.lemma(verb, parse=parse)
        if b in self:
            a = [x for x in self[b] if x != ""]
        elif parse is True: # rule-based
            a = self.find_lexeme(b)
        u = []; [u.append(x) for x in a if x not in u]
        return u
256496
def lemma(self):
        
        if self._lemma is None:
            lemmata = self._element.xpath('lemma/text()')
            if len(lemmata) > 0:
                self._lemma = lemmata[0]
        return self._lemma
809416
function validSemverTag(list, tag) {
    if (semver.valid(tag)) {
        list.push(tag);
    }

    return list;
}
1330949
def _lemmatise_suffixe(self, f, *args, **kwargs):
        
        for suffixe in self._suffixes:
            if f.endswith(suffixe) and suffixe != f:
                yield from self._lemmatise(f[:-len(suffixe)], *args, **kwargs)
778825
def fix_deplist(deps):
    
    deps = [
        ((dep.lower(),)
         if not isinstance(dep, (list, tuple))
         else tuple([dep_entry.lower()
                     for dep_entry in dep
                    ]))
        for dep in deps
    ]
    return deps
205929
def dedup_list(l):
    """"""
    dedup = set()
    return [ x for x in l if not (x in dedup or dedup.add(x))]
99547
protected void lookup(String lemma, String posTag, List<String> results) {
    synchronized (this) { // the stemmer is not thread-safe
      List<WordData> wordForms = stemmer.lookup(lemma + "|" + posTag);
      for (WordData wd : wordForms) {
        results.add(wd.getStem().toString());
      }
    }
  }
174193
def find(self, sought, view='lemma'):
        '''
        
        '''
        hits = []
        for sentence in self._sentences:
            hits += sentence.find(sought, view)
        return hits
1207842
function addToList(i, L, R) {
    R[L[i + 1]] = R[i];
    L[R[i]] = L[i + 1];
    R[i] = i + 1;
    L[i + 1] = i;
}
973309
private List<?> joinFeatures(List<?> list) {
        List result = new ArrayList<Object>();

        for (Object object : list) {
            int start = -1;
            int end = -1;

            if (object instanceof Gene) {
                result.add(object);
                start = ((Gene) object).getStart();
                end = ((Gene) object).getEnd();
            }

            if (object instanceof RegulatoryRegion) {
                result.add(object);
                start = ((RegulatoryRegion) object).getStart();
                end = ((RegulatoryRegion) object).getEnd();
            }

            if (object instanceof List) {
                result.addAll(joinFeatures((List) object));
            }

            /* Acutualizamos los valores maximo de end y minimo de start */
            if ((start != -1) && (start < min_start)) {
                min_start = start;
            }

            if ((end != -1) && (end > max_end)) {
                max_end = end;
            }
        }

        return result;
    }
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]
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