Skip to content

Summarizer breaks on empty input #364

@marcverhagen

Description

@marcverhagen

When the annotation lists are empty the summarizer breaks.

Try running it on cpb-aacip-225-12z34w2c.start.minimal.json.

Traceback (most recent call last):
  File "/Users/marc/Documents/git/clams/mmif-summarizer/code/run_summarizer.py", line 11, in <module>
    create_summary()
  File "/Users/marc/Documents/git/clams/mmif-summarizer/code/summarizer/__init__.py", line 32, in create_summary
    mmif_summary = Summary(mmif_text)
  File "/Users/marc/Documents/git/clams/mmif-summarizer/code/summarizer/summary.py", line 126, in __init__
    self.graph = Graph(self.mmif)
  File "/Users/marc/Documents/git/clams/mmif-summarizer/code/summarizer/graph.py", line 29, in __init__
    self._init_edges()
  File "/Users/marc/Documents/git/clams/mmif-summarizer/code/summarizer/graph.py", line 59, in _init_edges
    self.add_edge(view, alignment)
  File "/Users/marc/Documents/git/clams/mmif-summarizer/code/summarizer/graph.py", line 81, in add_edge
    source.set_alignment_anchors(target)
  File "/Users/marc/Documents/git/clams/mmif-summarizer/code/summarizer/graph.py", line 242, in set_alignment_anchors
    target_attype = target.at_type.shortname
AttributeError: 'NoneType' object has no attribute 'at_type'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions