iter2duplicate_list, iter2singleton from foxylib.tools.database.mongodb.mongodb_tools import MongoDBToolkit from foxylib.tools.env.env_tools import EnvToolkit from foxylib.tools.function.function_tools import FunctionToolkit from foxylib.tools.function.warmer import Warmer from foxylib.tools.json.json_tools import jdown from foxylib.tools.json.yaml_tools import YAMLToolkit from foxylib.tools.regex.regex_tools import RegexToolkit from foxylib.tools.string.string_tools import str2lower from henrique.main.hub.entity.entity_tool import EntityTool from henrique.main.hub.env.henrique_env import HenriqueEnv from henrique.main.hub.logger.logger import HenriqueLogger from henrique.main.hub.mongodb.mongodb_hub import MongoDBHub MODULE = sys.modules[__name__] WARMER = Warmer(MODULE) FILE_PATH = os.path.realpath(__file__) FILE_DIR = os.path.dirname(FILE_PATH) class TradegoodEntity: NAME = "tradegood" @classmethod def _query2qterm(cls, name): return str2lower(name) @classmethod @WARMER.add(cond=EnvToolkit.key2is_not_true(HenriqueEnv.K.SKIP_WARMUP)) @FunctionToolkit.wrapper2wraps_applied(lru_cache(maxsize=2))
from foxylib.tools.function.warmer import Warmer from foxylib.tools.locale.locale_tool import LocaleTool from foxylib.tools.native.clazz.class_tool import ClassTool from foxylib.tools.native.module.module_tool import ModuleTool from foxylib.tools.nlp.matcher.gazetteer_matcher import GazetteerMatcher from foxylib.tools.regex.regex_tool import RegexTool from foxylib.tools.span.span_tool import SpanTool from foxylib.tools.string.string_tool import str2lower, StringTool from foxylib.tools.entity.entity_tool import FoxylibEntity from henrique.main.document.henrique_entity import HenriqueEntity from henrique.main.document.tradegoodtype.tradegoodtype import Tradegoodtype from henrique.main.singleton.env.henrique_env import HenriqueEnv from henrique.main.singleton.locale.henrique_locale import HenriqueLocale MODULE = sys.modules[__name__] WARMER = Warmer(MODULE) FILE_PATH = os.path.realpath(__file__) FILE_DIR = os.path.dirname(FILE_PATH) class TradegoodtypeEntity: @classmethod def entity_type(cls): return ClassTool.class2fullpath(cls) @classmethod def text2norm(cls, text): return str2lower(text) @classmethod