Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: compound rows in paradigms #858

Merged
merged 11 commits into from
Jun 16, 2021
Merged

feat: compound rows in paradigms #858

merged 11 commits into from
Jun 16, 2021

Conversation

eddieantonio
Copy link
Member

What's in this PR?

Adds compound rows! Do you have inflections that have multiple valid realizations? What's the plural of cactus? This PR will place each wordform on its own row instead of concactenating all the results together on the same line!

Before:
kinipânânaw on the same line

After:
kinipânânaw on its own line

  • added: CompoundRow class — contains multiple ContentRow
  • added: RowLabel has a row_span attribute, which allows it to label multiple rows!
  • added: Pane.tr_rows — iterates rows that should create <tr> in the HTML output
  • added: SuppressOutputCell — indicates that a <td> should NOT be created in the HTML output
  • added: a bevy of unit tests, integration tests, and end-to-end tests

Fixes #507

@codecov-commenter
Copy link

Codecov Report

Merging #858 (254be70) into main (0ed6a09) will increase coverage by 1.81%.
The diff coverage is 89.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #858      +/-   ##
==========================================
+ Coverage   79.85%   81.67%   +1.81%     
==========================================
  Files         104      106       +2     
  Lines        4279     4414     +135     
  Branches      636      650      +14     
==========================================
+ Hits         3417     3605     +188     
+ Misses        743      683      -60     
- Partials      119      126       +7     
Impacted Files Coverage Δ
src/CreeDictionary/CreeDictionary/urls.py 100.00% <ø> (ø)
src/CreeDictionary/morphodict/urls.py 100.00% <ø> (ø)
.../CreeDictionary/DatabaseManager/test_db_builder.py 36.20% <50.00%> (ø)
src/CreeDictionary/API/search/cvd_search.py 83.33% <66.66%> (-5.56%) ⬇️
src/CreeDictionary/CreeDictionary/views.py 78.26% <68.00%> (-2.33%) ⬇️
.../CreeDictionary/CreeDictionary/paradigm/manager.py 80.26% <76.19%> (-14.61%) ⬇️
...CreeDictionary/paradigm/crkeng_corpus_frequency.py 80.76% <80.76%> (ø)
...nary/management/commands/ensurecypressadminuser.py 71.87% <83.33%> (+4.01%) ⬆️
...rc/CreeDictionary/CreeDictionary/paradigm/panes.py 87.94% <97.40%> (+2.27%) ⬆️
src/CreeDictionary/CreeDictionary/hfstol.py 86.95% <100.00%> (-0.55%) ⬇️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 383c80d...254be70. Read the comment docs.

"""
if not self.is_inflection:
return self
return (self,)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this need to be a tuple?

Copy link
Member Author

Choose a reason for hiding this comment

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

The API for Cell.fill() changed such that filling any cell can return one or more results, hence a tuple. Maybe this isn't the best API change though :/

Copy link
Contributor

@nienna73 nienna73 left a comment

Choose a reason for hiding this comment

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

What is the plural of cactus? 🤔

@andrewdotn
Copy link
Contributor

The code looks ok, but honestly I like the version in the first screenshot better, the part with the slash instead of multiple rows.

I don’t see that on the production itwêwina site, so is that something you were experimenting with?

With the two images side by side, seeing kinipânaw / kinipânânaw looks like two options for the same thing, where the stacked cells make it look to me like there’s a missing label.

That’s just my opinion though, I’m happy with whatever others decide to do here.

@eddieantonio
Copy link
Member Author

The code looks ok, but honestly I like the version in the first screenshot better, the part with the slash instead of multiple rows.

Yeah, I think styling needs to make it obvious that these forms are related.

I don’t see that on the production itwêwina site, so is that something you were experimenting with?

Yeah, production itwêwina doesn't even render multiple forms 💀

With the two images side by side, seeing kinipânaw / kinipânânaw looks like two options for the same thing, where the stacked cells make it look to me like there’s a missing label.

That’s just my opinion though, I’m happy with whatever others decide to do here.

I think the paradigm presentation needs to be worked on soon (styling, bolding, grouping, etc.). @aarppe, @dwhieb, what do other sources use for when there are multiple realizations of the same inflection?

@eddieantonio
Copy link
Member Author

What is the plural of cactus? 🤔

cactus+N+Pl	cactuses
cacus+N+Pl	cacti

It can be either cactuses or cacti. Both are acceptable and understandable inflections. Now how do you cram that into a single paradigm?

@aarppe
Copy link
Contributor

aarppe commented Jun 15, 2021

Looking at various on-line resources on paradigms, some by more established entities and others by more random matches when searching for 'paradigm(s)', Wiktionary appears to put alternative forms on their own lines (separated by a semicolon, that I'd ignore), e.g. for the Finnish hevonen 'horse'. Whether the alternative words end up on their own lines due to cell size or not is not clear.

image

Another approach is taken by this older resource for Latin, separating alternative forms with commas (link):

image

This same approach is used in the (Finnish) Language Bureau's on-line dictionary for Finnish, again with hevonen:

image

Another alternative approach for Latin uses slashes to separate alternative forms (link):

image

I'd think that we can use any approach that is clear and makes sense to users. A slash is quite broadly understood to separate alternatives.

@eddieantonio eddieantonio merged commit 0b16c65 into main Jun 16, 2021
@eddieantonio eddieantonio deleted the feat/compound-rows branch June 16, 2021 15:54
@eddieantonio eddieantonio mentioned this pull request Jun 16, 2021
6 tasks
@eddieantonio
Copy link
Member Author

I merged this, but @andrewdotn, I think you're right. Slashes would probably work better, given the examples @aarppe posted. I'll punt that change until #862. In the meantime, @aarppe, this PR fixes the issue that highlighting should apply for each observed wordform rather than analysis.

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

Successfully merging this pull request may close these issues.

Split inflections with multiple possible forms over several lines
5 participants