Move or change Latin CorpusReader module
See original GitHub issueWhile doing some work with Docker, to package the web API, I came across an error that must be uncommon for devs but very common to new users.
Stems from: https://github.com/cltk/cltk/blob/master/cltk/corpus/latin/__init__.py.
On a system without any ~/cltk_data
dir, anytime when CorpusImporter()
is called, the following message is printed to screen: Corpus not found. Please check that the Latin Library is installed in CLTK_DATA.
. Of course, not everybody wants the Latin Library corpus.
Thus, I propose making the module explicit, not hidden, import. At least until we have a strong idea about how the CorpusReader will work for other languages.
What do you think @diyclassics?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
nltk.corpus.reader package — NLTK 3.0 documentation
A mixin class used to aid in the implementation of corpus readers for categorized corpora. This class defines the method categories(), which returns...
Read more >nltk.corpus.reader package
Each corpus module defines one or more “corpus reader functions”, which can be used to read documents from that corpus. These functions take...
Read more >Corpus Readers — Classical Language Toolkit documentation
Modify the cltk.corpus.readers module, updating SUPPORTED_CORPORA , adding your language and the specific corpus name. In the get_corpus_reader method implement ...
Read more >CLTK Corpus Reader (Latin NLP with Python 03) - YouTube
In this video, I show you how to download and install corpora via the corpus importer and I show you how to open...
Read more >ELAN - Linguistic Annotator
If you changed the media file synchronization of a file that already is annotated, you might want to move the annotation units all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think you could move its contents to a class within
cltk/corpus/latin/latinlibrary.py
.Then users would import with, e.g.:
from cltk.corpus.latin import latinlibrary
and use withlatinlibrary.LatinLibraryReader()
.Just sharing an idea. A guiding principle I go by is “explicit is better than implicit”.
This has been refactored https://github.com/cltk/cltk/pull/846 you can do: from cltk.corpus.readers import get_corpus_reader latinlibrary = get_corpus_reader(language=‘latin’, corpus_name=‘latin_text_latin_library’)