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 Utopia or Dystopia - On Securing AI Platforms
Dystopia_API:反乌托邦API的所在地。 有关更多信息,请参见README.txt。
通过透明方式在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 ...
大都会2127 一个反乌托邦的城市建设游戏,以弗里茨·朗 1927 年的电影为主题。 用 JavaScript 编写。 没有库,没有框架,没有引擎。 纯JS。 内容提要:在地上建造一个乌托邦式的城市,同时使工人的健康和活力保持...