# 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

def hrasva(s: str):
    return adesha(s, "aAiIuUfFxXeEoO", "aaiiuuffxxiiuu")


def guna(s: str):
    if s in "fF":
        # Uran raparaH
        r = "ar"
    elif s in "xX":
        r = "al"
    else:
        r = adesha(s, "iIuU", "eeoo")
    return r


def vriddhi(s: str):
    if s in "fF":
        # Uran raparaH
        r = "Ar"
    elif s in "xX":
        r = "Al"
    else:
        r = adesha(guna(s), "aeo", "AEO")
    return r


def ikoyan(s: str):
    return adesha(s.lower(),
                  ms.getPratyahara(SanskritImmutableString("ik", SLP1)),

# 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


def hrasva(s: str):
    return adesha(s, "aAiIuUfFxXeEoO", "aaiiuuffxxiiuu")


def guna(s: str):
    if s in "fF":
        # Uran raparaH
        r = "ar"
    elif s in "xX":
        r = "al"
    else:
        r = adesha(s, "iIuU", "eeoo")
    return r


def vriddhi(s: str):
    if s in "fF":
        # Uran raparaH
        r = "Ar"
    elif s in "xX":
        r = "Al"
    else:
        r = adesha(guna(s), "aeo", "AEO")
    return r


def ikoyan(s: str):
    return adesha(s.lower(),
                  ms.getPratyahara(SanskritImmutableString("ik", SLP1)),

                  ms.getPratyahara(SanskritImmutableString("yaR", SLP1),