Code Monkey home page Code Monkey logo

dutch-pluralizer-py's People

Contributors

keescbakker avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jirmauritz

dutch-pluralizer-py's Issues

Python 3.6 support

When using python 3.6 this crashes on a reggex module import.

    from dutch_pluralizer import singularize
../../../.pyenv/versions/3.6.9/envs/transformers/lib/python3.6/site-packages/dutch_pluralizer/__init__.py:9: in <module>
    from .pluralizer import pluralize, pluralize_advanced
../../../.pyenv/versions/3.6.9/envs/transformers/lib/python3.6/site-packages/dutch_pluralizer/pluralizer.py:10: in <module>
    from .strategies.pluralize_bastard_words import pluralize_bastard
../../../.pyenv/versions/3.6.9/envs/transformers/lib/python3.6/site-packages/dutch_pluralizer/strategies/pluralize_bastard_words.py:3: in <module>
    from .helpers import VOWELS
../../../.pyenv/versions/3.6.9/envs/transformers/lib/python3.6/site-packages/dutch_pluralizer/strategies/helpers.py:2: in <module>
    from re import Pattern
E   ImportError: cannot import name 'Pattern'

IndexError for "*en" words

Hi, thanks for this library!
I found a bug, where the singularize('wen') function fails with:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-30-c22a683fcf9c> in <module>()
----> 1 singularize('wen')

3 frames
/usr/local/lib/python3.6/dist-packages/dutch_pluralizer/strategies/pluralize_with_en.py in singularize_with_en_double_consonant(plural)
     83     singular = plural[0:-2]
     84     if singular[-1] not in VOWELS and \
---> 85         singular[-1] == singular[-2] and \
     86         singular[-3] in VOWELS:
     87         return singular[0:-1]

IndexError: string index out of range

It happens for all kinds of three letter words that end with 'en'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.