예제 #1
0
파일: NerMap.cs 프로젝트: lxxwin/FDDC
    /// <summary>
    /// 每句句子中,各种实体的聚合
    /// </summary>
    /// <param name="PosId"></param>
    /// <returns></returns>
    ParagraghLoc LocateParagraphInfo(AnnouceDocument doc, int PosId, List <LocAndValue <String> > nerList)
    {
        var paragragh = new ParagraghLoc();

        paragragh.Init();
        foreach (var item in doc.datelist)
        {
            if (item.Loc == PosId)
            {
                paragragh.datelist.Add(item);
            }
        }
        foreach (var item in doc.moneylist)
        {
            if (item.Loc == PosId)
            {
                paragragh.moneylist.Add(item);
            }
        }
        foreach (var item in doc.quotationList)
        {
            if (item.Loc == PosId)
            {
                paragragh.NerList.Add(item);
            }
        }
        foreach (var item in nerList)
        {
            if (item.Loc == PosId)
            {
                paragragh.NerList.Add(item);
            }
        }

        return(paragragh);
    }
예제 #2
0
파일: NerMap.cs 프로젝트: loooo139/gradute
    /// <summary>
    /// 每句句子中,各种实体的聚合
    /// </summary>
    /// <param name="PosId"></param>
    /// <returns></returns>
    ParagraghLoc LocateParagraphInfo(AnnouceDocument doc, int PosId, List <LocAndValue <String> > nerList)
    {
        var paragragh = new ParagraghLoc();

        paragragh.Init();
        foreach (var item in doc.datelist)
        {
            if (item.Loc == PosId)
            {
                paragragh.datelist.Add(item);
            }
        }
        foreach (var item in doc.moneylist)
        {
            if (item.Loc == PosId)
            {
                paragragh.moneylist.Add(item);
            }
        }
        foreach (var item in doc.percentList)
        {
            if (item.Loc == PosId)
            {
                paragragh.percentList.Add(item);
            }
        }
        foreach (var item in doc.StockNumberList)
        {
            if (item.Loc == PosId)
            {
                paragragh.socketNumberList.Add(item);
            }
        }
        foreach (var item in doc.CustomerList)
        {
            if (item.Loc == PosId)
            {
                paragragh.CustomerList.Add(item);                       //加入CustomerList为了代码方便
            }
            if (item.Loc == PosId)
            {
                paragragh.NerList.Add(item);                            //加入NerList为了查找方法
            }
        }
        foreach (var item in doc.quotationList)
        {
            if (item.Loc == PosId)
            {
                paragragh.NerList.Add(item);
            }
        }
        foreach (var item in nerList)
        {
            if (item.Loc == PosId)
            {
                paragragh.NerList.Add(item);
            }
        }
        paragragh.NerList.Sort((x, y) => { return(x.StartIdx.CompareTo(y.StartIdx)); });
        return(paragragh);
    }