Skip to content

Commit

Permalink
Add remove surface alignments to rbw aligner
Browse files Browse the repository at this point in the history
  • Loading branch information
bjascob committed Jan 4, 2021
1 parent eefd9e4 commit c38aab2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions amrlib/alignments/rbw_aligner/rbw_aligner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from types import SimpleNamespace
import penman
from penman.models.noop import NoOpModel
from penman.surface import AlignmentMarker
from .match_candidates import get_match_candidates


Expand Down Expand Up @@ -54,6 +55,12 @@ def get_penman_graph(self):
def get_graph_string(self):
return penman.encode(self.graph, model=NoOpModel(), indent=6)

# Remove the surface alignments from the penman graph
def remove_surface_alignments(self):
for key, values in self.graph.epidata.items():
self.graph.epidata[key] = [x for x in values if not isinstance(x, AlignmentMarker)]


###########################################################################
#### Rule Base Word Alignments added to Graph as Surface Aligments
###########################################################################
Expand Down

0 comments on commit c38aab2

Please sign in to comment.