# Path: libeclectus/util.py
# def cachedproperty(fget):
#     def fget_wrapper(self):
#         try: return fget_wrapper._cached
#         except AttributeError:
#             fget_wrapper._cached = value = fget(self)
#             return value
#     def fdel(self):
#         try: del fget_wrapper._cached
#         except AttributeError: pass
#     return property(fget_wrapper, fdel=fdel, doc=fget.__doc__)
# 
# def getDatabaseConfiguration(databaseUrl=None):
#     configuration = {}
#     if databaseUrl:
#         configuration['sqlalchemy.url'] = databaseUrl
#         if databaseUrl.startswith('sqlite://'):
#             configuration['attach'] = ([getDatabaseUrl()]
#                 + getAttachableDatabases())
#     else:
#         configuration['sqlalchemy.url'] = getDatabaseUrl()
#         configuration['attach'] = getAttachableDatabases()
#     return configuration


import re
from sqlalchemy import select
from sqlalchemy.sql import and_, or_
from cjklib.dbconnector import getDBConnector
from cjklib.characterlookup import CharacterLookup
from cjklib import exception
from libeclectus.util import cachedproperty, getDatabaseConfiguration
            if self.isLanguage('zh') or t not in 'ST'])
        # get radical equivalent char
        if self.isRadicalChar(char):
            try:
                equivChar = self.getRadicalFormEquivalentCharacter(char)
                variants.add(equivChar)
            except exception.UnsupportedError:
                # pass if no equivalent char exists
                pass

        return variants

    def getCharacterSimilars(self, char):
        """Gets a list of similar forms of the given character."""
        return self.getEquivalentCharTable([char],
            includeEquivalentRadicalForms=False,
            includeSimilarCharacters=True)[0]

    #{ radicals and components

    def getEquivalentCharTable(self, componentList,
        includeEquivalentRadicalForms=False, includeSimilarCharacters=False):
        u"""
        Gets a list structure of equivalent chars for the given list of
        characters.

        If option C{includeEquivalentRadicalForms} is set, all equivalent forms
        will be searched for when a Kangxi radical is given.

        If option C{includeSimilarCharacters} is set, characters with similar

# Path: libeclectus/util.py
# def cachedproperty(fget):
#     def fget_wrapper(self):
#         try: return fget_wrapper._cached
#         except AttributeError:
#             fget_wrapper._cached = value = fget(self)
#             return value
#     def fdel(self):
#         try: del fget_wrapper._cached
#         except AttributeError: pass
#     return property(fget_wrapper, fdel=fdel, doc=fget.__doc__)
# 
# def getDatabaseConfiguration(databaseUrl=None):
#     configuration = {}
#     if databaseUrl:
#         configuration['sqlalchemy.url'] = databaseUrl
#         if databaseUrl.startswith('sqlite://'):
#             configuration['attach'] = ([getDatabaseUrl()]
#                 + getAttachableDatabases())
#     else:
#         configuration['sqlalchemy.url'] = getDatabaseUrl()
#         configuration['attach'] = getAttachableDatabases()
#     return configuration


# Path: libeclectus/chardb.py
import re
from sqlalchemy import select
from sqlalchemy.sql import and_, or_
from cjklib.dbconnector import getDBConnector
from cjklib.characterlookup import CharacterLookup
from cjklib import exception
from libeclectus.util import cachedproperty, getDatabaseConfiguration

            if self.isLanguage('zh') or t not in 'ST'])
        # get radical equivalent char
        if self.isRadicalChar(char):
            try:
                equivChar = self.getRadicalFormEquivalentCharacter(char)
                variants.add(equivChar)
            except exception.UnsupportedError:
                # pass if no equivalent char exists
                pass

        return variants

    def getCharacterSimilars(self, char):
        """Gets a list of similar forms of the given character."""
        return self.getEquivalentCharTable([char],
            includeEquivalentRadicalForms=False,
            includeSimilarCharacters=True)[0]

    #{ radicals and components

    def getEquivalentCharTable(self, componentList,
        includeEquivalentRadicalForms=False, includeSimilarCharacters=False):
        u"""
        Gets a list structure of equivalent chars for the given list of
        characters.

        If option C{includeEquivalentRadicalForms} is set, all equivalent forms
        will be searched for when a Kangxi radical is given.

        If option C{includeSimilarCharacters} is set, characters with similar

        visual forms will be searched for, too.