naubull2 / rust-del-dups

Rust duplicate removal API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rust-del-dups

Rust remove-duplicate API

Simply removes ngram duplicates in the input string.

  • Allows up to 5 unigram repetitions
  • Allows up to 3 bigram repetitions
  • Allows up to 1 N-gram repetitions (N > 2)

How to use

Simply build using cargo, then run the API via cargo run

cargo run
...
Running `target/debug/src`
πŸ”§ Configured for debug.
   >> address: 127.0.0.1
   >> port: 8000
   >> workers: 10
   >> ident: Rocket
   >> limits: bytes = 8KiB, data-form = 2MiB, file = 1MiB, form = 32KiB, json = 1MiB, msgpack = 1MiB, string = 8KiB
   >> temp dir: /var/folders/6k/tjrzsxzd6_13ngrfyc6t13_w0000gp/T/
   >> http/2: true
   >> keep-alive: 5s
   >> tls: disabled
   >> shutdown: ctrlc = true, force = true, signals = [SIGTERM], grace = 2s, mercy = 3s
   >> log level: normal
   >> cli colors: true
πŸ“¬ Routes:
   >> (remove_dups_handler) GET /remove-dups?<q>
πŸ“‘ Fairings:
   >> Shield (liftoff, response, singleton)
πŸ›‘οΈ Shield:
   >> X-Frame-Options: SAMEORIGIN
   >> Permissions-Policy: interest-cohort=()
   >> X-Content-Type-Options: nosniff
πŸš€ Rocket has launched from http://127.0.0.1:8000

  • Sample run
    // http://localhost:8000/remove-dups?q=leetleetleetcode%20is%20not%20fun
    
    {
      "result": "leetcode is not fun "
    }
    

About

Rust duplicate removal API

License:MIT License


Languages

Language:Rust 100.0%