Created
February 5, 2013 00:26
-
-
Save maliabadi/4711060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DeclarativeMessage(Message): | |
__metaclass__ = _DeclarativeMeta | |
query = None | |
query_rows = 1 # most common case | |
role = None | |
processor = None | |
domain = None | |
range = None | |
rel_ = None | |
rel_kwargs = None | |
params = None | |
features = None | |
frequency = None | |
time = None | |
location = None | |
mixins = None | |
# approximate = None # .approximate exists... should be .add_approximate | |
def __init__(self, context, topic=None, **kwargs): | |
self.relations = [] | |
self.topic = topic | |
self.context = copy(context) # so we can mutate w/out caring | |
self.semantic_element = None | |
if self.features is None: | |
self.features = get_features_frame() | |
else: | |
# don't overwrite the original | |
self.features = get_features_frame(self.features) | |
if self.rel_kwargs is None: | |
self.rel_kwargs = {} | |
else: | |
# don't overwrite the original | |
self.rel_kwargs = deepcopy(self.rel_kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment