Skip to content

Commit cb72516

Browse files
Initial commit
0 parents  commit cb72516

5 files changed

Lines changed: 92 additions & 0 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Cheesecake
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# tooth-python
2+
`tooth-python` is a very basic library that allows you to generate text with basic functions.
3+
4+
# How to use
5+
```python
6+
from tooth import Tooth # Importing `Tooth` class
7+
8+
tooth = Tooth()
9+
10+
tooth.generate("Hello") # Returns 'Toothハ'
11+
```

__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .main import Tooth
2+
3+
__version__ = "0.1.0"

main.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import random
2+
3+
VOCABULARY = [
4+
"は", "ハ", "歯",
5+
"Tooth", "Teeth",
6+
"🦷"
7+
]
8+
9+
class Tooth:
10+
def __init__(self, vocab: list[str] = VOCABULARY):
11+
self.vocab = vocab
12+
self.memory: list[str] = []
13+
14+
@property
15+
def seed(self):
16+
return "".join(self.memory)
17+
18+
def generate(self, input: str) -> str:
19+
self.memory.append(input)
20+
21+
random.seed(self.seed)
22+
23+
input_length = len(input)
24+
result_length = random.randint(input_length // 2, input_length * 2)
25+
26+
result_list = []
27+
28+
for i in range(result_length):
29+
result_list.append(random.choice(self.vocab))
30+
31+
result_text = "".join(result_list)
32+
self.memory.append(result_text)
33+
return result_text

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[build-system]
2+
requires = ["setuptools >= 77.0.3"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "tooth-python"
7+
version = "0.1.0"
8+
9+
requires-python = ">= 3.8"
10+
maintainers = [
11+
{name = "Cheesecake2960"}
12+
]
13+
description = "Generating text."
14+
readme = "README.md"
15+
license = "MIT"
16+
license-files = ["LICEN[CS]E.*"]
17+
keywords = ["generate", "tooth"]
18+
classifiers = [
19+
"Programming Language :: Python"
20+
]
21+
22+
[project.urls]
23+
Repository = "https://github.com/Cheesecake2960/tooth.git"
24+
Issues = "https://github.com/Cheesecake2960/tooth/issues"

0 commit comments

Comments
 (0)