Implementing searchable inferred glosses
to : Martin Holmes
Minutes: 25
On Wednesday, following the project’s decision to put inferred glosses on entry pages invisibly, but make them searchable, I implemented that. In the process noticed that we were already using inferred glosses in the titles of entry pages, so I suppressed them there.
On Friday, SK reported that three other raised characters (upsilon, small capital i, and iota) were not rendering in the PDF, so I generalized the replacement mechanism previously devised to add the following in post-processing (posting it here since it’s a generalizable strategy for other contexts):
<xsl:template match="text()[matches(., $reRaisedChars)]"
as="item()+" exclude-result-prefixes="#all">
<xsl:analyze-string regex="{$reRaisedChars}" select=".">
<xsl:matching-substring>
<xsl:variable name="regularChar" as="xs:string"
select="map:get($mapRaisedCharsToSubstitutes, .)"/>
<fo:inline baseline-shift="30%"
font-size="70%"><xsl:value-of separator=""
select="$regularChar"/></fo:inline>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:copy-of select="."/>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>