I am working on a tool to do automatic Spanish verb conjugation. In one tense, the rule is to accent the last vowel.
While I can create a map to get the accented version of a letter, I was wondering if there is a clean, pythonic way to manipulate characters to add diacritical marks (I think I have the right term).
For example:
fue -> fué
presta -> prestá
etc.
Windows Computer or Laptop Enable the numeric keypad by turning on the Num lock key. Hold the Alt key then type 164 on the numeric keypad to create a lowercase ñ. For the uppercase Ñ, hold the Alt key then type 165.
Unlike iOS, Android doesn't come preloaded with support for accented characters. However, there's an app for that—several of them, actually. Simply head to your app store and search for a “smart keyboard.” Choose whichever you like best, install it, then type accents, acute or otherwise, whenever you need.
It depends on the encoding that you want to use. If you're using Latin encoding, then a character map is the way to go. If you're using Unicode, it could be nicer to use combining characters; the unicode character for an acute accent is '\u0301', and it comes after the letter you're applying it to:
In [40]: 'fue'+ u'\u0301'
Out[40]: 'fué'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With