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

fix: Counting of nested AIS details in HTML export #40

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

CarstenWickner
Copy link
Member

The count of AIS details in the HTML export is showing too high values if there are nested details I’ve attached a minimal example, to illustrate it, also with the generated HTML file after the fix I made.

  • The count inside the application is correct.
  • The count of annotated tokens in the HTML export is including also tokens without an assigned category if they are surrounded by an annotated detail.
  • The sums of parent/branch categories (e.g, “int” and “Ext”) in the HTML export are higher than the actual sum of their child categories if there are such tokens without an assigned category wrapped by an annotated detail.
  • The count of child/leaf categories in the HTML export is correct.

For reference, attached a minimal example AIS project and erroneous HTML export result.
reproduce-bug.zip

@@ -197,7 +197,7 @@ span.detail-end { float: right; }
</xsl:if>
</td>
<td class="number">
<xsl:value-of select="count(.//ais:Detail//ais:Token)" />
<xsl:value-of select="count(.//ais:Detail[@code]/ais:Token)" />
Copy link
Member Author

Choose a reason for hiding this comment

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

Overall token count on the results table.

Fix 1: Ensure no double-counting of tokens that are within nested detail annotations. (removing one slash /)
Fix 2: Exclude tokens from the total count when they are surrounded by an annotated detail but don't have a specific category assigned to themselves. (checking for code attribute's existence)

@@ -241,7 +241,7 @@ span.detail-end { float: right; }
<xsl:value-of select="concat(' ',@code,' ')" />
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="count($interview//ais:Detail[contains($childCodes,concat(' ',@code,' '))])" />
<xsl:value-of select="count($interview//ais:Detail[@code and contains($childCodes,concat(' ',@code,' '))])" />
Copy link
Member Author

Choose a reason for hiding this comment

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

Count of annotated details in parent category: sum of annotations for child categories

Fix 3: Exclude token sections surrounded by an annotated detail that don't have a specific category assigned to themselves. (checking for code attribute's existence)

@CarstenWickner CarstenWickner merged commit 6cc49e7 into develop Jun 13, 2023
@CarstenWickner CarstenWickner deleted the fix-count-in-export branch June 13, 2023 21:15
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.

None yet

1 participant