The ascii-flatten package

[ Tags: library, mit, program, text ] [ Propose Tags ]

Flattens European non-ASCII characaters into ASCII


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.1.0
Dependencies ascii-flatten, base (>=4.6 && <4.9), text [details]
License MIT
Copyright (c) 2016 Daniel Choi
Author Daniel Choi
Maintainer dhchoi@gmail.com
Category Text
Home page https://github.com/danchoi/ascii-flatten
Uploaded Wed May 11 17:06:06 UTC 2016 by DanielChoi
Distributions NixOS:0.1.1.0
Executables ascii-flatten
Downloads 139 total (2 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-10-26 [all 3 reports]
Hackage Matrix CI

Modules

  • Data
    • Char
      • Data.Char.AsciiFlatten

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for ascii-flatten-0.1.1.0

[back to package description]

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.