text2xml.py 文件源码

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

项目:lawsofindia 作者: sushant354 项目源码 文件源码
def main(infile, outfile, loghandle):
    inhandle  = codecs.open(infile, 'r', 'utf8')
    outhandle = codecs.open(outfile, 'w', 'utf8')

    text      = inhandle.read()
    inhandle.close()
    tokenizer = lex.lex(optimize=0, module = actrules)
    #lex.input(text)
    parser    = yacc.yacc(module = actrules)
    xmlact    = parser.parse(input = text, lexer = tokenizer)

    final_xml = arrange_sections.main(xmlact, loghandle)

    outhandle.write(final_xml)
    outhandle.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号