http://d.hatena.ne.jp/perezvon/20080921/1222016246
>>> from tokyodystopia import TokyoDystopia
>>> db = TokyoDystopia("/tmp/test.db", 255)
>>> db.put(0, u"仙台".encode("utf8"), " ")
1
>>> db.put(1, u"仙台 広島".encode("utf8"), " ")
1
>>> db.put(2, u"広島 山形 湘南 山形".encode("utf8"), " ")
1
>>> db.search(u"仙台".encode("utf-8"))
2
[0L, 1L]
>>> db.search(u"広島".encode("utf-8"))
2
[1L, 2L]
>> db.close()
The function `tcidbsearch2' searches with a compound expression. In the compound expression, tokens are separated by one or more white space characters. If one token is specified, records including the specified pattern are searched for. Upper or lower case is not distinguished. Accent marks and diacritical marks are ignored. If two or more tokens are specified, records including all of the patterns are searched for. The compound expression includes the following sub expressions.
* A B : searches for records including the two tokens.
* A && B : searches for records including the two tokens.
* A || B : searches for records including the one or both of the two tokens.
* "A B..." : searches for records including the phrase.
* [A] : searches for records including words exactly matching the token.
* [A*] : searches for records including words beginning with the token.
* [*A] : searches for records including words ending with the token.
* [[A : searches for records beginning with the token.
* A]] : searches for records ending with the token.
Note that the priority of "||" is higher than the one of "&&".
分享到:
相关推荐
AI技术的普及和应用已经成为工业和社会中的一个主要趋势。随着AI从最初的支持技术演变为关键技术,它在过去的几十年中取代了各种既定的标准做法,并已经完全融入了工业流程。然而,随着AI算法在各种计算平台上的广泛...
《Dystopia_API:探索反乌托邦世界的编程接口》 在数字世界中,API(应用程序接口)扮演着连接不同软件系统的关键角色。"Dystopia_API"这个名字,虽然听起来带有悲观色彩,实际上是一个用于构建特定场景或应用的...
通过透明方式在Internet上匿名反乌托邦旨在通过透明的方式在互联网世界上实现匿名。 它以启发的原始协议实现洋葱路由。 反乌托邦处于超级超级超级早期阶段。 任何反馈或贡献都非常欢迎!文件资料对于用户对于开发...
Because real life is a Dystopia Website https://orwall.org/ What's this? orWall will force selected applications through Orbot while preventing unchecked applications to have network access. In order ...
It was first published in 1949 and is one of the representative works of dystopia.The work portrays the survival state of humanity in a totalitarian society. The dictator takes the pursuit of power ...
另一方面,也可能导致“机器人反乌托邦”(Robot Dystopia),即机器人取代人类劳动,造成社会结构的剧变和不稳定。 3. 平衡“黑箱”推理:课程强调必须避免对未来科技发展进行“黑箱”推理,即基于不透明或未充分...
10. 如何看待未来:报告可能还试图讨论如何将对话从对科技的消极看法(dystopia)转变为更现实和积极的视角(present in the now most construct),这表明报告旨在提倡一种更加平衡和现实主义的未来观点。...
大都会2127 一个反乌托邦的城市建设游戏,以弗里茨·朗 1927 年的电影为主题。 用 JavaScript 编写。 没有库,没有框架,没有引擎。 纯JS。 内容提要:在地上建造一个乌托邦式的城市,同时使工人的健康和活力保持...