Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to retrieve particular epigraphical markers #39

Closed
goodmami opened this issue Dec 12, 2019 · 1 comment
Closed

Add function to retrieve particular epigraphical markers #39

goodmami opened this issue Dec 12, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@goodmami
Copy link
Owner

This issue is spun off of #37. To find a particular type of marker for some triple, one must do something like:

for epi in g.epidata[triple]:
    if isinstance(epi, marker_type):
        # do something with epi

It would be convenient to be able to request those directly, e.g.:

g.get_marker(marker_type)

Questions:

  • where does this function go? on the Graph class? in penman.epigraph?
  • should there be separate functions to return (1) all markers of a type and (2) just the first one, or just one function? Aside from POP, there is generally never multiple markers of the same (leaf) type for a triple, so it seems more convenient to just get the first one.
@goodmami
Copy link
Owner Author

goodmami commented Jan 4, 2020

I'm adding a function specifically to get the variable that is pushed by a triple, if any, which resolves the original reason for this issue. Even though it doesn't solve it in the general case, perhaps these specific functions (like surface.alignments() and surface.role_alignments()) are more usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant