docompare.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:office-interoperability-tools 作者: milossramek 项目源码 文件源码
def mergeLocation(tx0, sp0, tx1, sp1):
    """
    find merge location in (tx0,sp0)
    """
    if len(tx0) < 2: 
        return 9999
    txmin=min( np.array(tx0)[:,1] ) # minimal line heigh, used as detection threshold
    txx=[]
    for i in range(min(len(tx0)-1,len(tx1))):
        tx=tx0[i][1] + sp0[i][1] + tx0[i+1][1]
        txx.append(tx - tx1[i][1])
    cc = np.argmin(txx)
    if txx[cc] < txmin/3: #expected to be near 0
        return cc
    else:
        return 9999
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号