A collection of utilities for working with Greek text
Project description
Greek Language Utilties from the WMU Hecurlaneum Project.
This package provides a set of utilities for working with Greek text. It is designed to be used in conjunction with the WMU Herculaneum Project, but can be used independently.
Installation
poetry add wmu_greek_utils
Usage
AGDT morphological parsing
parse_mophology
The parse_morphology
function can be used to parse the morphology field of a morphological code.
Examples:
- Parsing a verb morphology code:
>>> parse_morphology("v3sasm---")
['verb', 'third person', 'singular', 'aorist', 'subjunctive', 'middle', None, None, None]
- Parsing a noun morphology code:
>>> parse_morphology("n-s---mn-")
['noun', None, 'singular', None, None, None, 'masculine', 'nominative', None]
morphology_string
Given a list of forms, produce the morphology string to the best of our ability.
Examples:
- Basic usage with a list of forms:
>>> morphology_string(['noun', 'masculine', 'singular', 'nominative'])
'n-s---mn-'
- Usage with a randomized list of forms (in other words, the order of the forms does not matter):
>>> list = ['noun', 'masculine', 'singular', 'nominative']
>>> random.shuffle(list)
>>> morphology_string(list)
'n-s---mn-'
- Usage with abbreviated forms:
>>> morphology_string(['masc', 'sing', 'nom', 'n'])
'n-s---mn-'
- Usage with a more complex list of forms:
>>> morphology_string(['verb', 'third person', 'singular', 'aorist', 'subjunctive', 'middle', None, None, None])
'v3sasm---'
- Usage with a partial list of forms:
>>> morphology_string(['verb', 'third person', 'singular', 'aorist', 'subjunctive', 'middle'])
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wmu_greek_utils-0.2.1.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file wmu_greek_utils-0.2.1.tar.gz
.
File metadata
- Download URL: wmu_greek_utils-0.2.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c01d0a8a2e13e8f52243b5b1f6212f0b8dfbc94d346e804f76aa2fea1ee68b3 |
|
MD5 | 5408dc43c3682b99eb125035380584f7 |
|
BLAKE2b-256 | 4c39d9e1017159167d5293742fcb5c91c69e1d9694b935219a4ee8227b79b9db |
File details
Details for the file wmu_greek_utils-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: wmu_greek_utils-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35049b24265b18941b75171dcf0c95ba46242af23bc4d1447e060a8694839990 |
|
MD5 | f4aa35efa1e15d42ce7dd51b894b839e |
|
BLAKE2b-256 | e5797e43cc608b11f760ba085c10e1ba84f1668450cbfb2daef3f382e363de1d |