So, since I have been working on so many implementations of the API, it only seemed natural that I give some attention to my favourite language.
This is my first release on Hackage and it is available at http://hackage.haskell.org/package/accentuateus. I appreciate any feedback you guys have so that I can improve both it and any future code I write.
The source code is available on Spearhead’s GitHub.
The API implementation boils down to Accentuate.us’ three calls:
langs– Accepting an optional locale and mandatory version number (0 if unknown), langs will tell you whether or not you are in sync with the API servers’ current version. If not (supplied version != server version), it will supply a new list of (ISO-639, Language Name) pairs. When possible, we will return the language names localized to the supplied locale.
accentuate– This is the magic call in the service: given a language, optional locale (to localize any error messages), and input text, it will use statistics to add diacritics.
feedback– The other part of the Accentuate.us service that we really want to make more use of is feedback. Since we use statistics, the diacritic restorations will not always be correct (especially for the more under-resourced languages we support). By supplying a language name and corrected text, we will add it to our training text so that results will improve by user contributions.
Again, this is my first upload to Hackage and I’m really excited about it. I appreciate any feedback you guys have. The latest source can be found at https://github.com/michaelschade/hs-accentuateus/blob/master/Text/AccentuateUs.hs.