# 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
            i = i-1
        else:
            return False
    return False


def awkupvaNnum(s):
    # FIXME handle AN
    return isInPratyahara("aw", s) or isSavarna("ku", s) or isSavarna("pu", s) \
        or (s == "M")


def Ratva(s):
    return s.replace("n", "R", 1)


def iyuvaN(s):
    if isSavarna("i", s):
        return "iy"
    elif isSavarna("u", s):
        return ("uv")
    else:
        return s


def anekAc_asaMyogapUrva(s):
    if ((len(s) > 2) and (isInPratyahara("hal", s[-2]) and isInPratyahara("hal", s[-3]))):
        return False
    ac = 0
    for sc in s:

# 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

            i = i-1
        else:
            return False
    return False


def awkupvaNnum(s):
    # FIXME handle AN
    return isInPratyahara("aw", s) or isSavarna("ku", s) or isSavarna("pu", s) \
        or (s == "M")


def Ratva(s):
    return s.replace("n", "R", 1)


def iyuvaN(s):
    if isSavarna("i", s):
        return "iy"
    elif isSavarna("u", s):
        return ("uv")
    else:
        return s


def anekAc_asaMyogapUrva(s):
    if ((len(s) > 2) and (isInPratyahara("hal", s[-2]) and isInPratyahara("hal", s[-3]))):
        return False
    ac = 0
    for sc in s:

        if isInPratyahara("ac", sc):