question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move or change Latin CorpusReader module

See original GitHub issue

While 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:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kylepjohnsoncommented, Oct 29, 2016

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 with latinlibrary.LatinLibraryReader().

Just sharing an idea. A guiding principle I go by is “explicit is better than implicit”.

0reactions
todd-cookcommented, Jan 9, 2019

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’)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found