       # -*- coding: utf-8 -*-
"""
Created on Mon Jun 26 09:52:24 2017

@author: Administrator
"""
import re
"""
二次提取数据
根据关键字进行粗略的段落的提取
"""
def MainLawsuit1(i):
    def Key_new(key,x):
        temp="0"
        for i in key:
            x1=x.count(i)
            if x1>0:
                temp=i
                break
        if temp!="0":
            x1=temp+".*"
            x=re.search(x1,x)
            x=x.group()
        else:
            x="请求法院判令被告赔偿原告XX元。"
        return x
    """
     1.段落的提取
    金额
    """
    def cut_(data):
        data=re.sub("^\n","",data,flags=re.S)
        if data[len(data)-1]!="\n":
            data=data+"\n"
        x1=re.search("(审理终结|审理完毕|审理完结|审理终|审理终|审理毕|纠纷一案)",data,re.S)
        if data.count("\n")<=1 and x1:
            return data
        ###数据
        data=re.sub("[一二三四五六七八九十壹贰叁肆伍陆柒捌玖]{1}[分元角]{1}(公司|店)","",data,flags=re.S)
        data=re.sub("([^\n。]{,10}(原告[^\n。，,;]*提供下列证据证明其主张|提交了以下证据|提供了以下证据|提供以下证据|提供如下证据|提交如下证据|提供[了]{,1}下列证据|提供证据如下|提交证据如下).*)","",data,flags=re.S)
        #data=re.sub("((提供下列证据证明其主张|提供如下证据|提交了以下证据|提供以下证据|提供如下证据|提交如下证据|提供[了]{,1}下列证据|提供证据如下|提交证据如下).*)","",data,flags=re.S)
        x1=re.search(".*(审理终结|审理完结|审理完毕|审理完|审理终|审理毕|纠纷一案)[^\n]*",data,re.S)
        if x1:
            x=x1.group()
            xx=data.replace(x,"")
            x0=re.search("[0-9/.一二三四五六七八九十百千万亿]+元|(人民币|美元|日元|美金|合理支出|合理费用|经济损失)[0-9/.一二三四五六七八九十百千万]+",x,re.S)
            x1=re.search("[诉]{,1}[请要]{1}[^。，,]{,10}判令:|[请要]{1}求判令|请求判决|判令.{,1}被告[:：]{1}|诉称[:：]{1}|诉称[^。]*[0-9一二三四五六七八九十万亿百/.]+[元角分厘]{1}",x,re.S)
            x2=re.search("诉讼请求[:：]{1}|请求[^。，、\n]{,5}法院判令:|请求[.]{,3}判令[一二三四五六七八九十各两叁肆伍陆柒捌玖拾]{,1}被告:|诉至.{,5}院[.]{,1}(请求|要求)判令:|现起诉请求法院判令|请求法院依法判令被告:|诉讼请求为:|请求判令[.]{,2}(被告|):|请求(判令|判决)[^。，]{,20}:|原告[^。，]{,30}提出的诉讼请求|原告[^。，]{,30}起诉|诉至本院[.]{,3}:|故我公司要求.{2,15}:|诉请法院判令[:：]{1}|提起诉讼,请支持:|其诉讼请求为:|请求法院:|故我.{2,}?要求.{3,15}向我|现我请求法院判令.{3,15}赔偿|要求[^。，,]{,20}向我支付|故我请求法院|请求法院判令|请求法院判令|(要求|请求)[^，。、]{,20}[:：]{1}|故要求[，,]{1}|(要求|判令)[^，。;:；\n]{,10}公司|故我诉至法院请求|诉讼请求|诉称|现要求|起诉要求|并判令|判令[^。，]{,30}公司:|故我要求|现我公司要求|依法判决[:：]{1}|诉请",xx,re.S)
            if x1 and x0:
               data=x
            elif x2:
                data=xx

        #x0=re.search("将其诉讼请求变更为")
        #在本案审理过程中,原告治历公司将其请求变更为:
        #原告明确第一项诉讼请求
        data=re.sub("(.*)(并变更诉请为:.*)",lambda t:t.group(2),data,flags=re.S)
        x1=re.search("((庭审前|庭审中|庭审时|审理过程中|庭审中)[^\n]*将[其]{,1}(诉讼|)请求变更为:)(.*)",data,re.S)
        x2=re.search("(庭审中|审理时|审理过程中|审理中)[^\n。]*原告主张.*",data,re.S)
        if x1:
            data="请求判令:"+x1.group(4)
        elif x2 and "变更" not in data:
            data=data.replace(x2.group(),"")

        x1=re.search("(.*)(庭审中明确为|庭审中确认|在审理中,原告明确|在审理中,确认|庭审中,明确|庭审中,确认为)(.*)",data,re.S)
        if x1:
            count1=(x1.group(1)).count("元")
            if count1==0:
                data="请求判令:"+x1.group(3)
        x1=re.search("(庭审中,原告[^\n。，,;；]*明确|在审理中,原告(明确|确认)|原告庭审中(明确|确认)|(庭审中|审理中)[,，]{,1}(原告|)(明确|确认)).*",data,re.S)
        if x1:
            x1=x1.group()
            data=data.replace(x1,"")
        x1=re.search("(庭审中|审理过程中|庭审时|诉讼过程中|在庭审过程中|审理中|诉讼中).*",data,re.S)
        ##: 出现撤回,增加至|更改[0-9一二三四五六七八九十]项元进行更改在进行计算
        ##该项诉求变更为519615.00元整
        #x1=re.search("([0-9一二三四五六七八九十该]{1}项[0-9一二三四五六七八九十百千万](元|￥)")
        if x1:
            x22=x1.group()
            ###
            x21=data.replace(x22,"")
            count1=x21.count("元")+x21.count("￥")
            count2=x22.count("元")+x22.count("￥")
            if (count2==1 and count1<=1) or count2==count1:
                #x21money=re.search("[0-9]万元",)
                data=x22
            elif count2==1 and count1>1:
                #key={"一":"1","二":2,"三":"3","四":"4","五":5,"六":"6","七":"7","八":"8","九":"9","十":"10"}x1=re.search("[0-9一二三四五六七八九十]{1}项[^；;。]*[0-9一二三四五六七八九十百千万亿,][美万]{,1}[元￥]{1}",x22,re.S)
                x=re.search("([0-9一二三四五六七八九十]{1})(项[^；;。,，]*?)([0-9\.一二三四五六七八九十百千万亿,,]+[美万]{,1}[元￥]{1})",x22,re.S)
                if x:
                    rex_change=re.search("变更|增加至|修改|更改",x22,re.S)
                    rex_vanish=re.search("撤销|撤消|撤回",x22,re.S)
                    x2=x.group(3)
                    x3=x.group(1)
                    if rex_change:
                        data=re.sub("("+x3+")(、[^。;；]*[0-9,\.一二三四五六七八九十百千万][万美]{,1}[元￥]{1})",lambda t:t.group(1)+'、'+x2,x21)
                    elif rex_vanish:
                        data=re.sub("("+x3+")(、[^。;；]*[0-9,\.一二三四五六七八九十百千万][万美]{,1}[元￥]{1})",'',x21)
                    else:
                        data=x21
                else:
                    data=x21
            elif count2>count1:
                data=x22
            else:
                data=x21
        return data

    def match_multi_word(word_list,text):
        key=["判令被告:","因此,请求判令","诉请人民法院判令:","诉称","要求、","要求判令:","原告据此请求法院判令：","请求判令二被告:","请求.{0,6}判令：","故原告起诉要求判决：","请求.{0,5}判决","要求：","故我公司提起诉讼,要求","原告起诉仅主张","请求判令被告:","原告起诉来院,","依法诉请判令","请求判令","恳请判令","请批评指正法院制止科技中心的侵权行为,","(原告)?.{0,15}诉称"]
        for i in word_list:
             j=text.find(i)
             #辩称|未作答辩|答辩称|
             w=re.findall("事实和理由|未提交书面答辩状|反诉称",text)#如果找到的即是第一个找到的
             if w and "据以上事实和理由" not in text:
                 w=w[0]
                 w=text.find(w)
             else:
                 w=-1
             if j>w and w!=-1:#and ":" not in w and "：" not in w
                 continue
             if i in text:
                #reg = "("+i+")"+".*[\r\n\t]"
                reg = "("+i+")"+".*"
                reg=re.search(reg,text)
                if  reg:
                    reg=reg.group()
                    count=reg.count("。")+reg.count("；")
                    if count==0:
                        reg="("+i+")"+".*?。"
                        reg = re.search(reg,text,re.S)
                        if reg is None:
                            return text
                        else:
                             return reg.group()
                    else:
                        return reg
                else:
                    return ""
                break
        if i==word_list[len(word_list)-1]:
            reg=Key_new(key,text)
            return reg
    """
    诉称的赘余
    重新定制[之前的规则]
      if "诉称：" in x and x2:
            x3=x2.group()+".*"
            x1=re.findall(x3,x)
            if x1 and x1[0].count("元")>0:
                x=x1[0]
    """
    def DeleteRepeat(x):
        x1="(^.*)((因此[.]{,1}请求判令|故诉请判令:|,诉至法院|要求判令[:：]{1}|诉至法院请求判令|我.{0,10}要求.{0,10}公司|我.{0,10}(请求|要求).{0,10}(被告|撤销|返还|赔偿|偿还|电影基金会|公司|解除|停止|删除|支付|履行)|故.{2,10}法院.{0,30}(请求|要求).{0,20}(公司|确认|解除|删除)|我?.{0,20}(要求|请求).{0,30}(：|:)|故向法院提起诉讼,诉请一、))"
        x2=re.search(x1,x,re.S)
        if x2:
           x1=x2.group(1)
           x2=x.replace(x1,"")
           if x2.count('元')>0:
                x=x2
        return x
    """
    除去后边没有换行的部分数句
    换行的后边他如果没有标点符号的话直接替换成；
    分号来计算以避免数据有可能出现的问题
    那么就以：分号数据的
    这个的先不添加主要是新添加了尾部处理的功能
    """

    def  Remove(x):
        x1=re.search("(事实和理由|辩称|未作答辨).*",x,re.S)
        if x1:
            x=x.replace(x1.group(),"")
        x1=re.search("(.*?[。，,]{1})([^。，,]*(变更|变更第[一二三四五六七八九十0-9]{1}项诉讼请求为).*)",x,re.S)
        if x1:
            x21=x1.group(1)
            x22=x1.group(2)
            x2=re.search("[一二三四五六七八九0-9]{1}项",x22)
            count1=x21.count("元")+x22.count("￥")
            count2=x22.count("元")+x22.count("￥")
            if x2:
                if count1==count2:
                    x=x22
                elif count2==0:
                    x=x21
            else:
                x=x21
        ##庭审中|审理过程中|庭审时|诉讼中|诉讼过程中|在庭审过程中|审理中: 出现撤回,增加至|更改[0-9一二三四五六七八九十]项元进行更改在进行计算
        ##1)如果没有不影响 2)如果有的话如何设置规则  ###
        t="(.*)((审理中|事实和理由:|庭审中|更改诉讼请求|审理过程中|庭审时|审理过程中,原告变更诉讼请求为:|故撤回第一项诉讼请求|诉讼中|更改诉讼请求|本案诉讼过程中|诉讼过程中|在庭审过程中|上述网域名称注册证明、授权委托书经台湾台北地方法院公证处公证,上海市公证协会认证|庭审中,原告明确|审理中,原告确认在诉讼过程中|审理中,原告申请撤回|诉讼中,原告变更第二项诉讼请求为|诉讼中,原告变更第二项诉讼请求|诉讼中,原告变更第二项诉讼请求|审理中,原告变更诉讼请求为|审理中,原告明确|审理中,原告变更诉讼请求|庭审中,原告明确诉请|庭审中,原告明确合理费用|诉讼中,原告撤回|审理中,原告申请将|辩称|未作答辩|庭审中,原告明确第一项诉讼请求为:|故撤回第一项诉讼请求|两原告明确第二项诉讼请求|故申请撤回了第一项诉讼请求|答辩称|未提交书面答辩意见|庭审中原告撤回|庭审中,原告撤回|审理中,原告向本院撤回|在审理中,原告增加诉讼请求|审理中,原告确认被告已停止|审理中,原告撤回|审理中,原告撤回第二项诉讼请求).*)"
        ## 撤回金额在做细分
        st=re.search(t,x,re.S)
        if st:
            x1=st.group(1)
            x2=st.group(2)
            Count1=x1.count("元")+x1.count("￥")
            Count2=x2.count("元")+x1.count("￥")
            if Count1==Count2 or Count1<count2:
                x=x2
            else:
                x=x1
        return x
    ####诉讼更改的数据要抽出来一批数据

    ###除去括号的表达式的问题


    def  ClaimStander(x):
        x=x.replace("（","(")
        x=x.replace("）",")")
        x=x.replace("[","(")
        x=x.replace("]",")")
        x=x.replace("【","(")
        x=x.replace("】",")")
        x=x.replace(";","；")
        x=x.replace("［","(")
        x=x.replace("］",")")
        x=x.replace(" ","")###首先除空格在除逗号
        x=re.sub("[a-zA-ZXx]+万元","XX元",x)
        x=re.sub("\d+(\.)\d+",lambda x:(x.group()).replace(".","_"),x)
        x=re.sub("\d+(．)\d+",lambda x:(x.group()).replace("．","_"),x)
        x=re.sub("\d+(,)\d+",lambda x:(x.group()).replace(",",""),x)
        x=re.sub("\d+(，)\d+",lambda x:(x.group()).replace("，",""),x)
        return x
    def cn2dig(cn):
        cn = cn.group()
        if set(cn[0]).issubset(set([u'零',u'0',u'〇',u'.',u','] + list(u'兆亿億萬万仟千佰百角分里厘毫元圆'))):
            cn = cn[1:]
        CN_NUM = {u'〇' : 0,u'一' : 1,u'二' : 2,u'三' : 3,u'四' : 4,u'五' : 5,u'六' : 6,u'七' : 7,u'八' : 8,u'九' : 9,
              u'零' : 0,u'壹' : 1,u'贰' : 2,u'叁' : 3,u'肆' : 4,u'伍' : 5,u'陆' : 6,u'柒' : 7,u'捌' : 8,u'玖' : 9,
              u'貮' : 2,u'两' : 2,
             }
        CN_UNIT = {u'毫' : 0.0001,u'厘' : 0.001,u'分' : 0.01,u'角' : 0.1,u'元' : 1,u'圆' : 1,
               u'十' : 10,u'拾' : 10,u'百' : 100,u'佰' : 100,u'千' : 1000,u'仟' : 1000,
               u'万' : 10000,u'萬' : 10000,u'亿' : 100000000,u'億' : 100000000,u'兆' : 1000000000000,
              }
        CN_DIGITS = [str(i) for i in range(10)]  # 用来判断单纯数字，当然包括小数在内 可以直接返回,如123.00元,123元
        CN_DIGITS.append(u"元")
        CN_DIGITS.append(u".")
        CN_DIGITS_C = [str(i) for i in range(10)] # 用科学计数法来存储的数字,比如12,765,89元
        CN_DIGITS_C.extend([u",",u"元",u"."])
        CN_DIG_CHAR = [str(i) for i in range(10)] # 处理数字加大小写的数字 比如：123万元，1亿元，2.3亿元
        CN_DIG_CHAR.extend([u"元",u".",u",",u"万",u"千",u"百",u"十",u"十万",u"百万",u"千万",u"亿",u"兆"])
        CN_DIG_CHAR_DICT = {u"万":10000,u"千":1000,u"百":100,u"十":10,u"十万":100000,u"百万":1000000,u"千万":10000000,u"亿":100000000,u'十亿':1000000000,u'百亿':10000000000,u'千亿':10000000000,u'万亿':1000000000000,u"兆":1000000000000}
       # CN_DIG_CHAR_DICT = {u"万":10000,u"千":1000,u"百":100,u"十":10,u"十万":100000,u"百万":1000000,u"千万":10000000,u"亿":100000000,u"兆":1000000000000}
        CN_ALL = list(CN_NUM.keys()) + list(CN_UNIT.keys()) # 用大写小写存储的数字
        if set(cn).issubset(set(CN_ALL)):
            lcn = list(cn)      # 将cn拆分为列表
            unit = 0 #当前的单位
            ldig = []#临时数组
            while lcn:
                cndig = lcn.pop()  # 从cn最后一个开始
                if cndig in CN_UNIT:                  # 对分离出的进行单位判断
                    unit = CN_UNIT.get(cndig)
                    if unit==10000:
                        ldig.append('w')    #标示万位
                        unit = 1
                    elif unit==100000000:
                        ldig.append('y')    #标示亿位
                        unit = 1
                    elif unit==1000000000000:#标示兆位
                        ldig.append('z')
                        unit = 1
                else:                                ## 否则进行数字判断
                    dig = CN_NUM.get(cndig)

                    if unit:                  # 计算每一个单位的数 比如 四百部分：4*100
                        dig = dig*unit
                        unit = 0
                    ldig.append(dig)          # ldig 9 30 400 unit 10
            if unit==10:                            ## 单独处理10-19的数字因为 此时十作为的是数字而不是单位
                ldig.append(10)
            ret = 0
            tmp = 0
            while ldig:                       # 对ldig中各部分数字进行叠加
                x = ldig.pop()
                if x=='w':                   # 单独对万进行处理，因为前面不可以直接相乘，下面同理
                    tmp *= 10000
                    ret += tmp
                    tmp=0
                elif x=='y':
                    tmp *= 100000000
                    ret += tmp
                    tmp=0
                elif x=='z':
                    ret += tmp
                    tmp=0
                else:
                    tmp += x
            ret += tmp
            return str(ret)+u'元'
        elif set(cn).issubset(set(CN_DIGITS)): ## 这种情况相当于为全为数字类型，可以直接返回
            return cn
        elif set(cn).issubset(set(CN_DIGITS_C)):
            return ''.join([i for i in list(cn) if i != ','])
        elif set(cn).issubset(set(CN_DIG_CHAR)): ## 对形如1.34万元进行转换
            if re.search(".*?(?=\d)",cn) is None:# 处理数字的前缀部分
                cn_pre = ''
            else:
                cn_pre = re.search(".*?(?=\d)",cn).group()
            cn = re.search("\d.*元",cn).group()
            cn_l = re.search("^\d[\d,\.]*\d?",cn).group() # 截取数字部分
            cn_l = ''.join([i for i in list(cn_l) if i != ',']) # 去逗号
            cn_l = float(cn_l)
            cn_m = re.search("[^\d元\.,]{1,2}",cn)
            if cn_m is None:
                return cn_pre+cn
            else:
                return cn_pre+str(cn_l*CN_DIG_CHAR_DICT.get(cn_m.group()))+"元"
        else:
           pass
           return "no"
    """
    除去没有元的括号的内容
    """
    def Deletesp(x):
        x1=re.findall("\([^\(元]*\)",x)
        y1=re.findall("《[^《》]*》",x)
        for i in x1:
            x=x.replace(i,"")
        for j in y1:
            x=x.replace(j,"")
        return x
    #一般的括号去重主要是钱的去重

    def Delsp(i):
        t1='[；;,\.。，、：:]?[^；;,\.。，、：:\(\)]*元[^；;,\.。，、：:]*(\([^\(\)]*元[^\(]*[\)])[^\(\)]*?[；;,\.。，、：:]'
        k1='[；;,\.。，、：:]?[^；;,\.。，、：:]*(\([^\(\)]*元[^\(]*[\)])[^\(\)；;,\.。，、：:]*元[^\(\)]*?[；;,\.。，、：:]'
        x=re.findall(t1,i)
        y=re.findall(k1,i)
        s=x+y
        l=len(s)
        j=0
        while  j<l:
            i=i.replace(s[j],"")
            j=j+1
        return i

    #
    #1)处理特殊符号元的数据 并且的替换到的是数据的问题
    #把单价和价格的去掉
    #
    def deal_money(x):
        x=re.sub("[0-9\.一二三四五六七八九十百千万亿]+元等不等的价格","",x)
        rm1=re.findall("￥([0-9]+\.?[0-9]*)[^元0-9\.]",x)
        ###输出数据读额
        while rm1:
            x=x.replace("￥"+rm1[0],rm1[0]+"元")
            rm1=re.findall("￥([0-9]+\.?[0-9]*)[^元0-9\.]",x)
        rm2=re.findall("([0-9]+\.?[0-9]*)￥",x)

        while rm2:
            rm2=rm2.group()
            x=x.replace(rm2[0]+"￥",rm2[0]+"元")
            ###钱的结果数据问题
            rm2=re.findall("([0-9]+\.?[0-9]*)￥",x)
        return x
    #
    #1)美元、美金、欧元处理数据的钱
    def deal_dollars(x):
        ####仅仅是对美元的转化数据
        x1=re.search("(美元|美金)([0-9]+\.?[0-9]*)(元)",x,re.S)
        while x1:
            x1=x1.group()
            ####完成美元的转化问题数据
            x2=str(round(float(x1[2:len(x1)-1])*7,3))+"元"
            x=x.replace(x1,x2)
            x1=re.search("(美元|美金)([0-9]+\.?[0-9]*)(元)",x,re.S)
        x1=re.search("([0-9]+\.?[0-9]*)(美元)",x,re.S)

        while x1:
            x1=x1.group()
            ####完成美元的转化问题数据
            x2=str(round(float(x1[:len(x1)-2])*7,3))+"元"
            x=x.replace(x1,x2)
            x1=re.search("([0-9]+\.?[0-9]*)(美元)",x,re.S)
        ###仅仅是美元的转化

        ####万美元的转换数据
        x1=re.search("([0-9]+\.?[0-9]*)(万美元)",x,re.S)
        while x1:
            x1=x1.group()
            x2=str(round(float(x1[:len(x1)-3]),3)*7*10000)+"元"
            x=x.replace(x1,x2)
            x1=re.search("([0-9]+\.?[0-9]*)(万美元)",x,re.S)
        ###欧元的计算的问题
        x1=re.search("[0-9]+\.?[0-9]*(欧元)",x)
        while x1:
            x1=x1.group()
            x2=str(round(float(x1[:len(x1)-2])*7.27,3))
            x=x.replace(x1,x2)
            x1=re.search("[0-9]+\.?[0-9]*(欧元)",x)
        x1=re.findall("[^0-9\.]{2}[0-9]{1}元",x)
        #####除一些被告原告的有元的数据
        x1=re.findall("[^0-9\.]{2}[0-9]{1}元",x)
        for j in x1:
            x2=re.search("(损失|民币|罚款|开支)",j)
            if not x2:
                x=x.replace(j,"")
        return x

    """
    利息
    """

    def Deal_interest(x):
        x=re.sub("(每[件案]{1}(经济损失(含维权合理支出)人民币|经济损失|注册商标|)[0-9/.]+元)","",x)
        reg_interest="(利息|违约金|复利|担保费|罚息|尚需支付|已支付|还需支付|还需付款|尚需付款)[\(][^\(\)]*?[\)]"
        reg_Every="每.{0,3}[0-9]+\.?[0-9]*?元"
        reg_deal="(扣除|余款|已支付|还需支付)[^；;,，。]*?[，；。;,]"
        #####利息中关于本金的去重
        x1=re.search(reg_interest,x,re.S)
        while x1:
            x1=x1.group()
            x=x.replace(x1,"")
            x1=re.search(reg_interest,x,re.S)
        ####利息中的每的重复
        x2=re.search(reg_Every,x,re.S)
        while x2:
            x2=x2.group()
            x=x2.replace(x2,"")
            x2=re.search(reg_Every,x,re.S)
        ####关于扣除和余款方面的
        x3=re.search(reg_deal,x,re.S)
        while x3:
            x3=x3.group()
            x=x.replace(x3,"")
            x3=re.search(reg_deal,x,re.S)
        ####处理一些非钱的数字【名字中的刘三元,以及六圆都有可能翻译成6元这个要具体的看文书看看能不能改变】
        x4=re.search("、[0-9]元",x,re.S)
        while x4:
            x4=x4.group()
            x=x.replace(x4,"")
            x4=re.search("、[0-9]元",x,re.S)
        x5 = re.search("以(人民币|价款)?[0-9]+\.?[0-9]*元为(本金|基数|限)",x,re.S)
        while x5:
            x5 = x5.group()
            x = x.replace(x5,"")
            x5 = re.search("以(人民币)?[0-9]+\.?[0-9]*元为(本金|基数|限)",x,re.S)
        x6 = re.search("((总额)?超过|周年庆|按本金)[0-9]+\.?[0-9]*元",x,re.S)
        while x6:
            x6 = x6.group()
            x = x.replace(x6,"")
            x6 = re.search("((总额)?超过|周年庆|按总欠款|按本金|该)[0-9]+\.?[0-9]*元",x,re.S)
        x7 = re.search("至被告退还原告保证金(人民币)?[0-9]+\.?[0-9]*元之日止",x,re.S)
        while x7:
            x7 = x7.group()
            x = x.replace(x7,"")
            x7 = re.search("至被告退还原告保证金(人民币)?[0-9]+\.?[0-9]*元之日止",x,re.S)
        x8 = re.search(".*上述第一、二项相互抵顶",x,re.S)
        while x8:
            x8 = x8.group()
            x = x.replace(x8,"")
            x8 = re.search(".*上述第一、二项相互抵顶",x,re.S)
        x9 = re.search("元／",x,re.S)
        while x9:
           x9 = x9.group()
           x = x.replace(x9,"")
           x9 = re.search("元／",x,re.S)
        x10 = re.search("在(人民币)?[0-9]+\.?[0-9]*元(人民币)?的范围内",x,re.S)
        while x10:
           x10 = x10.group()
           x = x.replace(x10,"")
           x10 = re.search("在(人民币)?[0-9]+\.?[0-9]*元(人民币)?的范围(之)内",x,re.S)
        x11 = re.search("损失(人民币)?([0-9]+\.?[0-9]*元)(人民币)?之[0-9]{1,2}%即[0-9]+\.?[0-9]*元",x,re.S)
        while x11:
            x11 = x11.group(2)
            x = x.replace(x11,"")
            x11 = re.search("损失(人民币)?([0-9]+\.?[0-9]*元)(人民币)?之[0-9]{1,2}%即[0-9]+\.?[0-9]*元",x,re.S)
        x12 = re.search("租金[0-9]+\.?[0-9]*元(人民币)?从[0-9]{4}年[0-9]{1,2}月[0-9]{1,2}日起至实际支付日止的",x,re.S)
        while x12:
            x12 = x12.group()
            x = x.replace(x12,"")
            x12 = re.search("租金[0-9]+\.?[0-9]*元(人民币)?从[0-9]{4}年[0-9]{1,2}月[0-9]{1,2}日起至实际支付日止的",x,re.S)
        return x
    """

    #前期的规范化处理,数据读额
    """
    def pre_regular(x):
        x=x.replace("．",".")
        x=re.sub("([0-9一二三四五六七八九十壹贰叁肆伍陆柒捌玖拾]+分(店|公司))","公司",x,flags=re.S)
        x=x.replace("o","0")
        x=x.replace("Ｏ","0")
        return x
    """
    恢复
    """
    def Trans(x):
        x=re.sub("[0-9]+(_)[0-9]+",lambda x:(x.group()).replace("_","."),x)
        return x
    """
    钱的规范化
    """
    def Add_money(x):
        x1=re.search("(损失赔偿|经济赔偿|经济损失|合理支出人民币|合理支出|合理费用|合理费用为|共计|人民币|损失|损失为|总记|共计|共合|合共|罚款|利息)([0-9]+\.[0-9]*[^元0-9\.])",x)
        while x1:
            x2=x1.group(1)
            x3=x1.group(2)
            x1=x1.group()
            if "万" in x3:
                x3=str(round(float(x3[:len(x3)-1]),8)*10000)+"元"
                x3=x2+x3
                x=x.replace(x1,x3)
            else:
                x3=x3[:len(x3)-1]+"元"+x3[len(x3)-1]
                x3=x2+x3
                x=x.replace(x1,x3)
            x1=re.search("(合理费用|合理费用为|共计|人民币|损失|损失为|总记|共计|共合|合共|罚款|利息)([0-9]+\.[0-9]*[^元0-9\.])",x)
        return x
