# Path: sanskrit_parser/base/sanskrit_base.py
# class SanskritImmutableString(SanskritString):
#     """ Immutable version of SanskritString
#     """
#     def __init__(self, thing=None, encoding=None, unicode_encoding='utf-8'):
#         super().__init__(thing, encoding, unicode_encoding)
# 
#     def __hash__(self):
#         return hash(str(self))
# 
#     def __eq__(self, other):
#         return str(self) == str(other)
# 
#     def __ne__(self, other):
#         return str(self) != str(other)
# 
# SLP1 = sanscript.SLP1
# 
# Path: sanskrit_parser/generator/operations.py
# def adesha(a, f, t):
#     p = str(f).find(str(a))
#     if p != -1:
#         return str(t)[p]
#     else:
#         return a
# 
# Path: sanskrit_parser/generator/maheshvara.py
# def isInPratyahara(p, s):
# def isSavarna(p, s):


from sanskrit_parser.base.sanskrit_base import SanskritImmutableString, SLP1
from .operations import adesha
from .maheshvara import ms, isInPratyahara, isSavarna
from sanskrit_parser.generator.pratipadika import *  # noqa: F403
        }
    if str(s) in d:
        return d[s]
    else:
        return s


# Fixme - anunasika ZSs yrl
def anunasika(s: str):
    if s in "yrlvSZs":
        return s+"~"
    else:
        return adesha(s, "kKgGcCjJwWqQtTdDpPbB", "NNNNYYYYRRRRnnnnmmmm")


# vyavAya check for razAByAM noRaH samAnapade
def rz_vyavaya_l(s: str):
    i = len(s)-1
    while(i >= 0):
        # ऋवर्णात् नस्य णत्वं वाच्यम्
        if ((s[i] == "r") or (s[i] == "z") or (s[i] == "f")):
            return True
        elif awkupvaNnum(s[i]):
            i = i-1
        else:
            return False
    return False


def rz_vyavaya_r(s: str):

# Path: sanskrit_parser/base/sanskrit_base.py
# class SanskritImmutableString(SanskritString):
#     """ Immutable version of SanskritString
#     """
#     def __init__(self, thing=None, encoding=None, unicode_encoding='utf-8'):
#         super().__init__(thing, encoding, unicode_encoding)
# 
#     def __hash__(self):
#         return hash(str(self))
# 
#     def __eq__(self, other):
#         return str(self) == str(other)
# 
#     def __ne__(self, other):
#         return str(self) != str(other)
# 
# SLP1 = sanscript.SLP1
# 
# Path: sanskrit_parser/generator/operations.py
# def adesha(a, f, t):
#     p = str(f).find(str(a))
#     if p != -1:
#         return str(t)[p]
#     else:
#         return a
# 
# Path: sanskrit_parser/generator/maheshvara.py
# def isInPratyahara(p, s):
# def isSavarna(p, s):


# Path: sanskrit_parser/generator/paribhasha.py
from sanskrit_parser.base.sanskrit_base import SanskritImmutableString, SLP1
from .operations import adesha
from .maheshvara import ms, isInPratyahara, isSavarna
from sanskrit_parser.generator.pratipadika import *  # noqa: F403

        }
    if str(s) in d:
        return d[s]
    else:
        return s


# Fixme - anunasika ZSs yrl
def anunasika(s: str):
    if s in "yrlvSZs":
        return s+"~"
    else:
        return adesha(s, "kKgGcCjJwWqQtTdDpPbB", "NNNNYYYYRRRRnnnnmmmm")


# vyavAya check for razAByAM noRaH samAnapade
def rz_vyavaya_l(s: str):
    i = len(s)-1
    while(i >= 0):
        # ऋवर्णात् नस्य णत्वं वाच्यम्
        if ((s[i] == "r") or (s[i] == "z") or (s[i] == "f")):
            return True
        elif awkupvaNnum(s[i]):
            i = i-1
        else:
            return False
    return False


def rz_vyavaya_r(s: str):

    i = 0