<commit_before>#!/usr/bin/env python3
# vim: set fileencoding=utf-8 :

"""
Reads a regular text corpus where the relevant units (usually paragraphs)
are separated by newlines.
"""

from __future__ import absolute_import, division, print_function
from contextlib import contextmanager

from emLam.corpus.corpus_base import RawCorpus
from emLam.corpus.hacks import split_for_qt

class TextCorpus(RawCorpus):
    NAME = 'text'
    DESCRIPTION = 'newline-separated text corpus'

    @contextmanager
    def instream(self, input_file):
        def __instream():<commit_msg>Making clear that the 'text' corpus is a generic one.<commit_after>#!/usr/bin/env python3
# vim: set fileencoding=utf-8 :

"""
Reads a regular text corpus where the relevant units (usually paragraphs)
are separated by newlines.
"""

from __future__ import absolute_import, division, print_function
from contextlib import contextmanager

from emLam.corpus.corpus_base import RawCorpus
from emLam.corpus.hacks import split_for_qt

class TextCorpus(RawCorpus):
    NAME = 'text'
    DESCRIPTION = 'generic newline-separated text corpus'

    @contextmanager
    def instream(self, input_file):
        def __instream():
{'fraction_non_alphanumeric': 0.08023648648648649, 'fraction_numerical': 0.0033783783783783786, 'mean_word_length': 4.8088235294117645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '212582', 'n_tokens_mistral': 375, 'n_tokens_neox': 348, 'n_words': 113}