-.TH decoratedstr "May 27, 2009" "" "User Commands"
+.TH decoratedstr 1 "May 27, 2009" "" "User Commands"
.SH NAME
-decoratedstr \- decorated characters tools
+decoratedstr \- decorated characters utility
.SH SYNOPSIS
-.B decoratedstr [\-h|\-\-help] [\-\-charset] [\-r|\-\-regexp]
+.B decoratedstr [\-h|\-\-help] [\-\-charset=
+.I charset
+.B ] [\-r|\-\-regexp] [\-i]
.I string
.SH DESCRIPTION
.PP
-Remove decorations - such as accents and rings - from characters, expand
+Removes decorations - such as accents and rings - from characters, expands
ligatures.
Optionnaly prints a matching regular expression.
+.TP
+.B "\-h, \-\-help"
+Display usage summary.
+.TP
+.B "\-\-charset=charset"
+Sets charset. Default is utf-8.
+.TP
+.B "\-r, \-\-regexp"
+Output a regexp.
+.TP
+.B "\-i"
+Make the regexp case insensitive.
.SH EXAMPLE
.BI "decoratedstr \(OEuf à la poëlle"
.PP
Oeuf a la poelle
.PP
-.BI "decoratedstr \-r oeuf"
+.BI "decoratedstr \-r Oeuf"
.PP
-(\(oe|\(OE|[oòóôöøōŏőOÒÓÔÖØŌŎŐ][eèéêëēĕėęěEÈÉÊËĒĔĖĘĚ])[uùúûüũūŭůűųUÙÚÛÜŨŪŬŮŰŲ][fF]
+(\(OE|[OÒÓÔÖØŌŎŐ][eèéêëēĕėęě])[uùúûüũūŭůűų]f
.SH NOTES
.PP
-No note available.
+That version uses python
+.B print
+function that will disapear in python 3.
.SH BUGS
-Python doesn't detect the LANG charset in the environement. You will need to use \-\-charset option
-if you don't use UTF\-8.
+Python doesn't detect the active charset from the environement variables. You
+will need to use \-\-charset option if you don't use UTF\-8.
.SH "AUTHOR"
Jean-Michel Vourg\(`ere
.mso www.tmac
parser = OptionParser(usage='%prog [options] string')
parser.add_option('--charset', help="set charset. default=%default", action='store', dest='charset', default='utf-8')
parser.add_option('-r', '--regexp', help="generate regular expression.", action='store_true', dest='regexp')
+ parser.add_option('-i', help="used with -r, make regexp case insensitive.", action='store_false', dest='casesensitive', default=True)
(options, args) = parser.parse_args()
if not args:
#print "undecorated:", remove_decoration(input) # Oeuf
#print "regex:", decorated_match(input) # (œ|Œ|[oòóôöøōŏőOÒÓÔÖØŌŎŐ][eèéêëēĕėęěEÈÉÊËĒĔĖĘĚ])[uùúûüũūŭůűųUÙÚÛÜŨŪŬŮŰŲ][fF]
if options.regexp:
- print decorated_match(input).encode(options.charset)
+ print decorated_match(input, options.casesensitive).encode(options.charset)
else:
print remove_decoration(input).encode(options.charset)