Comments (5)
In this case, the function is brittle because it assumes we have checked for an accent rather than returning "none" or the like in the following case.
display_accentuation(get_accentuation('δ’'))
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/greek_accentuation/accentuation.py", line 68, in display_accentuation
return accentuation.name.lower()
AttributeError: 'NoneType' object has no attribute 'name'
from greek-accentuation.
I think the underlying issue here is that get_accentuation
expects a normalized accentuation. It's not intended to handle graves or words with an additional oxytone because of a following enclitic.
(greek-normalisation
handles that normalization step)
from greek-accentuation.
from greek-accentuation.
It's only ἣ in running text, though. The standalone form is ἥ and the assumption the code is making (which might be debatable but it's the assumption I made for my own work) is if you're querying for the accentuation type (e.g. is it perispomenon or paroxytone or whatever) that that's a property of the isolated accented word, not the string in running text.
In my own corpus work, I always use greek-normalisation
and generate an isolated form for tokens. I talk about it a bit in this blog post: https://jktauber.com/2018/07/23/normalisation-column-morphgnt/
from greek-accentuation.
If you don't want the full-on greek-normalisation
you can also just copy paste the code from https://github.com/jtauber/greek-normalisation/blob/master/greek_normalisation/utils.py which has things like grave_to_acute
and strip_last_accent_if_two
as well as its own strip_accents
too.
from greek-accentuation.
Related Issues (15)
- add_necessary_breathing can get UnboundLocalError
- Grave accent HOT 1
- a "strip accent" function? HOT 1
- Grave accent (again) HOT 1
- consider containing package HOT 7
- Accenting Ἰάννης HOT 3
- dealing with an omega that is short for the purposes of accentuation
- accenting ὕβρεως rather than *ὑβρέως
- document the core API HOT 2
- sillabify lines for poetry HOT 7
- Syllabify rules HOT 1
- Incorrect syllabification of αυῖ (e.g. μεμαυῖα)
- How do I get rid of extra accents from enclitics: e.g., Μαῖράν HOT 3
- Test suite HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from greek-accentuation.