Document new general use flags
authorKris Kowal <kris.kowal@cixar.com>
Wed, 12 Sep 2012 18:11:01 +0000 (11:11 -0700)
committerKris Kowal <kris.kowal@cixar.com>
Wed, 12 Sep 2012 18:11:01 +0000 (11:11 -0700)
README.md
general-use.js

index 3c9407b..215964d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ options can also be applied.
     data-mode="general-use no-ach-laut reverse-curls"
     data-mode="classical reverse-curls"
     data-mode="beleriand"
+    data-mode="general-use black-speech"
 
 If the element has a `data-encoded` property, the value is expected to
 be a description of the tengwar and tehtar to display like
@@ -66,6 +67,11 @@ Using the Modules
             breaks.
         -   `plain` whether to exclude all HTML from the output,
             making it suitable for plain text..
+        -   `blackSpeech`: In the Black Speech of the ring inscription,
+            the "o" and "u" curls are reversed, medial "r" is ore before
+            consonants in addition to final "r", and "sh" and "gh" used
+            extended tengwar.  This implies `reverseCurls` and
+            `medialOre`.
         -   `doubleNasalsWithTildeBelow`: Many tengwa can be doubled in
             General Use mode by placing a tilde above the tengwa, and
             many tengwa can be prefixed with the sound of the
@@ -80,6 +86,9 @@ Using the Modules
             -   `false`: by default, the "o" tehta curls forward, and
                 "u" backward.
             -   `true`: "o" curls backward, "u" forward.
+        -   `swapDotSlash`
+            -   `false`: by default, "i" is a dot and "e" is a slash.
+            -   `true`: "i" is a slash, "e" is a dot.
         -   `noAchLaut`
             -   `false`: by default, "ch" is transcribed as ach-laut,
                 the "ch" as in "Bach".  "cc" is transcribed as "ch" as
index 4b58cef..6372ddb 100644 (file)
@@ -28,6 +28,9 @@ function makeOptions(options) {
         reverseCurls: options.reverseCurls || options.blackSpeech,
         // false: by default, o is forward, u is backward
         // true: o is backward, u is forward
+        swapDotSlash: options.swapDotSlash,
+        // false: by default, e is a slash, i is a dot
+        // true: e is a dot, i is a slash
         medialOre: options.medialOre || options.blackSpeech,
         // false: by default, ore only appears in final position
         // true: ore also appears before consonants, as in the ring inscription
@@ -133,6 +136,9 @@ function parseColumn(callback, options, previous) {
                         if (options.reverseCurls) {
                             tehta = reverseCurls[tehta] || tehta;
                         }
+                        if (options.swapDotSlash) {
+                            tehta = swapDotSlash[tehta] || tehta;
+                        }
                         column.addAbove(tehta);
                         return parseTengwaAnnotations(function (column) {
                             return callback([column]);
@@ -196,6 +202,7 @@ var tengwaTehtar = "aeiouóú";
 var vowels = "aeiouáéíóú";
 var shorterVowels = {"á": "a", "é": "e", "í": "i", "ó": "o", "ú": "u"};
 var reverseCurls = {"o": "u", "u": "o", "ó": "ú", "ú": "ó"};
+var swapDotSlash = {"i": "e", "e": "i"};
 
 function canAddAboveTengwa(tehta) {
     return tengwaTehtar.indexOf(tehta) !== -1;