<commit_before>from table import String, Term, Concept, Word
from connection import Connection
from collections import defaultdict
from itertools import chain


class Aggregator(object):
    """Example class of Aggregate queries using different UMLS tables"""

    def __init__(self, dbname="umls", hostname="localhost", port=27017):
        """
        Initialize an aggregator of different tables.

        :param dbname: the name of the DB, default is UMLS
        :param hostname: the name of the host, default is localhost
        :param port: the port on which your mongodb runs, default is 27107
        :return: None
        """
        self._connection = Connection(dbname, hostname, port)

        self.string = String(self._connection)
        self.term = Term(self._connection)
        self.concept = Concept(self._connection)
        self.word = Word(self._connection)

    def concepts_string(self, string):
        """
        Get all concept objects given a string.

        :param string: the string for which to search concepts
        :return: a list of concepts.
        """
        concepts = self.string.concept_id(string)
        if not concepts:
            return []

        return list(self.concept.bunch(concepts))<commit_msg>removed Word<commit_after>from table import String, Term, Concept
from connection import Connection
from collections import defaultdict
from itertools import chain


class Aggregator(object):
    """Example class of Aggregate queries using different UMLS tables"""

    def __init__(self, dbname="umls", hostname="localhost", port=27017):
        """
        Initialize an aggregator of different tables.

        :param dbname: the name of the DB, default is UMLS
        :param hostname: the name of the host, default is localhost
        :param port: the port on which your mongodb runs, default is 27107
        :return: None
        """
        self._connection = Connection(dbname, hostname, port)

        self.string = String(self._connection)
        self.term = Term(self._connection)
        self.concept = Concept(self._connection)

    def concepts_string(self, string):
        """
        Get all concept objects given a string.

        :param string: the string for which to search concepts
        :return: a list of concepts.
        """
        concepts = self.string.concept_id(string)
        if not concepts:
            return []

        return list(self.concept.bunch(concepts))
{'fraction_non_alphanumeric': 0.080553295362083, 'fraction_numerical': 0.008136696501220505, 'mean_word_length': 2.714501510574018, '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': '5234489', 'n_tokens_mistral': 658, 'n_tokens_neox': 620, 'n_words': 235}