CoolFace
Datasetpublic

Chapimenge/amharic-gemination-lexicon

Amharic Gemination Lexicon v3 Which consonants are doubled in each of 86,022 Amharic words, for every reading of the word, and where each doubling comes from. Built by Dataset.ET with the HornMorpho morphological analyzer, corrected with rules that native listening, Armbruster's hand-marked verb tables and recorded speech agree on. Word types 86,022 (856,734 corpus tokens) Analyzed by HornMorpho 56,964 types, 84.0% of tokens Words with a geminate in the top… See the full description on the dataset page: https://huggingface.co/datasets/Chapimenge/amharic-gemination-lexicon.

sourceHugging Facecc-by-4.0updated 11h agoView on Hugging Face
0likes
INSTALL.md71 linesDownload Raw Back to code
1# Running the extractor2 3`gemination.py` has no dependencies of its own. To turn new words into4gemination patterns it needs HornMorpho 5.3.6 (Michael Gasser,5https://github.com/hltdi/HornMorpho) with two small patches.6 7## One command8 9```bash10./install_hornmorpho.sh .venv-hm          # Python 3.9 or newer; set PYTHON=... to choose one11LANG=C.UTF-8 .venv-hm/bin/python gemination.py ይገኛል ክልል መለወጥ12LANG=C.UTF-8 .venv-hm/bin/python test_gemination.py13```14 15Expected output of the second line (tab-separated):16 17```18ይገኛል  ይገ፟ኛ፟ል  positions=[1, 2]  sources=['t-prefix', 'root']  pos=V  root_freq=3688  seg=----ይ</ገ/ኝ>---ኣ/ል---19ክልል   ክል፟ል   positions=[1]     sources=['lexicon']            pos=N  root_freq=1     seg=-<ክ/ልል>------20መለወጥ  መለ፟ወጥ  positions=[1]     sources=['t-prefix']           pos=N  root_freq=84    seg=-<መ/-ለወጥ>------21መለወጥ  መለወ፟ጥ  positions=[2]     sources=['root']               pos=N  root_freq=84    seg=-<መ-ለ/ወጥ>------22```23 24መለወጥ has two readings (passive mälläwäṭ, active mäläwwäṭ), so it prints two25patterns. Only sentence context can choose between them.26 27## What the script does, step by step28 291. **Install the wheel.** HornMorpho is not on PyPI. The script downloads30   `dist/hornmorpho-5.3.6-py3-none-any.whl` from the HornMorpho repository at31   commit `7e3d93af760e27ea6dbc3b7a078d2d9c3335f618` and checks its sha25632   (`e1b0e4ed...fa7`). Dependencies `conllu` and `requests` come with it.332. **Patch 1, Tk GUI stub** (`patches/gui.py`, replaces `hm/morpho/gui.py`).34   `hm/morpho/corpus.py` does `from .gui import *` at import time, so35   `import hm` fails on any Python without `_tkinter`. The stub defines the36   one name `corpus.py` refers to. Applied only when `import tkinter` fails.373. **Patch 2, lexicon loader** (`patches/morphology.patch`, applied with38   `patch -p1` inside site-packages). `words1.srf` lines are39   `ortho phon POS` with `#` comment lines, but the loader built a dict from40   the raw split, which raises on the first real entry.414. **Amharic data.** `src/hm/languages/a.tgz` from the same commit42   (sha256 `3274f71d...95c`), unpacked into `hm/languages/`.43 44Always run with a UTF-8 locale (`LANG=C.UTF-8`).45 46## The call that matters47 48```python49import hm50readings = list(hm.anal("a", "ይገኛል", degem=False))   # degem=False keeps the '/' marks51```52 53With the default `degem=True` the `/` marks are stripped from `seg`, and the54only gemination information left is the `+gemN` root feature, which misses55every geminate created by a prefix or a suffix. That was the bug in v1 of this56lexicon.57 58```python59import gemination as G60G.analyze("ይገኛል")                 # runs HornMorpho, returns patterns, most frequent root first61G.word_gemination(word, readings)  # same, from readings you already have62G.reading_gemination(word, {"seg": "----ይ</ገ/ኝ>---ኣ/ል---"})   # one seg, no HornMorpho needed63G.mark("ይገኛል", [1, 2])            # 'ይገ፟ኛ፟ል'64```65 66## Rebuilding the release files67 68`build_lexicon.py` converts the internal lexicon (one entry per word with the69stored HornMorpho segs) into `data/`. It re-derives every pattern from its segs70and stops if any disagrees, so the data cannot drift from this extractor.71