Dashes in category/file names make retrieval difficult
See original GitHub issueAt the moment there are categories in corpora like “film-tv” and files like “materials/abridged-body-fluids” which cannot be accessed using the standard syntax of pycorpora.category_name.file_name['key']
, because -
is not a legal character in Python identifiers.
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 should perform these workarounds internally (translating -
to _
, for instance), or corpora should restrict category and file names to valid JS/Python/C (for example) identifiers.
I’ve opened a similar issue in corpora: https://github.com/dariusk/corpora/issues/236.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Dashes in category/file names make retrieval in pycorpora ...
When using tools like pycorpora, these names cause problems because they prevent the user from retrieving files using standard syntax, such as ...
Read more >Descriptiveness and proper name retrieval - PubMed
Cohen (1990) hypothesised that the retrieval of proper names is particularly difficult because proper names convey little information about their bearers' ...
Read more >Hyphens (dashes) in Domain Name: Good or Bad? - Wiserbrand
Disadvantages of hyphenated domain names; Sub-pages and categorization; Conclusion. When you create an entirely new website, one of the first ...
Read more >Memory (Encoding, Storage, Retrieval) - Noba Project
Psychologists often study recall by having participants study a list of pictures or words. Encoding in these situations is fairly straightforward. However, “ ......
Read more >Using Dashes Correctly - University of Houston-Victoria
Create an em dash by typing two hyphens without spaces between the ... in the sentence to the list itself, making the list...
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 merged a fix for this in #9 a few weeks ago, actually. It just hasn’t made it to PyPI yet. For now, you can take advantage of the fix by installing directly from github. I’ll leave this open until I have a chance to make a new release and close when the fix is generally available.
Ok!