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

a function to align two words #7

Open
lsmith77 opened this issue Oct 17, 2022 · 4 comments
Open

a function to align two words #7

lsmith77 opened this issue Oct 17, 2022 · 4 comments

Comments

@lsmith77
Copy link

I want to align two words, ie. if I have challenges, I pass question to this alignment function it would generate questions.

Is this something within the scope of this library?

@lsmith77
Copy link
Author

I am using spacy in my project, so I did a quick hack which works but is very inelegant:

        a_text = a_token.text
        b_text = b_token.lemma_
        a_verb = Verb(a_text)
        b_verb = Verb(b_text)

        if a_verb.is_singular():
            b_text = b_verb.singular()
            b_verb = Verb(b_text)
        elif a_verb.is_plural():
            b_text = b_verb.plural()
            b_verb = Verb(b_text)

        if a_verb.is_past():
            b_text = b_verb.past()
        elif a_verb.is_pres_part():
            b_text = b_verb.pres_part()
        elif a_verb.is_past_part():
            b_text = b_verb.past_part()

        return b_text

@tomaarsen
Copy link
Owner

That is indeed a bit inelegant. That functionality does not exist, although it certainly could.

@lsmith77
Copy link
Author

so you would be open to a PR? in that case I will see if I can find some time for this.

@tomaarsen
Copy link
Owner

Yes, I would be!

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

No branches or pull requests

2 participants