GithubHelp home page GithubHelp logo

janos / casbab-rs Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 37 KB

A rust library for converting representation style of compound words or phrases.

License: BSD 3-Clause "New" or "Revised" License

Rust 100.00%
camel lower pascal rust screaming snake strings kebeb

casbab-rs's Introduction

Camel Snake Kebab

Rust Crate Docs

Package casbab is a rust library for converting representation style of compound words or phrases. Different writing styles of compound words are used for different purposes in computer code and variables to easily distinguish type, properties or meaning.

Functions in this package are separating words from input string and constructing an appropriate phrase representation.

Install

Run the following Cargo command in your project directory:

cargo add casbab

Features

This library implements the following functions that return appropriate styles of compound words:

  • camel: example camelSnakeKebab
  • pascal: example CamelSnakeKebab
  • snake: example camel_snake_kebab
  • camel_snake: example Camel_Snake_Kebab
  • screaming_snake: example CAMEL_SNAKE_KEBAB
  • kebab: example camel-snake-kebab
  • camel_kebab: example Camel-Snake-Kebab
  • screaming_kebab: example CAMEL-SNAKE-KEBAB
  • lower: example camel snake kebab
  • title: example Camel Snake Kebab
  • screaming: example CAMEL SNAKE KEBAB

Performance

Benchmarks run cargo bench on MacBook Pro M1Pro yield these timings:

camel                   time:   [878.76 ns 884.24 ns 889.59 ns]
pascal                  time:   [858.82 ns 866.89 ns 874.65 ns]
snake                   time:   [537.22 ns 540.21 ns 543.24 ns]
camel_snake             time:   [870.81 ns 876.18 ns 881.71 ns]
screaming_snake         time:   [551.08 ns 552.52 ns 553.97 ns]
kebab                   time:   [537.33 ns 540.59 ns 543.96 ns]
camel_kebab             time:   [863.78 ns 871.67 ns 879.36 ns]
screaming_kebab         time:   [554.04 ns 555.31 ns 556.61 ns]
lower                   time:   [530.32 ns 531.99 ns 533.61 ns]
title                   time:   [877.86 ns 884.77 ns 891.13 ns]
screaming               time:   [560.80 ns 563.78 ns 566.98 ns]

CLI

Build:

cargo install casbab --features build-binary

Get help:

casbab -h

Examples:

casbab screaming-snake "it is what it is"
casbab kebab my_snake_string some_kinda_Snake
echo "DO NOT SCREAM PLEASE" | casbab lower
cat variables.txt | casbab camel

Versioning

Each version of the client is tagged and the version is updated accordingly. To see the list of past versions, run git tag.

Contributing

We love pull requests! Please see the contribution guidelines.

License

This library is distributed under the BSD-style license found in the LICENSE file.

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.