Sanscript supports a handy feature: if the user types ##, transliteration is disabled until the ## block is seen again. Or for another version of this, some transliterators support suspending transliteration when < is seen and enabling it again when > is seen.
vidyut-lipi does not support this behavior, so it does not have parity with Sanscript.js
Proposed solution
Don't modify our core transliteration logic (transliterate_from_alphabet, transliterate_from_abugida) directly. Instead, modify the transliterate function to create a string slice if a toggler/suspender is seen, perhaps like so:
if let Some(i) = chars.position(|c| c == '<') {
let slice = input[..i];
// then, transliterate `slice` and append it to the output.
}
Supporting this behavior will also require updating the transliterate API to support an Options argument that lets the user set various flags. Rather than update transliterate, I suggest creating a new transliterate_with_options function (or method, if updating Lipika as well).
Problem
Sanscript supports a handy feature: if the user types
##
, transliteration is disabled until the##
block is seen again. Or for another version of this, some transliterators support suspending transliteration when<
is seen and enabling it again when>
is seen.vidyut-lipi does not support this behavior, so it does not have parity with Sanscript.js
Proposed solution
Don't modify our core transliteration logic (
transliterate_from_alphabet
,transliterate_from_abugida
) directly. Instead, modify thetransliterate
function to create a string slice if a toggler/suspender is seen, perhaps like so:Supporting this behavior will also require updating the
transliterate
API to support anOptions
argument that lets the user set various flags. Rather than updatetransliterate
, I suggest creating a newtransliterate_with_options
function (or method, if updatingLipika
as well).