Repository: piskvorky/gensim

Issue:
Fix documentation link to mycorpus.txt download
<!--
**IMPORTANT**:

- Use the [Gensim mailing list](https://groups.google.com/forum/#!forum/gensim) to ask general or usage questions. Github issues are only for bug reports.
- Check [Recipes&FAQ](https://github.com/RaRe-Technologies/gensim/wiki/Recipes-&-FAQ) first for common answers.

Github bug reports that do not include relevant information and context will be closed without an answer. Thanks!
-->

#### Problem description

Trying to reproduce Corpora and Vector Space tutorial given in the documentation, but the link to download txt file is not working. The link given in the tutorial [here](https://radimrehurek.com/gensim/auto_examples/core/run_corpora_and_vector_spaces.html#corpus-streaming-one-document-at-a-time) is giving 404 error.

#### Steps/code/corpus to reproduce

Just visit this [link](https://radimrehurek.com/gensim/mycorpus.txt) which is used in the code given in the documentation, it is not working.



Discussion:
You're right, the link should be https://radimrehurek.com/mycorpus.txt.

@rohit901 Can you open a PR with a fix? Thanks.

Resolving patch:
diff --git a/docs/src/auto_examples/core/run_corpora_and_vector_spaces.py b/docs/src/auto_examples/core/run_corpora_and_vector_spaces.py
--- a/docs/src/auto_examples/core/run_corpora_and_vector_spaces.py
+++ b/docs/src/auto_examples/core/run_corpora_and_vector_spaces.py
@@ -138,7 +138,7 @@
 
 class MyCorpus:
     def __iter__(self):
-        for line in open('https://radimrehurek.com/gensim/mycorpus.txt'):
+        for line in open('https://radimrehurek.com/mycorpus.txt'):
             # assume there's one document per line, tokens separated by whitespace
             yield dictionary.doc2bow(line.lower().split())
 
@@ -154,7 +154,7 @@ def __iter__(self):
 # in RAM at once. You can even create the documents on the fly!
 
 ###############################################################################
-# Download the sample `mycorpus.txt file here <./mycorpus.txt>`_. The assumption that
+# Download the sample `mycorpus.txt file here <https://radimrehurek.com/mycorpus.txt>`_. The assumption that
 # each document occupies one line in a single file is not important; you can mold
 # the `__iter__` function to fit your input format, whatever it is.
 # Walking directories, parsing XML, accessing the network...
@@ -180,7 +180,7 @@ def __iter__(self):
 # Similarly, to construct the dictionary without loading all texts into memory:
 
 # collect statistics about all tokens
-dictionary = corpora.Dictionary(line.lower().split() for line in open('https://radimrehurek.com/gensim/mycorpus.txt'))
+dictionary = corpora.Dictionary(line.lower().split() for line in open('https://radimrehurek.com/mycorpus.txt'))
 # remove stop words and words that appear only once
 stop_ids = [
     dictionary.token2id[stopword]
diff --git a/docs/src/gallery/core/run_corpora_and_vector_spaces.py b/docs/src/gallery/core/run_corpora_and_vector_spaces.py
--- a/docs/src/gallery/core/run_corpora_and_vector_spaces.py
+++ b/docs/src/gallery/core/run_corpora_and_vector_spaces.py
@@ -138,7 +138,7 @@
 
 class MyCorpus:
     def __iter__(self):
-        for line in open('https://radimrehurek.com/gensim/mycorpus.txt'):
+        for line in open('https://radimrehurek.com/mycorpus.txt'):
             # assume there's one document per line, tokens separated by whitespace
             yield dictionary.doc2bow(line.lower().split())
 
@@ -154,7 +154,7 @@ def __iter__(self):
 # in RAM at once. You can even create the documents on the fly!
 
 ###############################################################################
-# Download the sample `mycorpus.txt file here <./mycorpus.txt>`_. The assumption that
+# Download the sample `mycorpus.txt file here <https://radimrehurek.com/mycorpus.txt>`_. The assumption that
 # each document occupies one line in a single file is not important; you can mold
 # the `__iter__` function to fit your input format, whatever it is.
 # Walking directories, parsing XML, accessing the network...
@@ -180,7 +180,7 @@ def __iter__(self):
 # Similarly, to construct the dictionary without loading all texts into memory:
 
 # collect statistics about all tokens
-dictionary = corpora.Dictionary(line.lower().split() for line in open('https://radimrehurek.com/gensim/mycorpus.txt'))
+dictionary = corpora.Dictionary(line.lower().split() for line in open('https://radimrehurek.com/mycorpus.txt'))
 # remove stop words and words that appear only once
 stop_ids = [
     dictionary.token2id[stopword]


Test patch: