Skip to content
Browse files

Fix breakage from merge

  • Loading branch information...
1 parent 7372fba commit 3412ea7753ba847f02d03bf13d92a0d39287eef8 @spyysalo spyysalo committed Jun 20, 2012
Showing with 7 additions and 21 deletions.
  1. +7 −21 server/src/annotator.py
View
28 server/src/annotator.py
@@ -464,12 +464,6 @@ def create_span(collection, document, offsets, type, attributes=None,
return _create_span(collection, document, offsets, type, attributes,
id, comment)
-#TODO: ONLY determine what action to take! Delegate to Annotations!
-def _create_span(collection, document, offsets, _type, attributes=None,
- _id=None, comment=None):
- directory = collection
- undo_resp = {}
-
def _set_normalizations(ann_obj, ann, normalizations, mods, undo_resp={}):
# Find existing normalizations (if any)
existing_norm_anns = set((a for a in ann_obj.get_normalizations()
@@ -604,7 +598,7 @@ def _set_comments(ann_obj, ann, comment, mods, undo_resp={}):
mods.deletion(found)
#TODO: ONLY determine what action to take! Delegate to Annotations!
-def _create_span(collection, document, start, end, _type, attributes=None,
+def _create_span(collection, document, offsets, _type, attributes=None,
normalizations=None, _id=None, comment=None):
directory = collection
undo_resp = {}
@@ -649,30 +643,22 @@ def _create_span(collection, document, start, end, _type, attributes=None,
# comments etc. should be attached to. If there's an event,
# attach to that; otherwise attach to the textbound.
if e_ann is not None:
- # Assign attributes to the event, not the trigger
- attrib_on = e_ann
+ # Assign to the event, not the trigger
+ target_ann = e_ann
else:
- attrib_on = tb_ann
- _set_attributes(ann_obj, attrib_on, _attributes, mods,
+ target_ann = tb_ann
+ _set_attributes(ann_obj, target_ann, _attributes, mods,
undo_resp=undo_resp)
- # Handle annotation comments
- if tb_ann is not None:
- # If this is an event, we want to attach the comment to it
- if e_ann is not None:
- comment_on = e_ann
- else:
- comment_on = tb_ann
-
- # Set annotation attributes
+ # Set attributes
_set_attributes(ann_obj, target_ann, _attributes, mods,
undo_resp=undo_resp)
# Set normalizations
_set_normalizations(ann_obj, target_ann, _normalizations, mods,
undo_resp=undo_resp)
- # Handle annotation comments
+ # Set comments
if tb_ann is not None:
_set_comments(ann_obj, target_ann, comment, mods,
undo_resp=undo_resp)

0 comments on commit 3412ea7

Please sign in to comment.
Something went wrong with that request. Please try again.