Conj
Python conjugation module for Turkish
Install / Use
/learn @halilkaya/ConjREADME
conj
Python conjugation module for Turkish.
Installation
$ pip install conj
Usage Example
from conj import conj
print(conj('İstanbul', True, 'den')) # output: İstanbul'dan
print(conj('Muş', True, 'de')) # output: Muş'ta
# -----------------------------------------------------------
import random
title = "%(name)s %(punishment)s şoku"
names = ['Guido', 'Merkel', 'Voyvoda']
punishments = ['Hapis', 'Kazık']
print title % {
"name": conj(random.choice(names), True, 'e'),
"punishment": random.choice(punishments)
}
# output: Guido'ya hapis şoku
# output: Merkel'e hapis şoku
# output: Voyvodo'ya kazık şoku
Supported Python Versions
- python 3
- python 2
- pypy3
- pypy
Running Tests
To run tests, you have to install unittest first:
$ pip install unittest
Then, just run tests.py:
$ python tests.py
API Reference
conj
conj(word, properName=False, conjType='e')
- word (String): Word you want to conjugate.
- properName (Boolean): Determining if the word is a proper name to put apostrophe.
- conjType (String): See the conjugation types table below.
Conjugation Types
| conjType | desc | example | | ---------- | -------------------------------- | --------------- | | e | -e, -a (yönelme hâli) | İstanbul'a | | i | -i, -ı, -ü, -u (belirtme hâli) | İstanbul'u | | de | -de, -da (bulunma hâli) | İstanbul'da | | den | -den, -dan (ayrılma hâli) | İstanbul'dan | | li | -li, -lı (köken) | İstanbullu | | siz | -siz, -sız (gıyapta) | İstanbul'suz | | in | -in, -ın (âidiyet, ilişki) | İstanbul'un | | ler | -ler, -lar (çoğul hâl) | atlar | | mek | -mek, -mak (mastar) | gezmek |
Contributors
Contributing
- You can open an issue or send pull request about my faults.
- You can add new conjugation types via sending pull request.
License
Python conjugation module for Turkish.
Copyright (C) 2016 Halil Kaya
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
