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.

Betacode converter should handle lowercase input

See original GitHub issue

The betacode replacer does not currently work with lowercase character, e.g. like those used in older versions of the Perseus xml files (www.perseus.tufts.edu/hopper/dltext?doc=Perseus%3Atext%3A1999.01.0125): """ta/ te a)/lla kai\ di' h(\n ai)ti/hn e)pole/mhsan a)llh/loisi."""

A solution could be to use upper() on strings that are passed in, though there needs to be some caution in handling special characters like the ‘\n’ in ‘h(\n’ in the example above.

Code: https://github.com/cltk/cltk/blob/master/cltk/corpus/greek/beta_to_unicode.py

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
diyclassicscommented, Jun 19, 2018

Haven’t had a chance to test all the combinations—but this sounds reasonable. I only brought special characters up in the initial post to flag potential pitfalls with the use of slashes in betacode.

0reactions
Sedictiouscommented, Jun 19, 2018

@diyclassics I’m sorry, I’m not sure I quite follow. From the documentation

This method returns a copy of the string in which all case-based characters have been uppercased.

So following this definition, \n shouldn’t be converted and is indeed treated differently. Following the same logic '\w'.upper() gives '\\W' so Replacer().beta_code(r"""pe\wn""") correctly gives 'πὲων'.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beta Code to/from UTF-8 Unicode Conversion Package
This program can handle the ordinary ASCII Beta Code encoding of polytonic Greek ... The input ASCII Beta Code letters are lowercase in...
Read more >
How to let Python recognize both lower and uppercase input?
Convert the word entirely to lowercase (or uppercase) first: word = input("Please Enter a word:").lower() # Or `.upper()`.
Read more >
matgrioni/betacode: A small python package to ... - GitHub
A small python package to flexibly convert from betacode to unicode and back. - GitHub - matgrioni/betacode: A ... Input can be in...
Read more >
Requisitioner - How to force input as lowercase?
I am looking to change the input of the Requisioner filed by users in ME51N when creating a Purchase Req. so that it...
Read more >
Lowercase Function - CS First - Google
Use the lowercase function to convert any uppercase letters to lowercase letters. ... Program the sprite to greet the user with the name...
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