dariusk / dariusk/corpora

Dashes in category/file names make retrieval in pycorpora difficult

Open
#236 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

At the moment there are categories in [corpora](https://github.com/dariusk/corpora) like "film-tv" and files like "materials/abridged-body-fluids". When using tools like [pycorpora](https://github.com/aparrish/pycorpora), these names cause problems because they prevent the user from retrieving files using standard syntax, such as `pycorpora.category_name.file_name['key']`, because `-` is not a legal character in Python identifiers.
In [pycorpora](https://github.com/aparrish/pycorpora) I can work around this as follows:
`getattr(pycorpora, 'film-tv').tv_shows[''tv_shows']`
`pycorpora.materials.get_file('abridged-body-fluids')['abridged body fluids']`
However, this isn't ideal and probably either pycorpora and similar libraries should perform these workarounds internally (translating `-` to `_`, for instance), or [corpora](https://github.com/dariusk/corpora) should restrict category and file names to valid JS/Python/C (for example) identifiers.
I've opened a similar issue in [pycorpora](https://github.com/aparrish/pycorpora): https://github.com/aparrish/pycorpora/issues/11.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the category name "film-tv" and the file path "materials/abridged-body-fluids", then read the linked pycorpora issue #11 to understand the interoperability problem. The issue does not identify files, tests, or a decided approach; done would require an agreed naming convention or a clearly assigned workaround for affected consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.