Skip to content

Commit

Permalink
Significant progress on v2.0 schema changes (#iss195)
Browse files Browse the repository at this point in the history
* Changes to content models and elements
* Updates to the documentation (but not the what's new part)
* Switching configTest to say 1.0 (since that's the truth)
* Small fixes and adjustments to the v1 to v2 conversion
  • Loading branch information
joeytakeda committed Feb 9, 2025
1 parent 6b41bf8 commit 31f5bd4
Show file tree
Hide file tree
Showing 8 changed files with 1,764 additions and 1,725 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<!--<echo message="Is not v2? ${isNotV2}"/>-->
</target>

<target name="convertConfigFile" if="${isNotV2}">
<target name="convertConfigFile" depends="checkConfigVersion" if:true="${isNotV2}">
<description>
TARGET convertConfigFile
This runs an identity transform on the supplied config
Expand Down
2 changes: 1 addition & 1 deletion configTest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://hcmc.uvic.ca/ns/staticSearch" version="2">
<config xmlns="http://hcmc.uvic.ca/ns/staticSearch">
<params>
<searchFile>test/search.html</searchFile>
<versionFile>test/VERSION</versionFile>
Expand Down
1,960 changes: 903 additions & 1,057 deletions docs/staticSearch.html

Large diffs are not rendered by default.

1,034 changes: 573 additions & 461 deletions schema/staticSearch.odd

Large diffs are not rendered by default.

423 changes: 260 additions & 163 deletions schema/staticSearch.rng

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion schema/staticSearch.sch
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:teix="http://www.tei-c.org/ns/Examples"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="d9e3448-constraint">
id="d9e3564-constraint">
<rule context="xh:span">
<report test="descendant::*[not(namespace-uri(.) = ('http://www.w3.org/1999/xhtml', 'http://www.tei-c.org/ns/1.0'))]">span descendants must be in the
namespaces
Expand Down
29 changes: 2 additions & 27 deletions schema/staticSearch_v2.odd
Original file line number Diff line number Diff line change
Expand Up @@ -243,36 +243,11 @@
<elementSpec ident="resultsPerPage" mode="delete"/>
<elementSpec ident="resultsLimit" mode="delete"/>

<elementSpec ident="results" mode="add" module="ss">
<gloss>Controls results configuration</gloss>
<attList>
<attDef ident="resultsPerPage">
<datatype>
<dataRef name="nonNegativeInteger"/>
</datatype>
<defaultVal>25</defaultVal>
</attDef>
<attDef ident="maxKwicsToShow">
<datatype>
<dataRef name="nonNegativeInteger"/>
</datatype>
<defaultVal>25</defaultVal>
</attDef>
<!--NOTE: Renamking resultsLimit to maxResults-->
<attDef ident="maxResults">
<datatype>
<dataRef name="nonNegativeInteger"/>
</datatype>
<defaultVal>2000</defaultVal>
</attDef>
</attList>
</elementSpec>

<elementSpec ident="versionFile" mode="change"
module="ss">
<altIdent>version</altIdent>
<classes mode="change">
<memberOf key="ss.atts.file" mode="add"/>
</classes>

<content>
<empty/>
</content>
Expand Down
37 changes: 23 additions & 14 deletions xsl/convert_v1_to_v2.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -102,29 +102,38 @@
file="{hcmc:getString(stopwordsFile, '')}"/>
<dictionary
file="{hcmc:getString(dictionaryFile, '')}"/>
<tokenizer
minWordLength="{xs:string(hcmc:getInteger(minWordLength, 2))}"/>
<scoringAlgorithm name="{hcmc:getString(scoringAlgorithm, 'raw')}"/>
<stemmer
dir="{hcmc:getString(stemmerFolder, 'stemmers/en/')}"/>
<tokenizer minWordLength="{hcmc:getInteger(minWordLength, 2)}"/>
<contexts
create="{hcmc:getStrBoolean(createContexts, 'false')}"
phrasalSearch="{hcmc:getStrBoolean(phrasalSearch, 'true')}"
wildcardSearch="{hcmc:getStrBoolean(wildcardSearch, 'true')}"
maxKwicsToHarvest="{hcmc:getInteger(maxKwicsToHarvest, 5)}"
maxKwicLength="{hcmc:getInteger(totalKwicLength, 15)}"
kwicTruncateString="{hcmc:getString(kwicTruncateString, '...')}"
/>
<createContexts>
<xsl:variable name="create"
select="hcmc:getStrBoolean(createContexts, 'true')" as="xs:string"/>
<xsl:attribute name="create" select="$create"/>
<!--If create is false, no other attributes are allowed, so we're done-->
<xsl:if test="$create = 'true'">
<!--Always check phrasal search-->
<xsl:variable name="phrasalSearch" as="xs:string"
select="hcmc:getStrBoolean(phrasalSearch, 'true')"/>
<xsl:attribute name="phrasalSearch" select="$phrasalSearch"/>
<xsl:attribute name="wildcardSearch"
select="hcmc:getStrBoolean(wildcardSearch, 'true')"/>
<xsl:if test="$phrasalSearch = 'false'">
<xsl:attribute name="maxKwicsToHarvest"
select="hcmc:getInteger(maxKwicsToHarvest, 5)"/>
</xsl:if>
<xsl:attribute name="maxKwicLength"
select="hcmc:getInteger(totalKwicLength, 15)"/>
<xsl:attribute name="kwicTruncateString"
select="hcmc:getString(kwicTruncateString, '...')"/>
</xsl:if>
</createContexts>
<results
resultsPerPage="{hcmc:getInteger(resultsPerPage, 100)}"
maxKwicsToShow="{hcmc:getInteger(maxKwicsToShow, 5)}"
maxResults="{hcmc:getInteger(resultsLimit, 1000)}"/>
<version file="{hcmc:getString(versionFile, '')}"/>

<!-- NOTE: I believe this should actually be:
<output dir=""/> -->
<outputDir name="{hcmc:getString(outputFolder, 'staticSearch')}"/>
<output dir="{hcmc:getString(outputFolder, 'staticSearch')}"/>
</xsl:copy>

<!-- Now we handle the things we want to warn about. -->
Expand Down

0 comments on commit 31f5bd4

Please sign in to comment.