From: Felix Yan <felixonmars@archlinux.org>
Date: Tue, 29 Nov 2022 06:43:08 +0200
Subject: Fix doctests

The renamed quickstart docs were not updated accordingly in runtests.py,
and quickstart_python2.txt should be in the docs subdir.

Origin: upstream, https://github.com/snowballstem/pystemmer/commit/b2826f19fe8ba65238b5f3b4cee7096a698f048e
---
 docs/quickstart_python2.txt | 59 +++++++++++++++++++++++++++++++++++++++++++++
 quickstart_python2.txt      | 59 ---------------------------------------------
 runtests.py                 |  4 +--
 3 files changed, 61 insertions(+), 61 deletions(-)
 create mode 100644 docs/quickstart_python2.txt
 delete mode 100644 quickstart_python2.txt

diff --git a/docs/quickstart_python2.txt b/docs/quickstart_python2.txt
new file mode 100644
index 0000000..c94f60a
--- /dev/null
+++ b/docs/quickstart_python2.txt
@@ -0,0 +1,59 @@
+Quickstart
+==========
+
+This is a very brief introduction to the use of PyStemmer.
+
+First, import the library:
+
+>>> import Stemmer
+
+Just for show, we'll display a list of the available stemming algorithms:
+
+>>> print(Stemmer.algorithms())
+[u'arabic', u'armenian', u'basque', u'catalan', u'danish', u'dutch', u'english', u'finnish', u'french', u'german', u'greek', u'hindi', u'hungarian', u'indonesian', u'irish', u'italian', u'lithuanian', u'nepali', u'norwegian', u'porter', u'portuguese', u'romanian', u'russian', u'serbian', u'spanish', u'swedish', u'tamil', u'turkish', u'yiddish']
+
+Now, we'll get an instance of the english stemming algorithm:
+
+>>> stemmer = Stemmer.Stemmer('english')
+
+Stem a single word:
+
+>>> print(stemmer.stemWord('cycling'))
+cycl
+
+Stem a list of words:
+
+>>> print(stemmer.stemWords(['cycling', 'cyclist']))
+['cycl', 'cyclist']
+
+Strings which are supplied are assumed to be UTF-8 encoded.
+We can use unicode input, too:
+
+>>> print(stemmer.stemWords(['cycling', u'cyclist']))
+['cycl', u'cyclist']
+
+Each instance of the stemming algorithms uses a cache to speed up processing of
+common words.  By default, the cache holds 10000 words, but this may be
+modified.  The cache may be disabled entirely by setting the cache size to 0:
+
+>>> print(stemmer.maxCacheSize)
+10000
+
+>>> stemmer.maxCacheSize = 1000
+
+>>> print(stemmer.maxCacheSize)
+1000
+
+Generally you should create a stemmer object and reuse it rather than creating
+a fresh object for each word stemmed, since there's some cost to creating and
+destroying the object.  Reusing the object is also needed to benefit from the
+caching.
+
+The stemmer code is re-entrant, but not thread-safe if the same stemmer object
+is used concurrently in different threads.
+
+If you want to perform stemming concurrently in different threads, we suggest
+creating a new stemmer object for each thread.  The alternative is to share
+stemmer objects between threads and protect access using a mutex or similar
+(e.g. `threading.Lock` in Python) but that's liable to slow your program down
+as threads can end up waiting for the lock.
diff --git a/quickstart_python2.txt b/quickstart_python2.txt
deleted file mode 100644
index c94f60a..0000000
--- a/quickstart_python2.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-Quickstart
-==========
-
-This is a very brief introduction to the use of PyStemmer.
-
-First, import the library:
-
->>> import Stemmer
-
-Just for show, we'll display a list of the available stemming algorithms:
-
->>> print(Stemmer.algorithms())
-[u'arabic', u'armenian', u'basque', u'catalan', u'danish', u'dutch', u'english', u'finnish', u'french', u'german', u'greek', u'hindi', u'hungarian', u'indonesian', u'irish', u'italian', u'lithuanian', u'nepali', u'norwegian', u'porter', u'portuguese', u'romanian', u'russian', u'serbian', u'spanish', u'swedish', u'tamil', u'turkish', u'yiddish']
-
-Now, we'll get an instance of the english stemming algorithm:
-
->>> stemmer = Stemmer.Stemmer('english')
-
-Stem a single word:
-
->>> print(stemmer.stemWord('cycling'))
-cycl
-
-Stem a list of words:
-
->>> print(stemmer.stemWords(['cycling', 'cyclist']))
-['cycl', 'cyclist']
-
-Strings which are supplied are assumed to be UTF-8 encoded.
-We can use unicode input, too:
-
->>> print(stemmer.stemWords(['cycling', u'cyclist']))
-['cycl', u'cyclist']
-
-Each instance of the stemming algorithms uses a cache to speed up processing of
-common words.  By default, the cache holds 10000 words, but this may be
-modified.  The cache may be disabled entirely by setting the cache size to 0:
-
->>> print(stemmer.maxCacheSize)
-10000
-
->>> stemmer.maxCacheSize = 1000
-
->>> print(stemmer.maxCacheSize)
-1000
-
-Generally you should create a stemmer object and reuse it rather than creating
-a fresh object for each word stemmed, since there's some cost to creating and
-destroying the object.  Reusing the object is also needed to benefit from the
-caching.
-
-The stemmer code is re-entrant, but not thread-safe if the same stemmer object
-is used concurrently in different threads.
-
-If you want to perform stemming concurrently in different threads, we suggest
-creating a new stemmer object for each thread.  The alternative is to share
-stemmer objects between threads and protect access using a mutex or similar
-(e.g. `threading.Lock` in Python) but that's liable to slow your program down
-as threads can end up waiting for the lock.
diff --git a/runtests.py b/runtests.py
index 6b36cf3..c43dfcd 100755
--- a/runtests.py
+++ b/runtests.py
@@ -6,9 +6,9 @@ import sys
 py3k = sys.version_info >= (3, 0)
 
 if py3k:
-    num_failures, num_tests = doctest.testfile('docs/quickstart_python3.txt')
-else:
     num_failures, num_tests = doctest.testfile('docs/quickstart.txt')
+else:
+    num_failures, num_tests = doctest.testfile('docs/quickstart_python2.txt')
 
 if num_failures > 0:
     print("%d failures out of %d tests" % (num_failures, num_tests))
