Exemplo n.º 1
0
    void GetPersonList()
    {
        //交易对象
        var rtn = new List <(string TargetCompany, string TradeCompany)>();

        TradeCompany.IsRequire = true;
        var Rules = new List <TableSearchTitleRule>();

        Rules.Add(TradeCompany);
        var opt = new HTMLTable.SearchOption();

        opt.IsMeger           = true;
        opt.IsContainTotalRow = true;
        var result = HTMLTable.GetMultiInfoByTitleRules(root, Rules, opt);

        if (result.Count != 0)
        {
            //首页表格提取出交易者列表
            var tableid = result[0][0].TableId;
            //注意:由于表格检索的问题,这里只将第一个表格的内容作为依据
            //交易对方是释义表的一个项目,这里被错误识别为表头
            //TODO:这里交易对方应该只选取文章前部的表格!!
            var TableTrades = result.Where(z => !ExplainTableId.Contains(z[0].TableId))
                              .Select(x => x[0].RawData)
                              .Where(y => !y.Contains("不超过")).ToList();
            PersonList.AddRange(TableTrades);
        }

        foreach (var e in ExplainDict)
        {
            if (e.Value.Contains("自然人"))
            {
                var PersonArray = e.Value.Split(Utility.SplitChar);
                foreach (var person in PersonArray)
                {
                    if (person.Contains("等") || person.Contains("自然人"))
                    {
                        var trimPerson = person;
                        if (trimPerson.Contains("等"))
                        {
                            trimPerson = Utility.GetStringBefore(trimPerson, "等");
                        }
                        if (trimPerson.Contains("自然人"))
                        {
                            trimPerson = Utility.GetStringBefore(trimPerson, "自然人");
                        }
                        PersonList.Add(trimPerson);
                    }
                    else
                    {
                        PersonList.Add(person);
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 交易对方
    /// </summary>
    /// <returns></returns>
    public List <string> getTradeCompany(ReorganizationRec target)
    {
        var rtn = new List <string>();

        TradeCompany.IsRequire = true;
        var Rules = new List <TableSearchTitleRule>();

        Rules.Add(TradeCompany);
        var opt = new HTMLTable.SearchOption();

        opt.IsMeger = true;
        var result = HTMLTable.GetMultiInfoByTitleRules(root, Rules, opt);

        if (result.Count == 0)
        {
            return(rtn);
        }
        //首页表格提取出交易者列表
        var tableid = result[0][0].TableId;
        //注意:由于表格检索的问题,这里只将第一个表格的内容作为依据
        //交易对方是释义表的一个项目,这里被错误识别为表头
        //TODO:这里交易对方应该只选取文章前部的表格!!
        var TableTrades = result.Where(z => !ExplainTableId.Contains(z[0].TableId))
                          .Select(x => x[0].RawData)
                          .Where(y => !y.Contains("不超过")).ToList();
        var TargetLoc = LocateProperty.LocateCustomerWord(root, new string[] { target.TargetCompanyFullName, target.TargetCompanyShortName }.ToList(), "标的");
        var HolderLoc = LocateProperty.LocateCustomerWord(root, new string[] { "持有", "所持" }.ToList(), "持有");
        var OwnerLoc  = LocateProperty.LocateCustomerWord(root, TableTrades.ToList(), "交易对手");

        CustomerList.AddRange(TargetLoc);
        CustomerList.AddRange(HolderLoc);
        CustomerList.AddRange(OwnerLoc);
        nermap.Anlayze(this);
        foreach (var nerlist in nermap.ParagraghlocateDict.Values)
        {
            //交易对手 持有 标的 这样的文字检索
            int OwnerIdx  = -1;
            int HolderIdx = -1;
            int TargetIdx = -1;
            nerlist.CustomerList.Sort((x, y) => { return(x.StartIdx.CompareTo(y.StartIdx)); });
            var OwnerName = string.Empty;
            foreach (var ner in nerlist.CustomerList)
            {
                if (ner.Description == "交易对手")
                {
                    OwnerIdx  = ner.StartIdx;
                    OwnerName = ner.Value;
                }
                if (ner.Description == "持有" && OwnerIdx != -1)
                {
                    HolderIdx = ner.StartIdx;
                }
                if (ner.Description == "标的" && OwnerIdx != -1 && HolderIdx != -1)
                {
                    TargetIdx = ner.StartIdx;
                }
                if (OwnerIdx != -1 && HolderIdx != -1 && TargetIdx != -1)
                {
                    if (TargetIdx - OwnerIdx < 20)
                    {
                        rtn.Add(OwnerName);
                    }
                    OwnerIdx  = -1;
                    HolderIdx = -1;
                    TargetIdx = -1;
                }
            }
        }
        return(rtn.Distinct().ToList());
    }