Last active
December 15, 2018 04:46
-
-
Save eddieantonio/e28b7e619a48ba781c530ec9042a017e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: UTF-8 -*- | |
""" | |
dull(1) dull(1) | |
NAME | |
dull -- the opposite of pointed | |
SYNOPSIS | |
cat pointed-sro.txt | dull > unpointed-sro.txt | |
DESCRIPTION | |
dull converts Cree text written in Standard Roman Orthography and re- | |
moves the diacritics marking long vowels. In syllabics, writing script | |
with long vowels marked is called "pointed" script. So what's it | |
called when writing is missing the length diacritics? | |
lol except for <ê>. <ê> is always long. | |
LICENSE | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or dis- | |
tribute this software, either in source code form or as a compiled bi- | |
nary, for any purpose, commercial or non-commercial, and by any means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the soft- | |
ware to the public domain. We make this dedication for the benefit of | |
the public at large and to the detriment of our heirs and successors. | |
We intend this dedication to be an overt act of relinquishment in per- | |
petuity of all present and future rights to this software under copy- | |
right law. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MER- | |
CHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | |
NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
DEALINGS IN THE SOFTWARE. | |
For more information, please refer to <http://unlicense.org/> | |
Alberta Language Technology Lab 2018-12-14 dull(1) | |
""" | |
import sys | |
from unicodedata import normalize | |
# Handles circumflexes, macrons, and Arok's Proto-Algonquian *r. | |
remove_diacritics = str.maketrans('eēîīôōâāý', | |
'êêiiooaay') | |
for line in sys.stdin: | |
print(normalize('NFC', line).translate(remove_diacritics), end='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TO INSTALL
Once
dull.py
is downloaded, copy it as/usr/local/bin/dull
:Then make it executable:
Optionally, rehash the executable: