本文整理汇总了Python中pykt.KyotoTycoon.match_prefix方法的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon.match_prefix方法的具体用法?Python KyotoTycoon.match_prefix怎么用?Python KyotoTycoon.match_prefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykt.KyotoTycoon
的用法示例。
在下文中一共展示了KyotoTycoon.match_prefix方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_prefix_notfound
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import match_prefix [as 别名]
def test_prefix_notfound():
db = KyotoTycoon()
db = db.open()
db.set("BC", "B")
db.set("C", "B")
ret = db.match_prefix("A")
ok_(ret == ())
db.close()
示例2: test_match_prefix_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import match_prefix [as 别名]
def test_match_prefix_utf8():
db = KyotoTycoon()
db = db.open()
db.set("あいうえお", "B")
db.set("BC", "B")
db.set("C", "B")
ret = db.match_prefix("あいう")
ok_(ret == ("あいうえお", ) )
db.close()
示例3: test_match_prefix_with_db
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import match_prefix [as 别名]
def test_match_prefix_with_db():
db = KyotoTycoon("test")
db = db.open()
db.set("ABC", "B")
db.set("BC", "B")
db.set("C", "B")
ret = db.match_prefix("A")
ok_(ret == ["ABC"])
db.close()
示例4: test_match_prefix2
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import match_prefix [as 别名]
def test_match_prefix2():
db = KyotoTycoon()
db = db.open()
db.set("ABC", "B")
db.set("AAA", "B")
db.set("C", "B")
ret = db.match_prefix("A")
ok_(ret == ("AAA", "ABC"))
db.close()
示例5: test_err_prefix
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import match_prefix [as 别名]
def test_err_prefix():
db = KyotoTycoon()
ret = db.match_prefix("A")