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

Predicate terminology is outdated #117

Closed
goodmami opened this issue Jul 26, 2017 · 2 comments
Closed

Predicate terminology is outdated #117

goodmami opened this issue Jul 26, 2017 · 2 comments
Assignees
Milestone

Comments

@goodmami
Copy link
Member

PyDelphin still refers to "string" and "grammar" predicates, where these should be "surface" and "abstract" ("string" is compared to "type", not "grammar"/"abstract").

@goodmami
Copy link
Member Author

This entails several steps:

  • provide the correct terminology, but don't break backward compatibility
  • issue a DeprecationWarning (see the @deprecated function decorator in delphin.util) if the old form is used
  • add the affected functions/classes/etc. to Remove deprecated components #139

@goodmami
Copy link
Member Author

@mcmillanmajora I had to double-check because "string" and "grammar" don't directly correlate with "surface" and "abstract", but it appears that the code was treating them as equivalent, so it should be safe to just rename one with the other. But in the interest of backward-compatibility, retain the old names as well. E.g.:

class Pred(...):
    ...
    ABSTRACT = GRAMMARPRED = 0
    ...
    @classmethod
    @deprecated(final_version='1.0.0', alternative='Pred.abstract()`)
    def grammarpred(cls, predstr):
        """Instantiate a Pred from its symbol string."""
        return cls.abstract(predstr)

    @classmethod
    def abstract(cls, predstr):
        """Instantiate a Pred from its symbol string."""
        lemma, pos, sense, _ = split_pred_string(predstr)
        return cls(Pred.ABSTRACT, lemma, pos, sense, predstr)
    ...

Also go through and reword docstrings, as appropriate, and unit tests.

@goodmami goodmami added this to the v0.8.0 milestone Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants