Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a method to get the "last lemma" #19

Open
frknltrk opened this issue May 8, 2022 · 1 comment
Open

a method to get the "last lemma" #19

frknltrk opened this issue May 8, 2022 · 1 comment

Comments

@frknltrk
Copy link

frknltrk commented May 8, 2022

analyzer.lemmatize() simply returns all the possible lemmas for the word. what would be really cool is to have a method which simply returns the first lemma; tail to head (i.e. last lemma; head to tail).
for example:

analyzer.lemmatize("çekiliş")
["çekilişle", ("çekiliş", "çekmek", "çekilmek")]
when we remove the inflectional suffix '-le' we still preserve the meaning. but after removing 'iş' we have a different meaning (çekilmek). so an example usecase would be;
analyzer.get_last_lemma("'çekilişle")
"çekiliş"

@HarikalarKutusu
Copy link

You could use something like this:

word: str = "çekiliş"
_orig, lemmas = analyzer.lemmatize(word)
if lemmas:
   first: str = lemmas[0]
   last: str = lemmas[-1]
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants