mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Revert "Fix #2183 porterstemmer causes make json to fail"
This is a breaking change. So we move the change into master branch.
This reverts commit f1518c5fc4.
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -21,7 +21,6 @@ Bugs fixed
|
||||
* #2071: Fix same footnote in more than two section titles => LaTeX/PDF Bug
|
||||
* #2040: Fix UnicodeDecodeError in sphinx-apidoc when author contains non-ascii characters
|
||||
* #2193: Fix shutil.SameFileError if source directory and destination directory are same
|
||||
* #2183: Fix porterstemmer causes `make json` to fail
|
||||
|
||||
|
||||
Release 1.3.3 (released Dec 2, 2015)
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
|
||||
from sphinx.search import SearchLanguage
|
||||
|
||||
try:
|
||||
# http://bitbucket.org/methane/porterstemmer/
|
||||
from porterstemmer import Stemmer as CStemmer
|
||||
CSTEMMER = True
|
||||
PYSTEMMER = False
|
||||
except ImportError:
|
||||
CSTEMMER = False
|
||||
try:
|
||||
from Stemmer import Stemmer as PyStemmer
|
||||
PYSTEMMER = True
|
||||
@@ -224,7 +231,11 @@ class SearchEnglish(SearchLanguage):
|
||||
stopwords = english_stopwords
|
||||
|
||||
def init(self, options):
|
||||
if PYSTEMMER:
|
||||
if CSTEMMER:
|
||||
class Stemmer(CStemmer):
|
||||
def stem(self, word):
|
||||
return self(word.lower())
|
||||
elif PYSTEMMER:
|
||||
class Stemmer(object):
|
||||
def __init__(self):
|
||||
self.stemmer = PyStemmer('porter')
|
||||
|
||||
Reference in New Issue
Block a user