mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3039: English stemmer returns wrong word if the word is capitalized
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -54,6 +54,7 @@ Bugs fixed
|
||||
* #3003: literal blocks in footnotes are not supported by Latex
|
||||
* #3047: spacing before footnote in pdf output is not coherent and allows breaks
|
||||
* #3045: HTML search index creator should ignore "raw" content if now html
|
||||
* #3039: English stemmer returns wrong word if the word is capitalized
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
@@ -242,4 +242,4 @@ class SearchEnglish(SearchLanguage):
|
||||
self.stemmer = Stemmer()
|
||||
|
||||
def stem(self, word):
|
||||
return self.stemmer.stem(word)
|
||||
return self.stemmer.stem(word.lower())
|
||||
|
||||
@@ -15,6 +15,8 @@ findthisstemmedkey
|
||||
|
||||
textinheading
|
||||
|
||||
International
|
||||
|
||||
.. toctree::
|
||||
|
||||
tocitem
|
||||
|
||||
@@ -103,8 +103,10 @@ def test_stemmer_does_not_remove_short_words(app, status, warning):
|
||||
|
||||
@with_app(testroot='search')
|
||||
def test_stemmer(app, status, warning):
|
||||
searchindex = (app.outdir / 'searchindex.js').text()
|
||||
assert 'findthisstemmedkei' in searchindex
|
||||
searchindex = jsload(app.outdir / 'searchindex.js')
|
||||
print(searchindex)
|
||||
assert is_registered_term(searchindex, 'findthisstemmedkei')
|
||||
assert is_registered_term(searchindex, 'intern')
|
||||
|
||||
|
||||
@with_app(testroot='search')
|
||||
|
||||
Reference in New Issue
Block a user