Return an iterator over corpus documents.
961167
def iter_documents(self, fileids=None, categories=None, _destroy=False):
        
        doc_ids = self._filter_ids(fileids, categories)
        for doc in imap(self.get_document, doc_ids):
            yield doc
            if _destroy:
                doc.destroy()
1156354
def iter(self, match="*", count=1000):
        
        for field, value in self._client.hscan_iter(
          self.key_prefix, match=match, count=count):
            yield self._decode(field)
1157595
def get_iterator(self, query, **options):
        """"""
        return EventsPageIterator(self.client, '/events', query, options).items()
394494
def sentences(self):
        """"""
        prevp = 0
        prevs = 0
        sentence = [];
        sentence_id = ""
        for word, id, pos, lemma in iter(self):
            try:
                doc_id, ptype, p, s, w = re.findall('([\w\d-]+)\.(p|head)\.(\d+)\.s\.(\d+)\.w\.(\d+)',id)[0]
                if ((p != prevp) or (s != prevs)) and sentence:
                    yield sentence_id, sentence
                    sentence = []
                    sentence_id = doc_id + '.' + ptype + '.' + str(p) + '.s.' + str(s)
                prevp = p
            except IndexError:
                doc_id, s, w = re.findall('([\w\d-]+)\.s\.(\d+)\.w\.(\d+)',id)[0]
                if s != prevs and sentence:
                    yield sentence_id, sentence
                    sentence = []
                    sentence_id = doc_id + '.s.' + str(s)
            sentence.append( (word,id,pos,lemma) )
            prevs = s
        if sentence:
            yield sentence_id, sentence
289925
def iterdict(self):
        """"""
        from collections import OrderedDict

        headers = None

        for row in self:

            if headers is None:
                headers = row
                continue

            yield OrderedDict(zip(headers, row))
861565
def match_query_to_corpus(self):
		
		ranking = []
		for i,doc in enumerate(self.processed_corpus):
			rank = 0.0
			for word in self.processed_query:
				if word in doc:
					rank += self.term_frequencies[i][word] * self.inverse_document_frequencies[word]
			ranking.append((rank,i))
		matching_corpus_index = 0
		max_rank = 0
		for rank,index in ranking:
			if rank > max_rank:
				matching_corpus_index = index
				max_rank = rank
		return matching_corpus_index
1071660
def iter_query(query):
    """"""
    try:
        itr = click.open_file(query).readlines()
    except IOError:
        itr = [query]
    return itr
191254
def iter_cols(self, start=None, end=None):
        """"""
        start = start or 0
        end = end or self.ncols
        for i in range(start, end):
            yield self.iloc[:, i]
411449
def iterCodons(self) :
		""""""
		for i in range(len(self.cDNA)/3) :
			yield self.getCodon(i)
485593
def raw_corpus_rougel(hypotheses: Iterable[str], references: Iterable[str]) -> float:
    
    return rouge.rouge_l(hypotheses, references)
766728
def iter_files(self):
        """"""
        # file_iter may be a callable or an iterator
        if callable(self.file_iter):
            return self.file_iter()
        return iter(self.file_iter)
133266
def iteritems(d, **kw):
    """"""
    if not PY2:
        return iter(d.items(**kw))
    return d.iteritems(**kw)
1194147
def iteritems(self, **options):
        ''''''
        iter = self.query(**options)
        while True:
            obj = iter.next()
            yield (obj.id, obj)
469817
def get_iterator(self, data, axis=0):
        
        splitter = self._get_splitter(data, axis=axis)
        keys = self._get_group_keys()
        for key, (i, group) in zip(keys, splitter):
            yield key, group
1211009
def _iterator(self, response):
        '''
        
        '''

        while True:
            result = self._parse_data(response)
            bookmark = response.get('bookmark')
            if result:
                for row in result:
                    yield row

                del result

                if not bookmark:
                    break

                response = self._call(bookmark=bookmark)

            else:
                break
496603
def _process_all_1(self, texts:Collection[str]) -> List[List[str]]:
        ""
        tok = self.tok_func(self.lang)
        if self.special_cases: tok.add_special_cases(self.special_cases)
        return [self.process_text(str(t), tok) for t in texts]
326579
public function getIterator()
    {
        //Run the query
        $resp = $this->query->execute();

        //Return the documents as an ArrayIterator to satisfy the requirements
        //of the getIterator function.
        foreach ($resp->data as $document)
        {
            yield $document;
        }

        while ($resp->cursors->next) {
            //send a new request, resetting $resp
            $resp = $this->query->execute($resp->cursors->next);

            foreach ($resp->data as $document)
            {
                yield $document;
            }
        }
    }