|
1 | | -# ety-python |
2 | | - |
3 | | -A Python module to discover the etymology of words :book: |
4 | | - |
5 | | -[](https://travis-ci.org/jmsv/ety-python) |
6 | | -[](https://badge.fury.io/py/ety) |
7 | | -[](https://pypi.python.org/pypi/ety) |
8 | | -[](https://pypi.python.org/pypi/ety) |
9 | | -[](https://ety-python.readthedocs.io/en/latest/?badge=latest) |
10 | | - |
11 | | -## Intro |
12 | | - |
13 | | -Recently, [@jmsv](https://github.com/jmsv) and [@parker57](https://github.com/parker57) started a side project to analyse etymologies of text written by various historical authors, expecting there to already be a library for retrieving etymology data. On discovering that this wasn't the case, [ety](https://github.com/jmsv/ety-python) was created! |
14 | | - |
15 | | -There isn't a single source of truth for etymologies; words' origins can be heavily disputed. This package's source data, Gerard de Melo's [Etymological Wordnet](http://www1.icsi.berkeley.edu/~demelo/etymwn/), is mostly mined from Wiktionary. Since this is a collaboratively edited dictionary, its data could be seen as the closest we can get to a public consensus |
16 | | - |
17 | | -## Install |
18 | | - |
19 | | -### [pip](https://pypi.org/project/ety) |
20 | | - |
21 | | -```bash |
22 | | -pip install ety |
23 | | -``` |
24 | | - |
25 | | -### Development |
26 | | - |
27 | | -In a virtual environment - [Pipenv](https://docs.pipenv.org) is recommended: |
28 | | - |
29 | | -```bash |
30 | | -python setup.py install |
31 | | -``` |
32 | | - |
33 | | -## Usage |
34 | | - |
35 | | -### Module |
36 | | - |
37 | | -```python |
38 | | ->>> import ety |
39 | | - |
40 | | ->>> ety.origins("potato") |
41 | | -[Word(batata, language=Taino)] |
42 | | - |
43 | | ->>> ety.origins('drink', recursive=True) |
44 | | -[Word(drync, language=Old English (ca. 450-1100)), Word(drinken, language=Middle English (1100-1500)), Word(drincan, language=Old English (ca. 450-1100))] |
45 | | - |
46 | | ->>> print(ety.tree('aerodynamically')) |
47 | | -aerodynamically (English) |
48 | | -├── -ally (English) |
49 | | -└── aerodynamic (English) |
50 | | - ├── aero- (English) |
51 | | - │ └── ἀήρ (Ancient Greek (to 1453)) |
52 | | - └── dynamic (English) |
53 | | - └── dynamique (French) |
54 | | - └── δυναμικός (Ancient Greek (to 1453)) |
55 | | - └── δύναμις (Ancient Greek (to 1453)) |
56 | | - └── δύναμαι (Ancient Greek (to 1453)) |
57 | | -``` |
58 | | - |
59 | | -### CLI |
60 | | - |
61 | | -After installing, a command-line tool is also available. `ety -h` outputs the following help text describing arguments: |
62 | | - |
63 | | -``` |
64 | | -usage: ety [-h] [-r] [-t] words [words ...] |
65 | | -
|
66 | | -positional arguments: |
67 | | - words the search word(s) |
68 | | -
|
69 | | -optional arguments: |
70 | | - -h, --help show this help message and exit |
71 | | - -r, --recursive search origins recursively |
72 | | - -t, --tree display etymology tree |
73 | | -``` |
74 | | - |
75 | | -#### Examples |
76 | | - |
77 | | -```bash |
78 | | -$ ety drink |
79 | | -drink # List direct origins |
80 | | - • drync (Old English (ca. 450-1100)) |
81 | | - • drinken (Middle English (1100-1500)) |
82 | | - |
83 | | -$ ety drink -r # Recursive search |
84 | | -drink |
85 | | - • drync (Old English (ca. 450-1100)) |
86 | | - • drinken (Middle English (1100-1500)) |
87 | | - • drincan (Old English (ca. 450-1100)) |
88 | | - |
89 | | -$ ety drink -t # Etymology tree |
90 | | -drink (English) |
91 | | -├── drinken (Middle English (1100-1500)) |
92 | | -│ └── drincan (Old English (ca. 450-1100)) |
93 | | -└── drync (Old English (ca. 450-1100)) |
94 | | -``` |
| 1 | +# ety-python |
| 2 | + |
| 3 | +A Python module to discover the etymology of words :book: |
| 4 | + |
| 5 | +[](https://travis-ci.org/jmsv/ety-python) |
| 6 | +[](https://badge.fury.io/py/ety) |
| 7 | +[](https://pypi.python.org/pypi/ety) |
| 8 | +[](https://pypi.python.org/pypi/ety) |
| 9 | +[](https://ety-python.readthedocs.io/en/latest/?badge=latest) |
| 10 | + |
| 11 | +## Intro |
| 12 | + |
| 13 | +Recently, [@jmsv](https://github.com/jmsv) and [@parker57](https://github.com/parker57) started a side project to analyse etymologies of text written by various historical authors, expecting there to already be a library for retrieving etymological data. On discovering that this wasn't the case, [ety](https://github.com/jmsv/ety-python) was created! |
| 14 | + |
| 15 | +There isn't a single source of truth for etymologies; words' origins can be heavily disputed. This package's source data, Gerard de Melo's [Etymological Wordnet](http://www1.icsi.berkeley.edu/~demelo/etymwn/), is mostly mined from Wiktionary. Since this is a collaboratively edited dictionary, its data could be seen as the closest we can get to a public consensus. |
| 16 | + |
| 17 | +## Install |
| 18 | + |
| 19 | +### [pip](https://pypi.org/project/ety) |
| 20 | + |
| 21 | +```bash |
| 22 | +pip install ety |
| 23 | +``` |
| 24 | + |
| 25 | +### Development |
| 26 | + |
| 27 | +In a virtual environment - [Pipenv](https://docs.pipenv.org) is recommended: |
| 28 | + |
| 29 | +```bash |
| 30 | +python setup.py install |
| 31 | +``` |
| 32 | + |
| 33 | +## Usage |
| 34 | + |
| 35 | +### Module |
| 36 | + |
| 37 | +```python |
| 38 | +>>> import ety |
| 39 | + |
| 40 | +>>> ety.origins("potato") |
| 41 | +[Word(batata, language=Taino)] |
| 42 | + |
| 43 | +>>> ety.origins('drink', recursive=True) |
| 44 | +[Word(drync, language=Old English (ca. 450-1100)), Word(drinken, language=Middle English (1100-1500)), Word(drincan, language=Old English (ca. 450-1100))] |
| 45 | + |
| 46 | +>>> print(ety.tree('aerodynamically')) |
| 47 | +aerodynamically (English) |
| 48 | +├── -ally (English) |
| 49 | +└── aerodynamic (English) |
| 50 | + ├── aero- (English) |
| 51 | + │ └── ἀήρ (Ancient Greek (to 1453)) |
| 52 | + └── dynamic (English) |
| 53 | + └── dynamique (French) |
| 54 | + └── δυναμικός (Ancient Greek (to 1453)) |
| 55 | + └── δύναμις (Ancient Greek (to 1453)) |
| 56 | + └── δύναμαι (Ancient Greek (to 1453)) |
| 57 | +``` |
| 58 | + |
| 59 | +### CLI |
| 60 | + |
| 61 | +After installing, a command-line tool is also available. `ety -h` outputs the following help text describing arguments: |
| 62 | + |
| 63 | +``` |
| 64 | +usage: ety [-h] [-r] [-t] words [words ...] |
| 65 | +
|
| 66 | +positional arguments: |
| 67 | + words the search word(s) |
| 68 | +
|
| 69 | +optional arguments: |
| 70 | + -h, --help show this help message and exit |
| 71 | + -r, --recursive search origins recursively |
| 72 | + -t, --tree display etymology tree |
| 73 | +``` |
| 74 | + |
| 75 | +#### Examples |
| 76 | + |
| 77 | +```bash |
| 78 | +$ ety drink |
| 79 | +drink # List direct origins |
| 80 | + • drync (Old English (ca. 450-1100)) |
| 81 | + • drinken (Middle English (1100-1500)) |
| 82 | + |
| 83 | +$ ety drink -r # Recursive search |
| 84 | +drink |
| 85 | + • drync (Old English (ca. 450-1100)) |
| 86 | + • drinken (Middle English (1100-1500)) |
| 87 | + • drincan (Old English (ca. 450-1100)) |
| 88 | + |
| 89 | +$ ety drink -t # Etymology tree |
| 90 | +drink (English) |
| 91 | +├── drinken (Middle English (1100-1500)) |
| 92 | +│ └── drincan (Old English (ca. 450-1100)) |
| 93 | +└── drync (Old English (ca. 450-1100)) |
| 94 | +``` |
0 commit comments