diff --git a/harvard-kyoto.c b/harvard-kyoto.c index 0320bb3..e471737 100644 --- a/harvard-kyoto.c +++ b/harvard-kyoto.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ -/* https://en.wikipedia.org/wiki/Velthuis */ +/* https://en.wikipedia.org/wiki/Harvard-Kyoto */ #include "compat.h" #include "harvard-kyoto.h" @@ -11,33 +11,32 @@ struct encoder_tuple { }; static const struct encoder_tuple table[] = { - {"A", "\u0101"}, - {"I", "\u012b"}, - {"U", "\u016b"}, - {"RR", "\u1e5d"}, - {"R", "\u1e5b"}, - {"LL", "\u1e39"}, - {"L", "\u1e37"}, + {"A", "\u0101"}, + {"I", "\u012b"}, + {"U", "\u016b"}, + {"RR", "\u1e5d"}, + {"R", "\u1e5b"}, + {"lRR", "\u1e39"}, + {"lR", "\u1e37"}, {"aa", "\u0101"}, {"ii", "\u012b"}, {"uu", "\u016b"}, - {".rr", "\u1e5d"}, - {".r", "\u1e5b"}, - {".ll", "\u1e39"}, - {".l", "\u1e37"}, - {"M", "\u1e43"}, - {"H", "\u1e25"}, + {"M", "\u1e43"}, + {"H", "\u1e25"}, - {"G", "\u1e45"}, - {"J", "\u00f1"}, - {"T", "\u1e6d"}, - {"D", "\u1e0d"}, - {"N", "\u1e47"}, - {"S", "\u1e63"}, - {"sh", "\u015b"}, - {"z", "\u015b"} + {"G", "\u1e45"}, + {"J", "\u00f1"}, + {"T", "\u1e6d"}, + {"D", "\u1e0d"}, + {"N", "\u1e47"}, + {"S", "\u1e63"}, + {"z", "\u015b"}, + + /* not defined by the standard */ + {"LL", "\u1e39"}, + {"L", "\u1e37"} }; static const struct encoder_tuple *find_tuple(const char *text) diff --git a/main.c b/main.c index 32f9a89..e3a390e 100644 --- a/main.c +++ b/main.c @@ -54,6 +54,7 @@ static const struct option long_opts[] = { {"encode", no_argument, 0, 'e'}, {"velthuis", no_argument, 0, 'e'}, {"harvard", no_argument, 0, 'k'}, + {"kyoto", no_argument, 0, 'k'}, {"ascii", no_argument, 0, 'a'}, {"devanagari", no_argument, 0, 'd'}, {"czech", no_argument, 0, 'c'}, diff --git a/tests/harvard-kyoto.c b/tests/harvard-kyoto.c index caae9e3..09b42fd 100644 --- a/tests/harvard-kyoto.c +++ b/tests/harvard-kyoto.c @@ -18,9 +18,9 @@ START_TEST(test_harvard_kyoto_encoding) { test_harvard_kyoto("saMskRtam", "saṃskṛtam"); test_harvard_kyoto("yogaH", "yogaḥ"); - test_harvard_kyoto("zaastraM shaastram", "śāstraṃ śāstram"); + test_harvard_kyoto("zaastraM zAstram", "śāstraṃ śāstram"); test_harvard_kyoto("liGga yajJa varNa", "liṅga yajña varṇa"); - test_harvard_kyoto("Aaa Iii Uuu RR R L", "āā īī ūū ṝ ṛ ḷ"); + test_harvard_kyoto("Aaa Iii Uuu RR R L lR lRR", "āā īī ūū ṝ ṛ ḷ ḷ ḹ"); } END_TEST diff --git a/tests/integration.c b/tests/integration.c index 03d161a..65283d9 100644 --- a/tests/integration.c +++ b/tests/integration.c @@ -120,9 +120,10 @@ START_TEST(test_harvard) { test_output("./iast \"RtaM\" -k", "ṛtaṃ\n"); test_output("./iast \"RtaM\" --harvard", "ṛtaṃ\n"); + test_output("./iast \"RtaM\" --kyoto", "ṛtaṃ\n"); /* force Devanagari output */ - test_output("./iast \"agnIH zatruH shatruH\" -kd", "अग्नीः शत्रुः शत्रुः\n"); + test_output("./iast \"agnIH zatruH\" -kd", "अग्नीः शत्रुः\n"); } END_TEST