# 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)
# 
# SCHEMES = {
#     'Bengali': BENGALI,
#     'Devanagari': DEVANAGARI,
#     'Gujarati': GUJARATI,
#     'Gurmukhi': GURMUKHI,
#     'Kannada': KANNADA,
#     'Malayalam': MALAYALAM,
#     'Oriya': ORIYA,
#     'Tamil': TAMIL,
#     'Telugu': TELUGU,
#     'HK': HK,
#     'IAST': IAST,
#     'ITRANS': ITRANS,
#     'Kolkata': KOLKATA,
#     'SLP1': SLP1,
#     'Velthuis': VELTHUIS,
#     'WX': WX
# }


from sanskrit_parser.base.sanskrit_base import SanskritImmutableString, SCHEMES
    import sys


def _inriaTagsToDb(tag):
    # ('tag','ourtag)
    itag = tag[0]
    otag = tag[1]
    if itag.find('-') != -1:
        iset = set(itag.split('-'))
    else:
        iset = set([itag])
    return (iset, SanskritImmutableString(otag, encoding=SCHEMES['Devanagari']))


inriatagdb = list(map(_inriaTagsToDb, inriatags))


def inriaMapTag(tag):
    ''' Map an INRIA tag to our format

    Params:
       tag(tuple) : (<stem>,set([inria tags]))
    Returns
       tuple : (<stem>,set([our tags]))
    '''
    stem = tag[0]
    tset = tag[1]
    olist = []
    for s in inriatagdb:
        if s[0] <= tset:
            olist.append(s[1])

# 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)
# 
# SCHEMES = {
#     'Bengali': BENGALI,
#     'Devanagari': DEVANAGARI,
#     'Gujarati': GUJARATI,
#     'Gurmukhi': GURMUKHI,
#     'Kannada': KANNADA,
#     'Malayalam': MALAYALAM,
#     'Oriya': ORIYA,
#     'Tamil': TAMIL,
#     'Telugu': TELUGU,
#     'HK': HK,
#     'IAST': IAST,
#     'ITRANS': ITRANS,
#     'Kolkata': KOLKATA,
#     'SLP1': SLP1,
#     'Velthuis': VELTHUIS,
#     'WX': WX
# }


# Path: sanskrit_parser/util/inriatagmapper.py
from sanskrit_parser.base.sanskrit_base import SanskritImmutableString, SCHEMES
    import sys



def _inriaTagsToDb(tag):
    # ('tag','ourtag)
    itag = tag[0]
    otag = tag[1]
    if itag.find('-') != -1:
        iset = set(itag.split('-'))
    else:
        iset = set([itag])
    return (iset, SanskritImmutableString(otag, encoding=SCHEMES['Devanagari']))


inriatagdb = list(map(_inriaTagsToDb, inriatags))


def inriaMapTag(tag):
    ''' Map an INRIA tag to our format

    Params:
       tag(tuple) : (<stem>,set([inria tags]))
    Returns
       tuple : (<stem>,set([our tags]))
    '''
    stem = tag[0]
    tset = tag[1]
    olist = []
    for s in inriatagdb:
        if s[0] <= tset:
            olist.append(s[1])

    return (SanskritImmutableString(stem, SCHEMES['SLP1']), set(olist))