Appendix III: ReliefStructures.py """ReliefStructures.py : Contains data structures for parties involved in relief efforts""" from import enum Enum import logging logging.basicConfig(level=logging.INFO) # Comment this line out to silence the script class NamedEntity(object): """ Interface for entities with proper names """ "" NAMES_FILE = """Name of the file that contains the names for this entity""" @staticmethod def load_names(ne_class): """Loads names for the given named entity class""" with "r") as open(ne_class.NAMES_FILE, names_file: for in line names_file: "" name = """The actual matching name from NamedEntity.names""" def __init__(self, name): self.name = name def __hash__(self): return hash(self.name) def __eq__(self, other): return self.name == other.name def __str__(self): return self.name class Location(NamedEntity): """ Represents a location """
Appendix III: ReliefStructures.py """ReliefStructures.py : Contains data structures for parties involved in relief efforts""" from enum import Enum import logging logging.basicConfig(level=logging.INFO) # Comment this line out to silence the script class NamedEntity(object): """ Interface for entities with proper names """ NAMES_FILE = "" """Name of the file that contains the names for this entity""" @staticmethod def load_names(ne_class): """Loads names for the given named entity class""" with open(ne_class.NAMES_FILE, "r") as names_file: for line in names_file: name = "" """The actual matching name from NamedEntity.names""" def __init__(self, name): self.name = name def __hash__(self): return hash(self.name) def __eq__(self, other): return self.name == other.name def __str__(self): return self.name class Location(NamedEntity): """ Represents a location """