Coder Social home page Coder Social logo

Comments (3)

Priler avatar Priler commented on June 14, 2024 1

Thanks, I can confirm that everything works fine now in 0.5.11.

About the add_word, is there will be any performance impact if I call it, let's say ... 10 thousand times?
I just want to use rustrict in my telegram chat bot as a profanity filter module.
And I need some kind of easy-to-use way of extending the default dictionary.

from rustrict.

finnbear avatar finnbear commented on June 14, 2024 1

About the add_word, is there will be any performance impact if I call it, let's say ... 10 thousand times?

There are two parts to the performance impact:

  • Calling add_word that many times will add a small, possibly negligible delay at startup
  • Future filter performance will be slightly worse (I'm guessing around 25% slower), because using more memory means a smaller proportion will fit in the CPU cache. It will not be 10,000 times slower than if there was only 1 word (the filter never iterates all words in the wordlist).

from rustrict.

finnbear avatar finnbear commented on June 14, 2024

Thanks for the issue! I've changed the character replacement strategy to allow matching certain non-ASCII characters. Your example now works in version 0.5.11.

Also, is there a way to massively add new words?

You can call add_word as many times as you want. #6 did ask for a more ergonomic API, and it is something I'm considering :)

from rustrict.

Related Issues (15)

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.