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

Show how letters and words can be veiled #716

Merged
merged 15 commits into from
Jul 13, 2023
Merged

Show how letters and words can be veiled #716

merged 15 commits into from
Jul 13, 2023

Conversation

kwalcock
Copy link
Member

No description provided.

@kwalcock
Copy link
Member Author

There were tiny changes made to some existing processors classes, but only for convenience, and the webapp output was beautified. Otherwise, the functionality lies in Veil.scala, which can be scrapped or sit there harmlessly if need be.

@MihaiSurdeanu
Copy link
Contributor

This feels very complicated. I think I'd like an example before I'm convinced...

@kwalcock
Copy link
Member Author

There are two examples (veilText, veilDocument) at the bottom of Veil.scala. Would those suffice?

Copy link
Contributor

@MihaiSurdeanu MihaiSurdeanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Just to be safe, we should ask @myedibleenso for his feedback as well.

@kwalcock
Copy link
Member Author

This PR has been updated with the changes to master. In review, it includes

  • small refactorings in Document and Sentence that allow internals to be manipulated more easily
  • the veiling functionality in an independent class
  • two examples of veiling
  • some cosmetic webapp improvements (which I will probably move to a different PR)

@myedibleenso, I'd like to get this merged as soon as you can look at it.

Unless something is wrong with the changes to Document and Sentence, this code will probably just sit around until someone needs it. In a PR is not a good place to sit, though.

val document = processor.mkDocument(text)
val veiledWords = Seq((0, Range.inclusive(document.sentences(0).raw.indexOf("("), document.sentences(0).raw.indexOf(")"))))
val veiledDocument = new VeiledDocument(document, veiledWords)
val annotatedDocument = veiledDocument.annotate(processor)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a type hint here to make it clear that annotatedDocument is a Document.

Copy link
Member

@myedibleenso myedibleenso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! Sorry, @kwalcock . I somehow lost track of this PR from ages ago. Thank you for the reminder. I think this is going to be very useful for a bunch of tasks.

@kwalcock
Copy link
Member Author

Good point. It's even better than a hint: it's enforced.

@MihaiSurdeanu
Copy link
Contributor

I think this is ready to be merged. Thanks @kwalcock !

@kwalcock kwalcock merged commit 77159ff into master Jul 13, 2023
@kwalcock kwalcock deleted the kwalcock/veil branch July 13, 2023 23:41
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

Successfully merging this pull request may close these issues.

3 participants