Coder Social home page Coder Social logo

Comments (1)

hugovk avatar hugovk commented on August 24, 2024

An explicit example:

Python 3.7.0 (default, Jun 29 2018, 20:13:13)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import inflect
>>> p = inflect.engine()
>>> print(p.singular_noun("police"))
polouse

This comes from here:

https://github.com/jazzband/inflect/blob/10de13826086c16cfbd6156e24caedc9d31b56c5/inflect.py#L2413-L2414

However, I'm not sure if this is a bug. You're asking for the singular noun of "police", which is neither a plural nor singular noun. It's a collective noun.

So I think this is classed under "junk in, junk out":

Note that all such methods expect the singular form of the word. The results of passing a plural form are undefined (and unlikely to be correct).

https://github.com/jazzband/inflect/blob/master/README.rst#forming-plurals-and-singulars

An exception might be the dialect form known from The Wire/Baltimore, "he's a good police", but:

The module is built around standard British spelling, but is designed to cope with common American variants as well. Slang, jargon, and other English dialects are not explicitly catered for.

from inflect.

Related Issues (20)

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.