-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies Signed-off-by: Olga Bulat <[email protected]> * Move to pdm Signed-off-by: Olga Bulat <[email protected]> * Remove install nltk from ci Signed-off-by: Olga Bulat <[email protected]> * Migrate to pdm Signed-off-by: Olga Bulat <[email protected]> --------- Signed-off-by: Olga Bulat <[email protected]>
- Loading branch information
Showing
81 changed files
with
1,619 additions
and
17,021 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9, '3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: pdm install | ||
|
||
- name: Test with pytest and coverage | ||
run: pdm run pytest | ||
|
||
- name: Codecov | ||
uses: codecov/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,7 @@ ENV/ | |
.mypy_cache/ | ||
/vvenv/ | ||
/.idea/ | ||
|
||
# pdm stuff | ||
.pdm-python | ||
.pdm-build/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Zeyrek: Morphological Analyzer and Lemmatizer | ||
|
||
![PyPI - Version](https://img.shields.io/pypi/v/zeyrek) | ||
|
||
Zeyrek is a partial port of the [Zemberek library](https://github.com/ahmetaa/zemberek-nlp) to Python for lemmatizing | ||
and analyzing Turkish language words. It is in alpha stage, and the API | ||
will probably change. | ||
|
||
|
||
* Free software: MIT license | ||
* Documentation: https://zeyrek.readthedocs.io. | ||
|
||
|
||
## Basic Usage | ||
|
||
To use Zeyrek, first create an instance of `MorphAnalyzer` class: | ||
|
||
```shell | ||
import zeyrek | ||
analyzer = zeyrek.MorphAnalyzer() | ||
``` | ||
|
||
Then, you can call its `analyze` method on words or texts to get all possible analyses:: | ||
|
||
```shell | ||
print(analyzer.analyze('benim')) | ||
Parse(word='benim', lemma='ben', pos='Noun', morphemes=['Noun', 'A3sg', 'P1sg'], formatted='[ben:Noun] ben:Noun+A3sg+im:P1sg') | ||
Parse(word='benim', lemma='ben', pos='Pron', morphemes=['Pron', 'A1sg', 'Gen'], formatted='[ben:Pron,Pers] ben:Pron+A1sg+im:Gen') | ||
Parse(word='benim', lemma='ben', pos='Verb', morphemes=['Noun', 'A3sg', 'Zero', 'Verb', 'Pres', 'A1sg'], formatted='[ben:Noun] ben:Noun+A3sg|Zero→Verb+Pres+im:A1sg') | ||
Parse(word='benim', lemma='ben', pos='Verb', morphemes=['Pron', 'A1sg', 'Zero', 'Verb', 'Pres', 'A1sg'], formatted='[ben:Pron,Pers] ben:Pron+A1sg|Zero→Verb+Pres+im:A1sg') | ||
``` | ||
If you only need the base form of words, or lemmas, you can call `lemmatize`. It returns a list | ||
of tuples, with word itself and a list of possible lemmas:: | ||
|
||
```shell | ||
print(analyzer.lemmatize('benim')) | ||
[('benim', ['ben'])] | ||
``` | ||
|
||
|
||
## Credits | ||
|
||
This package is a Python port of part of the [Zemberek](https://github.com/ahmetaa/zemberek-nlp) package by [Ahmet A. Akın](https://github.com/ahmetaa) | ||
|
||
|
||
This package was created with | ||
[Cookiecutter](https://github.com/audreyr/cookiecutter) and the | ||
[audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) | ||
project template. | ||
|
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.