# Path: nordlys/tagme/config.py
# SF_WIKI = SurfaceForms(collection=COLLECTION_SURFACEFORMS_WIKI)


from nordlys.tagme.config import SF_WIKI
"""
Tools for processing mentions:
  -  Finds candidate entities
  -  Calculates commonness

@author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no)
"""



class Mention(object):

    def __init__(self, text):
        self.text = text.lower()
        self.__matched_ens = None       # all entities matching a mention (from all sources)
        self.__wiki_occurrences = None

    @property
    def matched_ens(self):
        return self.__gen_matched_ens()

    @property
    def wiki_occurrences(self):
        return self.__calc_wiki_occurrences()

    def __gen_matched_ens(self):
        """Gets all entities matching the n-gram"""
        if self.__matched_ens is None:

# Path: nordlys/tagme/config.py
# SF_WIKI = SurfaceForms(collection=COLLECTION_SURFACEFORMS_WIKI)


# Path: nordlys/tagme/mention.py
from nordlys.tagme.config import SF_WIKI

"""
Tools for processing mentions:
  -  Finds candidate entities
  -  Calculates commonness

@author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no)
"""



class Mention(object):

    def __init__(self, text):
        self.text = text.lower()
        self.__matched_ens = None       # all entities matching a mention (from all sources)
        self.__wiki_occurrences = None

    @property
    def matched_ens(self):
        return self.__gen_matched_ens()

    @property
    def wiki_occurrences(self):
        return self.__calc_wiki_occurrences()

    def __gen_matched_ens(self):
        """Gets all entities matching the n-gram"""
        if self.__matched_ens is None:

            matches = SF_WIKI.get(self.text)