# -*- coding: utf-8 -*-


class Keyword:
    def __init__(self):
        self.instances = []
        self.keywords = {"asset": "Asset", "资产": "Asset", "bank deposit": "Bankdeposit", "银行存款": "Bankdeposit", "金融资产": "FinancialAsset", "financial asset": "FinancialAsset", "stock": "Stock", "股票": "Stock", "intangible asset": "IntangibleAsset", "无形资产": "IntangibleAsset", "franchise": "Franchise", "加盟": "Franchise", "连锁": "Franchise", "商誉": "Goodwill", "goodwill": "Goodwill", "知识产权": "IntellectualProperty", "intellectual property": "IntellectualProperty", "土地使用权": "LandUseRight", "land use right": "LandUseRight", "专利": "Patent", "patent": "Patent", "fixed asset": "FixedAsset", "固定资产": "FixedAsset", "inventory": "Inventory", "存货": "Inventory", "投资性房地产": "InvestmentProperty", "investment property": "InvestmentProperty", "现金流": "CashFlow", "cash flow": "CashFlow", "股权": "Equity", "equity": "Equity", "所有者权益": "Equity", "留存收益": "RetainedEarnings", "retained earnings": "RetainedEarnings", "share": "Share", "股份": "Share", "质押": "PledgedShare", "pledging": "PledgedShare", "frozen": "FrozenShare", "冻结": "FrozenShare", "revenue": "Revenue", "营业收入": "Revenue", "营业外收入": "NonOperatingIncome", "non-operating income": "NonOperatingIncome", "liability": "Liability", "负债": "Liability", "金融负债": "FinancialLiability", "financial liability": "FinancialLiability", "dividend policy": "DividendPolicy", "股利政策": "DividendPolicy", "会计政策": "AccountingPolicy", "accounting policies": "AccountingPolicy", "政策": "Policy", "policy": "Policy", "window dressing": "WindowDressing", "粉饰": "WindowDressing", "income smoothing": "IncomeSmoothing", "平滑收益": "IncomeSmoothing","earnings management": "EarningsManagement", "盈余管理": "EarningsManagement", "accounting manipulation": "AccountingManipulation", "会计操纵": "AccountingManipulation", "audit": "Audit", "审计": "Audit", "audit opinion": "AuditOpinion", "auditor's opinion": "AuditOpinion", "审计意见": "AuditOpinion", "activity": "Activity", "活动": "Activity", "商业模式": "BusinessModel", "business model": "BusinessModel", "生意": "Business", "business": "Business", "capacity": "Capacity", "产能": "Capacity", "主营业务": "MainBusiness", "main business": "MainBusiness", "operation": "Operation", "业务": "Operation", "销售": "Sale", "sale": "Sale", "value chain": "ValueChain", "价值链": "ValueChain", "一致行动": "ActingInConcertAgreement", "acting in concert": "ActingInConcertAgreement", "agreement": "Agreement", "协议": "Agreement", "framework agreement": "FrameworkAgreement", "框架协议": "FrameworkAgreement", "债券": "Bond", "bond": "Bond", "可转换债券": "ConvertibleBond", "convertible bond": "ConvertibleBond", "金融工具": "FinancialInstrument", "financial instrument": "FinancialInstrument", "期货": "Futures", "futures": "Futures", "option": "Option", "期权": "Option", "私募": "PrivateEquity", "private equity": "PrivateEquity", "senior note": "SeniorNotes", "优先据": "SeniorNotes", "arrangement": "Arrangement", "协议": "Arrangement", "commitment letter": "CommitmentLetter", "承诺函": "CommitmentLetter", "contract": "Contract", "合约": "Contract", "劳动合同": "LaborContract", "labor contract": "LaborContract", "lease": "Lease", "租赁": "Lease", "loan contract": "LoanContract", "贷款合同": "LoanContract", "memorandum of understanding": "MOU", "备忘录": "MOU", "purchase contract": "PurchaseContract", "采购合同": "PurchaseContract", "commodity control": "CommodityControl", "商品控制权": "CommodityControl", "control": "Control", "控制": "Control", "重大影响": "SignificantInfluence","significant influence": "SignificantInfluence", "盈余管理": "Interest", "accounting manipulation": "Interest", "会计操纵": "AccountingManipulation", "audit": "Audit", "审计": "Audit", "audit opinion": "AuditOpinion", "auditor's opinion": "AuditOpinion", "审计意见": "AuditOpinion", "activity": "Activity", "活动": "Activity", "商业模式": "BusinessModel", "business model": "BusinessModel", "生意": "Business", "business": "Business", "capacity": "Capacity", "产能": "Capacity", "主营业务": "MainBusiness", "main business": "MainBusiness", "operation": "Operation", "业务": "Operation", "销售": "Sale", "sale": "Sale", "value chain": "ValueChain", "价值链": "ValueChain", "一致行动": "ActingInConcertAgreement", "acting in concert": "ActingInConcertAgreement", "agreement": "Agreement", "协议": "Agreement", "framework agreement": "FrameworkAgreement", "框架协议": "FrameworkAgreement", "债券": "Bond", "bond": "Bond", "可转换债券": "ConvertibleBond", "convertible bond": "ConvertibleBond", "金融工具": "FinancialInstrument", "financial instrument": "FinancialInstrument", "期货": "Futures", "futures": "Futures", "option": "Option", "期权": "Option", "私募": "PrivateEquity", "private equity": "PrivateEquity", "senior note": "SeniorNotes", "优先票据": "SeniorNotes", "arrangement": "Arrangement", "协议": "Arrangement", "commitment letter": "CommitmentLetter", "承诺函": "CommitmentLetter", "contract": "Contract", "合约": "Contract", "劳动合同": "LaborContract", "labor contract": "LaborContract", "lease": "Lease", "租赁": "Lease", "loan contract": "LoanContract", "贷款合同": "LoanContract"}
    def analyze(self, text):
        for keyword in self.keywords.keys():
            if keyword in text.lower():
                self.instances.append(self.keywords[keyword])
        return set(self.instances)

