test_spelling.py 文件源码

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

项目:zippy 作者: securesystemslab 项目源码 文件源码
def test_very_long_words():
    import sys
    length = int(sys.getrecursionlimit() * 1.5)

    strings1 = [u(chr(i) * length) for i in range(65, 70)]
    strings2 = [u(chr(i) * length) for i in range(71, 75)]

    ana = analysis.StemmingAnalyzer()
    schema = fields.Schema(text=fields.TEXT(analyzer=ana, spelling=True))
    ix = RamStorage().create_index(schema)
    with ix.writer() as w:
        for string in strings1:
            w.add_document(text=string)

    with ix.writer() as w:
        for string in strings2:
            w.add_document(text=string)
        w.optimize = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号