####
    """
   连带赔偿？？？ 连带问题？？？解释说明错误？
    """
    def Deal_responsible(x):
        x=re.sub("(对其中的[0-9/.]+元承担连带(赔偿|清偿|)责任)","",x)
        x=re.sub("([^\n]*元[^。\n]*)([,，]{1}其中包括[^\n。]*)",lambda t:t.group(1),x,flags=re.S)
        x=re.sub("(元)([，,]{1}(包含|包括)((?!(;|；|[一二三四五六七八九十0-9]{1}、|\n|。)).)*)",lambda t :t.group(1),x,flags=re.S)
        return x

    ######################
    #诉讼金额去重的主函数
    #1)文书的规范化
    #2)文书的合计、共计、总计、共合、合共、共、合
    #4)合理费用有时候是一个共计的意思如何的能把他设定为共计的意思
    def Deal_countMoney(x):
        temp_money=[]###作为临时储存的位置
        #a_money_pre="([^0-9\.X]{2})[0-9\.]+元"
        a_key="(共计|合计|总计|共合|共|计).*?([0-9]+\.?[0-9]*)元"
        x_money=re.findall("[;；。]?[^;；。]*[0-9]+\.?[0-9]*元.*?[;；。\r\n\t]",x)
        x_count=0
        l_money=0#最后的钱的个数
        for i in x_money:
            x_count=x_count+1
            x1=re.findall("([0-9]+\.?[0-9]*)元",i)
            xll_k=re.findall(a_key,i)
                ###一个元
            if len(x1)==1:
                temp_money.append(round(float(x1[0]),3))
                ###多个元的
            elif len(x1)>1 and len(xll_k)==0:
                Money=[round(float(b),3) for b in x1]
                Money=sum(Money)
                Money=round(Money,3)
                temp_money.append(Money)
            elif len(x1)==1 and len(xll_k)==1 and x_count!=len(x_money):
                Money=round(float(x1[0]),3)
                Money=str(Money)
                temp_money.append(Money)
            elif len(x1)>1 and len(xll_k)==1 and x_count!=len(x_money):
                money=[round(float(b),3) for b in x1]
                Money=round(sum(money),3)
                if round(max(money)*2,3)==Money:
                    temp_money.append(max(money))
                else:
                    temp_money.append(Money)
            ###只有一个合计的
            elif len(x1)>1 and len(xll_k)==1 and x_count==len(x_money):
                money=[round(float(b),3) for b in x1]
                Money=sum(money)
                Money=round(Money,3)
                if round(max(money)*2,3)==Money:
                    temp_money.append(round(max(money),3))
                elif max(money)==Money+sum(temp_money):
                    l_money=round(max(money),3)
                else:
                    temp_money.append(Money)
            elif len(x1)==2 and len(xll_k)==2 and x_count!=len(x_money):
                money=[round(float(b),3) for b in x1]
                Money=sum(money)
                Money=round(Money,3)
                temp_money.append(Money)
            elif len(x1)==2 and len(xll_k)==2 and x_count==len(x_money):
                money=[round(float(b),3) for b in x1]
                Money=round((sum(money)+sum(temp_money)),3)
                if Money==2*max(money):
                    l_money=max(money)
                else:
                    temp_money.append(round(sum(money),3))
            else:####要共计的钱XX+上后边的钱等于后边的共计的钱
                money=[round(float(b),3) for b in x1]
                m_l=[round(float(b[1]),3)for b in xll_k]
                Max=max(money)
                if Max*2==sum(money):
                    temp_money.append(Max)
                elif Max*2==sum(money)+sum(temp_money)and x_count==len(x_money):
                    l_money=Max
                elif sum(m_l)*2==sum(money) and x_count!=len(x_money):
                    temp_money.append(sum(m_l))
                else:
                    temp_money.append(sum(money))
        if l_money!=0:

            return str(round(l_money,3))
        else:

            return str(round(sum(temp_money),3))

    ###注意小数点的保存后边三位小数点
    def Mycount_(x):
        a_key="(共计|合计|总计|共合|共|计).*?([0-9]+\.?[0-9]*)元"
        x=x.replace("人民币","")
        xll_k=re.findall(a_key,x)##合计的代码
        #文书
        x0=re.findall("[xa-zX某]+元",x,re.I)###不祥的
        x1=re.findall("([0-9]+\.?[0-9]*)元",x)###提取出来元的集合
        money=""
        #unknown=re.search("(赔偿|返还|支付).{0,20}(经济损失|合理费用|合理支出|律师费|损失)",x)
        if len(x0)>0:
            return "不祥"
        elif len(x1)==0:
            return '0'
        elif len(x1)==1:
            return (x1[0])
        elif len(x1)>1 and len(xll_k)==0:
            temp_money=[round(float(b),3) for b in x1]
            money=str(round(sum(temp_money),3))
            return money
        elif len(x1)==2 and len(xll_k)==2:
            temp_money=[round(float(b),3) for b in x1]
            money=str(round(sum(temp_money),3))
            return money
        ####一个合计得如何进行操作
        elif len(x1)>1 and len(xll_k)==1:
            money=Deal_countMoney(x)
            return money
        ###多个合计的话如何
        elif len(x1)>2 and len(xll_k)>1 :
            money=Deal_countMoney(x)
            return money
    ###诉求金额
    def Main_Money_law_suit(content):
        content=re.sub("[\(（]{1}[^\(（）\)元钱。\n]{,30}[\)）]{1}","",content)
        k=["判令被告:","故请求判令1、","故请求判令一、","故诉请判令:","因此,请求判令","故起诉请求人民法院判令","请求判令:","故原告诉至本院,要求判令:","现起诉请求法院判令","请求法院依法判令被告:","原告吴伟敏的诉讼请求为:","请求判令被告:","综上,请求判令:","请求判令被告三峰公司:","请求判令二被告:","原告音集协向本院提出的诉讼请求","原告安徽隆平公司诉称","故原告起诉至法院,请求判决:","为此,原告诉至本院要求:","请求判令被告:","原告为此诉请法院判令：","特提起诉讼,请求判令被告:","故我公司要求.{2,15}:","现诉请法院要求:","故向贵院提起诉讼,请支持:","其诉讼请求为:","请求法院:","现诉请法院:","故我公司要求.{3,20}向我","故我公司要求我乐公司:","故我.{2,}?要求.{3,15}向我","故我协会要求阿里巴巴公司:","现我要求联华快客公司:","现我请求法院判令.{3,15}赔偿","故我要求不二家公司向我支付","我公司要求闽龙轩公司:","我公司现要求糖潮公司我公司现要求银马休闲第二分公司::","要求骆驼公司和奥特莱斯购物中心:","现我公司要求捷报互动公司和酷粉网络公司:","故我请求法院解除双方签订的,要求铂洛德公司","故根据关于单方解除合同的规定,我请求法院判令","故我公司诉之法院,请求法院判令解除双方之间签订的并判令乾像时空","我公司请求法院判令纳森新源科技公司现我公司要求苏珊珊:","我公司现请求法院判令张智安","现我请求法院撤销双方签订的,要求铂洛德公司","现我根据的规定请求法院解除双方签订的,要求铂洛德公司","我现请求法院确认双方因无法实现合同目的而解除,并判令奥科视清公司","故我诉至法院请求解除我与铂洛德公司","故我协会要求北青网公司:","我请求法院撤销双方签订的,要求铂洛德公司","故我请求法院解除双方签订的,要求施德佳公司","现我公司起诉要求新传在线公司","故我诉至法院请求撤销我与铂洛德公司","现我公司起诉要求新传在线公司","故我社要求京东公司、广东音像公司、京凰公司:","故我公司起诉要求绿野影视","现我公司诉至法院请求判令阿里巴巴","现我公司起诉要求风网信息公司","现我公司起诉要求风网信息公司立即停止侵权行为、","故诉至法院,请求判令时越公司","故我社诉至法院请求判令育才图书公司","现我公司起诉要求海圣康","我公司现要求海圣康泰公司:","故我诉至法院请求判令风火云公司","东方家园公司已经构成了根本违约,故我公司请求","现我公司诉至法院请求判令解除我公司与思杰乐创公司","现我公司请求法院判令银星英派公司支付","。我要求中医药出版社、","为此,我公司要求五八公司:",",故我诉至法院请求依法解除我与极鳌公司","故我公司现诉至法院请求判令博集天卷公司","现我中心诉至法院请求判令锐邦公司支付我","为此,我诉至法院请求判令天盈九州公司","故我要求人民网公司在人民网","现我诉至法院请求判令锦辉富业","故我诉至法院请求判令幸福蓝海","综上,我诉至法院请求判令幸福蓝海","我公司请求法院判令凯旋万嘉公司","现我公司诉至法院请求确认双方所签订的已经解除,并判令大安映画","现我公司诉至法院请求判令解除双方所签,笑游公司返还","我请求法院判令白小红、家和家美家居公司:","故我要求人民网公司立即停止使用我享有著作权的漫画作品,在人民网上刊","现我公司诉至法院请求判令天凡","现我公司要求东方昌喜公司","鉴于上述原因,现我诉至法院请求判令","故我公司请求法院判令光影长河","提请人民法院判决:","请求人民法院依法判决:","诉至法院请求判令二被告:","故我公司请求法院判令祥云医院公司:","故我公司请求法院判令凯盈公司、天猫公司:","故我公司请求法院判令国德公司、天猫公司:","故我公司起诉至法院请求判令","。我公司请求法院判令多米在线公司、好音","庭审中诉请:","故我公司要求酷溜网公司停止侵权","故我请求法院判令彭立冲:","故我公司提起诉讼,请求法院判令如下:","故我公司提起诉讼,请求法院判令如下:","故我公司提起诉讼,请求法院判令如下:","故我公司要求和讯公司停止侵权,赔偿我公司经济","原告据此请求法院判令被告：","故诉请被告停止对原告著作权的侵害","请求法院适用\"多余指定原则\"判令：","以及我国有关民事司法政策之规定,判令：","故诉至本院,要求依据我国","诉诸法院,要求:","原告要求追加赵某某、张某某为本案被告参加诉讼,并要求：","我现请求法院解除双方的合同,要求藏今阁公司","现我要求宏章文化公司","现我公司要求金好风公司、金英马公司继续","故我校现请求法院判令尚德慧公司:","我公司要求豆网公司","现我公司诉至法院请求判令中视丰","现我公司诉至法院请求判令丹颜","故我要求尚德汇智公司","故我要求尚德汇智公司向我公开赔礼道歉,","故我方要求东方昂泰公司立即停止侵权行为","故我公司要求英氏营养食品公司","故我起诉请求法院解除双方签订的","工业大学、马重芳已经构成了违约,我公司请求法院","我公司要求：","我要求必尔得公司:","天海金时公司违反了合同约定,故我公司请求法院","为此,我公司请求法院判令解除双方签订的","故我公司现要求:","现我起诉要求法迪公司","故我公司要求赖一凡","故我向法院提起诉讼,要求判令","现我公司要求博纳西亚公司","现我公司要求京乐福祥公司","故我公司请求法院判令解除双方的,要求恩氏","现我公司要求京东电子商务公司:","故我诉至法院请求判令玻艺坊公司","故我诉至法院请求判令玻艺","故我公司要求酷溜网","现我公司诉至法院请求判令金领艺","为此,我公司诉至法院,请求确认我公司","故我诉至法院请求解除我与大众文艺","我公司要求麦德龙京顺路商场:","故我诉至法院请求判令撤销","故我诉至法院请求撤销我与水晶","现我公司要求周宝柱和万仝旭日公司:","现意林杂志社、杜务请求法院判令海南出版公司、盛世金图公司:","故我公司要求我乐公司和千钧公司:","故我公司要求我乐公司和千钧公司:","我公司要求恒德众宇公司:","特向法院提起诉讼,请求法院作出以下判决:","故诉请要求:","原告特向法院提起诉讼,并当庭明确如下诉讼请求：","故我现要求解除双方签订的,要求","故我请求法院解除双方签订的,并要求","现我公司要求三度空间公司","故我公司起诉要求指云时代公司:","因此,我公司诉至法院,请求","故我公司要求珍审合美公司朝阳水椎子店:","故我公司现要求少儿出版社公司、家乐福公司:","现我要求海鹰国信公司继续履行合同","现我公司要求尊尚壁公司:","故我公司要求瑞联文众公司:","故我公司要求任游网络公司:","故我公司现请求法院判令樊榕公司向","故我要求中国文联出版社","故我公司要求山合水易公司、要雁峥和郭帆:","我公司要求酷溜网公司立即停止侵权行为","故我公司要求北京盛世通公司停止","故我公司要求旅游卫视公司向我公司赔偿","故我公司要求旅游卫视公司向我公司赔偿","故我请求法院判令解除双方签订的,并要求","我请求法院解除双方签订的,要求大雄义谨公司","我请求法院判令解除双方签订的,并要求","故我公司要求华普公司立即停止","故我公司要求飘亮购物中心立即","故我公司要求洁美捷公司立即","故我公司要求华普公司立即","我公司要求阿里云公司和阿里巴巴公司:","故我公司现要求恩迪安达公司:","故我公司请求法院判令农业出版社:","诉请人民法院依法判令1.","原告特向法院提起诉讼,并当庭明确如下诉讼请求：","特向法院提起诉讼,请求法院作出以下判决:","原告特诉至人民法院,请求人民法院判决如下:","特向法院提起诉讼,请求法院作出以下判决:","原告特诉至人民法院,请求人民法院判决如下:","原告特诉至人民法院,请求人民法院判决如下:","原告特向法院提起诉讼,并当庭明确如下诉讼请求：","故请求人民法院依法判处被告:","原告提起诉讼,请求判令：","原告诉请法院判令被告:","故诉至本院,请求判令被告：","现诉至本院,要求判令两被告：","特提起诉讼,请求法院:","请求法院依法判令两被告:","据此,原告诉请判令两被告:","原告提起诉讼,请求判令：","特提起诉讼,请求法院:","据此,原告诉请判令两被告:","据此请求法院依法判决:","请求法院依法判令两被告:","故请求人民法院依法判处被告:","请求法院依法判令两被告:","故请求人民法院依法判处被告:","原告诉请法院判令被告:","特诉至本院,请求本院判令:","故诉至法院,诉讼请求：","特提起诉讼,请求法院:","特诉至本院,请求本院判令:","故诉至法院,诉讼请求：","故诉至本院,请求判令被告：","现诉至本院,要求判令两被告：","诉请人民法院依法判令1.","诉请人民法院依法判令1.","故诉至本院,请求判令被告：","现诉至本院,要求判令两被告：","据此,原告诉请判令两被告:","据此,原告诉请判令:","据此,原告诉请判令:","为此请求判令被告:","现起诉请求法院判令:","为此,诉请法院判令:","据此请求法院依法判决:","为此请求判令被告:","现起诉请求法院判令:","为此,诉请法院判令:","特诉至本院,请求本院判令:","故诉至法院,诉讼请求：","诉请人民法院依法判令1.","诉请人民法院依法判令1.","原告诉请法院判令被告:","原告提起诉讼,请求判令：","原告请求法院判决：","请求本院判令:","故起诉要求判令:","综上,请求法院:","故请求判令被告:","请求法院判决：","请求法院判令:1、","诉请判令:1.","请求法院判令:1","故请求依法判令:1、","请求依法判令被告：","特提起诉讼,请求：","请求：判令被告","请求法院判决：","为此,请求法院:","请求法院判令:","故请求判令被告:","请求判令两被告:1、","请贵院依法判令:","原告诉请判决被告:","故恳请法院:","请求法院判决：","原告请求法院判决：","请求本院判令:","故起诉要求判令:","综上,请求法院:","请求法院判令:1、","请求法院判令:1","故请求依法判令:1、","请求判决:1.","请求依法判令被告：","特提起诉讼,请求：","请求：判令被告","为此,请求法院:","据此,原告诉请判令:","特请求本院:","据此请求法院依法判决:","为此请求判令被告:","现起诉请求法院判令:","为此,诉请法院判令:","请求法院判令:","故请求判令被告:","请求判令两被告:1、","请贵院依法判令:","原告诉请判决被告:","故恳请法院:","请求本院判令:","故起诉要求判令:","综上,请求法院:","请求法院判令:1、","诉请判令:1.","请求法院判令:1","故请求依法判令:1、","请求判决:1.","请求依法判令被告：","特提起诉讼,请求：","请求：判令被告","为此,请求法院:","特请求本院:","请求法院判令:","请求判令两被告:1、","请贵院依法判令:","原告诉请判决被告:","故恳请法院:","特请求本院:","故原告向法院提起诉讼,请求判令：","我公司现请求法院判令霖林木公司:","故请求依法判令:","要求:1、被告停止侵权","要求：1、判令被告","原告诉至法院：","请求法院判令三基公司:","请求法院判令三基公司：","故提起诉讼:","原告微软公司诉请本院判令:","为此,特诉请人民法院:","为此,洪太公司诉请:","特请求法院判令二被告:","请求依照我国《民法通则》、《商标法》、《反不正当竞争法》等相关法律判令:","请求判令熔盛公司:","请求人民法院:","诉至法院,请求判定被告:","请求法院判处被告:","请求法院判处：","特提起诉讼,请求:","请求人民法院:","原告起诉请求法院判令:","请求判令1、","请求判令特惠美公司:","故起诉请求法院判令:","起诉要求判决：","故诉请判决:","为此,原告诉至法院,请求被告","综上,请求法院判令永迎公司:","据此,亚希公司诉请本院判令安俊宇:","据此,罗重恩诉请本院判令郑若刚:","据此,鲜琦诉请本院判令张艺谋:","据此,请求法院判令新世界科技公司:","综上,请求法院判令各被告:","综上,李思敏请求人民法院依法查明事实,判令:","现诉至法院,要求搜狐公司:","汉王公司请求本院判令:","现原告特诉至法院,诉讼请求如下:","诉讼请求如下:","故起诉要求法院判令：","向本院提出诉讼请求:","提出诉讼请求:","综上,请求法院判令泰金联公司","请求法院判令窦琴芬:","遂起诉法院要求判决:","原告据此请求本院判决","我公司要求迈视传媒公司:","综上,师爱琴请求法院判令","综上,原告请求人民法院判决","现起诉要求法院依法判决：","请求判令四被告:","我要求云端公司","请求判令两名被告：","故起诉至法院要求：","请求人民法院判决:","故我要求华动飞天公司:","故我要求创盟音乐公司、华动飞天公司:","故提起诉讼,诉请被告：","现原告向法院提起诉讼,请求判令","故要求：","向本院起诉,请求判令:","特起诉至法院,要求判令两被告:","诉至法院,请求判令：","请求本院判令：","原告要求法院:","故诉诸法院,要求:","故起诉,要求:","故请求本院判令:","两原告请求判令：","故原告请求本院判令:","原告依法诉至法院,要求判令四被告：","故起诉,要求","原告诉至法院请求","原告起诉要求:","故原告提起诉讼,要求法院判令被告:","起诉要求：","特向贵院提起诉讼,请求：","请求:","故诉诸法院,请求判令被告","现起诉,要求","故原告双盾公司诉请:","请法院支持原告的诉讼请求,判令确认被告","故提起诉讼,要求二被告:","故原告诉至法院,要求被告","原告起诉要求,","故向法院起诉,请求判令被告","要求判令：","现诉请:","故诉至法院,要求中国惠普","原告要求法院判令：","请求判令:","故请求法院判令被告光明日报社:","要求判令被告:","原告起诉至法院,要求","故原告诉至法院,请求判令被告","原告起诉要求被告","故请求法院求判令：","原告诉至本院,要求判令：","原告起诉至法院,要求：","故起诉至法院,要求判令：","诉至法院,要求","原告起诉,要求","据此,请求判决：","故原告起诉至法院,要求判令：","诉至法院,请求判令:","故原告请求判令被告:","东软公司请求本院判令:","同星公司请求本院判令:","请求人民法院：","维蒂亚公司请求本院判令:","原告请求本院判令:","故原告请求判令被告:","故原告起诉要求：","特提起诉讼,要求判令:","原告要求法院：","请求法院判令:","故起诉,要求判令两被告：","特请求法院判令二被告:","为此,原告依法向贵院起诉,","故诉讼法院判令:","故要求判令四被告：","原告依法诉至法院,要求法院判决：","故原告起诉要求：","现原告诉至本院,要求判令：","原告诉至法院,要求判令：","故原告诉至本院,要求判令：","原告起诉要求：","原告遂起诉,要求判令","故要求判令：","故起诉,要求：","故要求判令：","故原告诉至本院,要求判令：","请求法院：","故原告起诉要求："," 请求判决:","原告神仆公司诉请判令","原告上海家化公司诉请判令：","诉至法院,请求:","故原告起诉要求：","故原告提起诉讼,要求:","故诉请本院判令","故起诉,要求三被告","故请求法院判令：","请求人民法院依法判令被告：","故原告诉至法院,请求判令被告","诉至人民法院,请求判令被告","故诉至法院,请求判令:","故我诉至法院请求判令解除双方之间达成的纪录片制作口头协议","现诉至法院要求:","请求人民法院依法判令","诉至法院,请求依法判令","请求人民法院依法判令:","特诉请法院判令两被告:","故诉诸法院,请求判令:","诉至法院,请求判令","为此,请求法院判令","请求依法判令三被告","因此请求法院依法判令","诉请法院依法判令被告:","诉请法院依法判令","诉至法院要求判令:","向法院提起诉讼,诉请:","请求判令交隧集团:","故我诉至法院,要求","现我协会提起诉讼","故我公司诉至法院","请求法院依法判令被告","请求人民法院判令","请贵院依法判决:","请求法院依法判令:","依法判令被告:","诉请人民法院判令","请求本院判令被告","故起诉,请求法院判令：","为此,原告起诉至法院要求：","请求人民法院判令三被告:","故诉至法院,请求判令书生公司:","原告请求本院判令两被告:","原告项百平起诉称:","原告康可公司起诉称:","故我公司诉至法院,请求判令","要求法院：","故原告诉至法院,请求判令被告","故起诉至法院,请求判令","我公司起诉至法院,请求判令","故我公司起诉至法院,请求判令","请求判令被告金三力公司:","向贵院提起诉讼,要求判令:","请求法院依法判令被告：","我要求网高网络公司","故我诉至法院,请求判令","故诉求法院判令被告","故我公司诉至法院,请求法院判令","故请求判令：","请求人民法院判令三被告","诉请判令被告泰格网吧","故原告诉请法院判令","故原告请求法院判令","故诉请法院要求判令被告：","原告请求法院判令被告:","原告诉请:","请求1、","为此向贵院提起诉讼","故诉至法院,请求判令","请求判令被告：","诉至法院,请求法院判令","诉请法院依法判令被告","请求法院判决:","故诉至法院请求判令:","原告请求判令:","请求法院判令被告:","诉请：","请求本院判令两被告","故起诉请求判令：","诉请本院判令：","请求法院判令：","提出诉讼请求:","故诉请法院判令：","原告请求法院判令：","故请求本院判令：","故起诉来院,要求两被告","原告请求法院判令","原告请求法院","诉请法院判令被告","故请求法院判令","诉至法院,请求判令 ","诉请判令被告:","请求法院判令被告","原告请求判令两被告","特向法院提起诉讼请求","现诉至法院,请求判令","故请求法院判令:","故诉至贵院要求判令","故诉请法院判令","请求法院判令二被告:","故提起诉讼,要求被告","据此,请求法院判令","故请求人民法院判令","请求人民法院判令:","请求法院判令二被告：","请求法院依法调解或判决", "诉至本院,请求判令被告: ","诉至本院,请求判令:","故原告诉请判令:","故请求法院:","现起诉要求","原告请求判令被告","请求法院判令二被告","请求依法判令被告:","故原告起诉请求:","诉请法院判令","请求判令被告:","请求判令:","请求依法判令:","提出诉讼请求:","原告诉讼请求:","起诉请求判令:","诉讼请求:","诉请判令:","原告现诉请:","请求判令被告","要求判令:","故此,请求判令,","现请求:","综上,诉请:","依法向贵院提起诉讼,请求贵院依法判决","故原告要求法院：","故原告要求：","两原告请求本院判令：","请求本院：","请求法院判令:","请求判令两被告:1、","请贵院依法判令:","原告诉请判决被告:","故恳请法院:","特请求本院:","诉请判令:1.","请求判决:1.","请求贵院:","要求判令:","请求贵院:","起诉要求:","请求贵院:","请求判令：","要求判令:","要求判令:","起诉要求:","起诉要求:","请求判令：","特提起诉讼,请求法院","请求判令三被告",",请求判令两被告","请求法院依法判令被告","故诉至法院请求判令","现要求二被告","请求判令两被告:","据此,要求：","诉请法院判决：","判令路慧向","请法院依法判令","请求判决:","起诉要求:","请求法院判令:","诉至法院判令:","诉请法院判令:","故起诉请求:","请求判令五被告停止","起诉请求判令","请法院判令","故诉至法院","依法判决:","请求判令停止侵权","故我起诉要求","故起诉要求:","请求判令：","请求依法判令","原告请求法院：","要求判令被告","原告请求:","请求法院依法判令","请求法院:","故请求判令:","原告起诉要求:","提起诉讼请求:","请求法院判令三基公司：",",故起诉：","请求判决被告","请求法院判令三被告","故请求:","请求判令七被告","诉请判令被告赔偿","请求法院判决","请法院判决","请求判令三被告:","特请求法院判令","故诉请法院:","请求法院判令被告支付我","遂向本院提起诉讼,请求判令被告","故诉请判令","故请求法院判令：","我协会提起诉讼","特请求法院：","请贵院依法判决","依法判令被告","诉至法院要求","诉请法院判决","故起诉要求","起诉称:","要求被告：","请求:","请求判决:","现我公司要求","请求法院判令","判令:","请求本院判决","判令二被告","请求本院判令","故我公司要求","我社起诉要求","故原告诉请:","请求判令,二被告支付","请求判令两被告","请法院依法判决","请求判令两被告","请求判令美盛公司","要求法院判令","原告张小泉公司诉称,","原告网尚公司诉称:","请求判令两被告","判令高从武","据此,原告凯摩高公司诉求:","据此,原告农友公司诉求:","原告特诉至法院,请求法院确认","故原告要求四被告","故向人民法院提起诉讼,请求法院依法确认","请求法院.*判令","我协会要求","依法判令:","要求判令：","故起诉至法院,要求","故原告请求判令","请求我院判令两被告","请求：","故要求,","故原告为维护合法权益,诉请判令：","故我诉至法院请求判令中教星中心支付","故我公司请求法院判令易廷公司、中视泽一艺术中心和无限界公司:","起诉请求被告","故请求1、","故诉清法院判令被告","为此,诉请判令被告","判令被告:","请求判决","依法判决","请求判令停止","要求判令","起诉请求","故起诉：","故请求:","故我中心诉至法院,要求","据此,请求法院判令两被告","故诉清法院判令被告","故我们六人诉至法院,要求","故我社诉至法院,要求","故我工作室诉至法院,要求","特提起民事诉讼,要求新浪公司","现要求","请求判令,二被告支付","依法判令","判令被告","起诉要求","请求如下","诉请判令","请求判令","现起诉","原告请求","故起诉请求","故请求法院","故请求判令","起诉称","要求法院","判令：","要求被告","两被告:","两被告：","故原告诉请被告","现诉至法院,要求判决","请求法院确认原告","特诉至法院,请求","原告要求","故起诉","故我要求","故我社要求","故要求,","故诉至本院请求确认","故请求本院依法确认","原告兴发公司诉请:","请求确认","故我们二人诉至法院,要求","故我协会诉至法院,要求","我公司现诉至法院,要求","故我社诉至法院,要求","诉称:","故,我要求","现我再次起诉,要求",",故要求","判令:","故我诉至法院,请求",",我要求作家出版社","综上,天津神宁生物公司认为北京神宁科贸公司、北京圣安百草生物公司和陈如刚构成不正当竞争,要求","故,我公司要求","请求人民法院判决","故要求三七二一公司按照我公司的声明要求","故诉请法院,判令","因此我公司起诉,要求","因此我公司起诉,要求","故诉请:","故我公司起诉,要求","故请求被告支付","现我要求","请求刘长","判令马从凤","判令鑫陆玩具店","特诉至法院,请依法判处被告","请求依法判另1、","诉讼请求","并判令","诉请","故原告","诉称,"]
        reg = "[零0〇壹1一贰2两二貮叁3三肆4四伍5五陆6六柒7七捌8八玖9九,\.兆亿億萬万仟千佰百十拾]{1,16}[元圆]{,1}[零0〇壹1一贰2两二貮叁3三肆4四伍5五陆6六柒7七捌8八玖9九角分里厘毫万]{0,9}[元角分里厘毫]{1}"
        x=pre_regular(content)##前期的规范化处理
        x=re.sub("[一二三四五六七八九十壹贰叁肆伍陆柒捌玖]{1}[元分厘]{1}公司","xx公司",x,flags=re.S)
        reg0="(0\.[0-9]+)(万元)"
        x=re.sub(reg0,lambda t :str(round(float(t.group(1))*10000,3))+"元",x)
        x=re.sub("((人民币|经济损失|合理支出|合理费用|律师费)[0-9]+/.{,1}[0-9]*)([^0-9元]{1})",lambda t: t.group(1)+"元",x)
        x=re.sub(reg,cn2dig,x)
        reg0="(人民币[0-9/.]+)([^0-9/.元])"
        x=re.sub(reg0,lambda t: t.group(1)+"元",x)
        x=deal_money(x)###美元处理数据的问题
        x=deal_dollars(x)###处理美元
        x=Add_money(x)####添加元
        x=cut_(x)
        x1=match_multi_word(k,x)
        x1.replace(":","：")
        #print("match_multi_word:")
        #x1=Remove(x1)
        #print("Remove之后的"+x1)
        #print("Remove数据的条数："+x1)
        x1=DeleteRepeat(x1)
        x1=Deal_responsible(x1)
        x=Deal_interest(x1)####除掉一些利息的混乱的赘余信息
        x=ClaimStander(x)###规范文书中的一些问题
        x=Deletesp(x)####除中括号的一些赘
        x=Delsp(x) ####括号去重的问题
        x=Trans(x)###小数点的恢复
        money=Mycount_(x)
        return money
    content=i[2][2]+i[3][2]
    money=Main_Money_law_suit(content)
    return money
#?:?::  (要没有变更的。。。？？？这个怎么进行修改)诉讼请求为
#m= MainLawsuit1(L)
