|
105 | 105 | what's present. --> |
106 | 106 | <searchPage file="{hcmc:getString(searchFile/text(),$defaultParams?searchPage.file)}"/> |
107 | 107 | <index recurse="{hcmc:getStrBoolean(recurse, $defaultParams?index.recurse)}"/> |
108 | | - <stopwords> |
109 | | - <xsl:attribute name="file"> |
110 | | - <!--Per #322, default stopwords files have been moved to their own dedicated directory, |
| 108 | + |
| 109 | + <!--Per #322, default stopword and dictionary files have been moved to their own dedicated directories, |
111 | 110 | so we should warn if it appears that a default may have been used --> |
112 | | - <xsl:variable name="pointer" |
113 | | - select="hcmc:getString(stopwordsFile, $defaultParams?stopwords.file)" |
114 | | - as="xs:string"/> |
115 | | - <xsl:variable name="resolvedURI" select="resolve-uri($pointer)" as="xs:anyURI"/> |
116 | | - <xsl:if test="matches($resolvedURI,'/xsl/.+_stopwords.txt$')"> |
117 | | - <xsl:message>WARNING: Stopword files have been moved to /stopwords/; if you had been |
118 | | - using a default stopwords file bundled with v1 of staticSearch (xsl/.+_stopwords.txt), |
119 | | - then you may need to update your config file to use /stopwords/.</xsl:message> |
120 | | - </xsl:if> |
121 | | - <xsl:sequence select="$pointer"/> |
122 | | - </xsl:attribute> |
123 | | - </stopwords> |
124 | | - <dictionary> |
125 | | - <xsl:attribute name="file"> |
126 | | - <!--Per #322, default dictionary files have been moved to their own dedicated directory, |
127 | | - so we should warn if it appears that a default may have been used --> |
128 | | - <xsl:variable name="pointer" |
129 | | - select="hcmc:getString(dictionaryFile, $defaultParams?dictionary.file)" as="xs:string"/> |
130 | | - <xsl:variable name="resolvedURI" select="resolve-uri($pointer)" as="xs:anyURI"/> |
131 | | - <xsl:if test="matches($resolvedURI,'/xsl/.+_words.txt$')"> |
132 | | - <xsl:message>WARNING: Dictionary files have been moved to /dicts/; if you had been |
133 | | - using a default dictionary file bundled with v1 of staticSearch (xsl/.+_words.txt), |
134 | | - then you may need to update your config file to use /dicts/.</xsl:message> |
135 | | - </xsl:if> |
136 | | - <xsl:sequence select="$pointer"/> |
137 | | - </xsl:attribute> |
138 | | - </dictionary> |
| 111 | + <xsl:variable name="stopwordsFilePointer" |
| 112 | + select="hcmc:getString(stopwordsFile, $defaultParams?stopwords.file)" |
| 113 | + as="xs:string"/> |
| 114 | + <xsl:variable name="resolvedStopwordsURI" |
| 115 | + select="resolve-uri($stopwordsFilePointer)" |
| 116 | + as="xs:anyURI"/> |
| 117 | + <xsl:if test="matches($resolvedStopwordsURI,'/xsl/.+_stopwords.txt$')"> |
| 118 | + <xsl:message |
| 119 | + select="'WARNING: Stopword files have been moved to /stopwords/; |
| 120 | + if you had been using a default stopwords file bundled with v1 |
| 121 | + of staticSearch (xsl/.+_stopwords.txt), then you may need to update |
| 122 | + your config file to use /stopwords/.' |
| 123 | + => normalize-space()"/> |
| 124 | + <xsl:comment>stopwords/@file may need to be changed to use a file in /stopwords/</xsl:comment> |
| 125 | + </xsl:if> |
| 126 | + <stopwords file="{$stopwordsFilePointer}"/> |
| 127 | + |
| 128 | + <!--Now do the same as above, but for the dictionary--> |
| 129 | + <xsl:variable name="dictionaryFilePointer" |
| 130 | + select="hcmc:getString(dictionaryFile, $defaultParams?dictionary.file)" |
| 131 | + as="xs:string"/> |
| 132 | + <xsl:variable name="resolvedDictionaryURI" |
| 133 | + select="resolve-uri($dictionaryFilePointer)" |
| 134 | + as="xs:anyURI"/> |
| 135 | + <xsl:if test="matches($resolvedDictionaryURI,'/xsl/.+_words.txt$')"> |
| 136 | + <xsl:message |
| 137 | + select="'WARNING: Dictionary files have been moved to /dicts/; |
| 138 | + if you had been using a default dictionary file bundled with |
| 139 | + v1 of staticSearch (xsl/.+_words.txt), then you may need to update |
| 140 | + your config file to use /dicts/.' |
| 141 | + => normalize-space()"/> |
| 142 | + <xsl:comment>dictionary/@file may need to be changed to use a file in /dicts/</xsl:comment> |
| 143 | + </xsl:if> |
| 144 | + <dictionary file="{$dictionaryFilePointer}"/> |
| 145 | + |
139 | 146 | <scoringAlgorithm name="{hcmc:getString(scoringAlgorithm, $defaultParams?scoringAlgorithm.name)}"/> |
140 | 147 | <xsl:variable name="stemmerFolder" |
141 | 148 | select="if (stemmerFolder) then concat('stemmers/', stemmerFolder) else ()" as="xs:string?"/> |
|
0 commit comments