Skip to content

Commit f3a946a

Browse files
committed
Added some samples for datrie
1 parent 7701b9d commit f3a946a

File tree

5 files changed

+67
-0
lines changed

5 files changed

+67
-0
lines changed

LICENSES/Unlicense.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Unlicense (Public Domain)
2+
============================
3+
4+
This is free and unencumbered software released into the public domain.
5+
6+
Anyone is free to copy, modify, publish, use, compile, sell, or
7+
distribute this software, either in source code form or as a compiled
8+
binary, for any purpose, commercial or non-commercial, and by any
9+
means.
10+
11+
In jurisdictions that recognize copyright laws, the author or authors
12+
of this software dedicate any and all copyright interest in the
13+
software to the public domain. We make this dedication for the benefit
14+
of the public at large and to the detriment of our heirs and
15+
successors. We intend this dedication to be an overt act of
16+
relinquishment in perpetuity of all present and future rights to this
17+
software under copyright law.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25+
OTHER DEALINGS IN THE SOFTWARE.
26+
27+
For more information, please refer to &lt;<https://unlicense.org/>&gt;

database/datrie/ReadMe.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--
2+
SPDX-FileCopyrightText: KOLANICH, 2021
3+
SPDX-License-Identifier: Unlicense
4+
-->
5+
6+
datrie
7+
======
8+
9+
Samples of file format used by [`libdatrie`](https://github.com/tlwg/libdatrie) for serialization.
10+
11+
Source: own work.

database/datrie/generate.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python3
2+
3+
from pathlib import Path
4+
5+
import datrie
6+
7+
__license__ = "Unlicense"
8+
__copyright__ = "KOLANICH, 2021"
9+
10+
11+
thisDir = Path(__file__).parent()
12+
13+
14+
def main():
15+
t = datrie.BaseTrie(ranges=(("a", "z"),))
16+
t["a"] = 1
17+
t["ab"] = 2
18+
t["ac"] = 3
19+
t["abd"] = 4
20+
t["abe"] = 5
21+
t["acf"] = 6
22+
t["acg"] = 7
23+
t.save(str(thisDir / "test.datrie"))
24+
25+
26+
if __name__ == "__main__":
27+
main()

database/datrie/test.datrie

226 Bytes
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: KOLANICH, 2021
2+
SPDX-License-Identifier: Unlicense

0 commit comments

Comments
 (0)