Skip to main content

Python library for text normalization

Project description

Is that… is that a cucco? Sure it is!

Cucco is here to help you to normalize those nasty texts. Removing extra white spaces is not that hard, right? What about stop words? They’re no good… oh, and don’t even mention emojis!

This little friend will do the hard work for you. Just set it up and let it peck all over your text.

Oh please, shut up and show me where can I grab a cucco!

The easiest way to get a cucco is by using pip:

$ pip install cucco

But sometimes… sometimes you want to go wild and get the biggest… No, the best!… No, THE MIGHTIEST cucco!

To do so, you may use Git. Clone the repository from Github and do it all the hard way:

$ git clone https://github.com/davidmogar/cucco.git
$ cd cucco
$ python setup.py install

Got it. How do I use it?

Now that you have a cucco, I’ll let it give you all the details.

Cucuco, cuco cuco cucucuco, CUCCO!

—Cucco

So true… so true…[tears falling down my face]. Just allow me to add some insight.

There are two ways of using cucco. The first one is through its CLI. You can get more info on this by executing the next command:

$ cucco --help

The next example code shows how to normalize a short text using cucco inside your code:

from cucco import Cucco

cucco = Cucco()
print(cucco.normalize('Who let the cucco out?'))

This would apply all normalizations to the text Who let the cucco out?. The output for this normalizations would be the next one:

cucco

It’s also possible to send a list of normalizations to apply, which will be executed in order.

from cucco import Cucco

cucco = Cucco()

normalizations = [
    'remove_extra_white_spaces',
    ('replace_punctuation', {'replacement': ' '})
]

print(cucco.normalize('Who    let   the cucco out?', normalizations))

This is the output:

Who let the cucco out

For more information on how to use cucco you can check its website, which will be ready cucco-soon.

Supported languages

You never know when a cucco will learn a new trick. Currently, they can remove stop words for 50 languages. The complete list can be checked here. If you are looking for the source you can find it in this GitHub repository which uses json for the stop words files.

Can I contribute?

Are you a breeder? No? Don’t worry, you can still help.

Maybe you have a good new feature to add. Maybe is not even good. It doesn’t matter! It is always good to share ideas, isn’t it? Just go for it! Pull requests are warmly welcomed.

Not in the mood to implement it yourself? You can still create an issue and comment about it there. Feedback is always great!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cucco-2.2.1.tar.gz (51.0 kB view details)

Uploaded Source

File details

Details for the file cucco-2.2.1.tar.gz.

File metadata

  • Download URL: cucco-2.2.1.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cucco-2.2.1.tar.gz
Algorithm Hash digest
SHA256 4ecec20e2f706ff3c91851741145fe6837a95260d4471327ef2e01e5050c5729
MD5 06ff6eace1ec4204c010a295637cf5f9
BLAKE2b-256 76a4885b87757c0dabb87b6fa7f7ea214f33c03d6159aa4bcd7d7024f07839e5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page