ascii-flatten

Flattens European non-ASCII characaters into ASCII https://github.com/danchoi/ascii-flatten

Latest on Hackage:0.1.1.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

MIT licensed by Daniel Choi
Maintained by dhchoi@gmail.com

ascii-flatten

This simple library provides a function to flatten non-ASCII European characters into nearest US-ASCII equivalent.

Hackage package: http://hackage.haskell.org/package/ascii-flatten-0.1.0.0

See source for Data.Char.AsciiFlatten for the character conversions.

The character translation table is derived from this URL: http://yob.id.au/2008/05/08/thinking-sphinx-and-unicode.html

Usage

:m + Data.Char.AsciiFlatten
ghci> map asciiFlatten "café"
"cafe"
ghci> map asciiFlatten "Übermensch"
"Ubermensch"

When performance matters, use

Data.Text.map :: (Char -> Char) -> Text -> Text

Command line usage

The package also installs a simple command line tool named ascii-flatten for use from the command line and in shell scripts:

$ echo café | ascii-flatten
cafe

Code generation

The code for this package is generated using the build.sh script in the project directory.

Depends on:
Used by 1 package:
comments powered byDisqus