Last active
September 21, 2018 15:42
-
-
Save loretoparisi/2abb25c1db934bf7b77c6cc62cd857d7 to your computer and use it in GitHub Desktop.
Invert Indic to Roman
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 bash | |
# ^^^^- not compatible with /bin/sh | |
IN=$1 | |
OUT=$2 | |
paste <(<$IN awk '{print $2}') \ | |
<(<$IN sed -E 's/^[^[:space:]]*[[:space:]]//' \ | |
| indictrans -s asm -t eng --ml --build-lookup) \ | |
> $OUT |
The code in your gist has awk '{print $2}'
, but it needs to be (and was, in my original answer) awk '{print $1}'
.
So that explains the first column. The rest is coming from indictrans
-- that's not an easy piece of software to build (its setup.py
is missing a bunch of dependencies, and it also is requiring a libAccelerate that isn't included or automatically downloaded), so I'm not in a position to help you with its issues.
BTW, all-caps names are used for variables meaningful to the shell or other POSIX-defined tools, whereas lowercase names are guaranteed not to conflict when used by applications; see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage:
Example input data
Expected Output data
Actual output data:
Please see this SF question for more info about this task.