[Snowball-discuss] Lithuanian stemmer in snowballstemmer Python library

Konstantin Gavras konstantin.gavras at uni-mannheim.de
Wed Mar 4 07:52:40 GMT 2020


Dear Olly,

I found the solution to my problem. I had the PyStemmer library
installed on my conda system as well.

This caused snowballstemmer to use PyStemmer functions, as mentioned in
the repo by shibukawa

"if *PyStemmer* is installed, |snowballstemmer.stemmer| returns
|PyStemmer|'s |Stemmer| objects. This |Stemmer| object has same methods
(|Stemmer.stemWord()|, |Stemmer.stemWords()|).".

Unfortunately, PyStemmer only supports a fraction of the snowballstemmer
languages.

Thank you very much for your effort!

Best

Konstantin

On 03.03.2020 21:25, Olly Betts wrote:
> On Tue, Mar 03, 2020 at 02:51:44PM +0100, Konstantin Gavras wrote:
>> On PyPi I found the snowballstemmer library, which mentions having a
>> Lithuanian stemming algorithm implemented. However, when running the
>> library in Python, the Lithuanian algorithm is not available. Am I doing
>> anything wrong?
> Works for me (tested with Python 2 only because I can't remember how you
> create a virtual env with Python 3 - it should work with either):
>
> $ virtualenv ENV
> Running virtualenv with interpreter /usr/bin/python2
> New python executable in /home/olly/ENV/bin/python2
> Also creating executable in /home/olly/ENV/bin/python
> Installing setuptools, pkg_resources, pip, wheel...done.
> $ . ENV/bin/activate
> (ENV) $ pip install snowballstemmer
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
> Collecting snowballstemmer
>   Downloading snowballstemmer-2.0.0-py2.py3-none-any.whl (97 kB)
>      |████████████████████████████████| 97 kB 1.9 MB/s 
> Installing collected packages: snowballstemmer
> Successfully installed snowballstemmer-2.0.0
> (ENV) $ python -c 'import snowballstemmer; s=snowballstemmer.stemmer("lithuanian"); print(s.stemWord("abatas"))'
> abat
>
> I think you'll need to share a minimal script which doesn't work for you.
>
> Cheers,
>     Olly

-- 
Konstantin Leonardo Gavras (M.A.)
University of Mannheim
Chair of Political Science/Political Psychology
A5, 6
Room 328
68131 Mannheim
Tel.: 0621 181-2083

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tartarus.org/pipermail/snowball-discuss/attachments/20200304/70683fdb/attachment.htm>


More information about the Snowball-discuss mailing list