Coder Social home page Coder Social logo

go-reload's Introduction

Go-reloaded

Usage

Clone the repo:

git clone https://zone01normandie.org/git/ngenty/go-reloaded
cd go-reloaded

create a sample file (for ex: sample.txt)

harold wilson (cap, 2) : ' I am a optimist ,but a optimist who carries a raincoat . '

execute the code with:

go run . "sample.txt" "output.txt"

Objectives

In this project you will use some of your old functions made in your old repository. You will use them with the objective of making a simple text completion/editing/auto-correction tool.

  • Your project must be written in Go.

  • The code should respect the good practices.

  • (optional) It is recommended to have test files for unit testing.

  • tool receive (as arguments):

    • the name of a file containing a text that needs modifications (input)
    • the name of the file the modified text should be placed in (the output)
  • list of possible modifications that your program should execute:

    • conversion
      • (hex) -> replace the word before with its decimal version
        • note: the word will always be a hexadecimal number
        • ex: 1E (hex) -> 30; 1A -> 26; 42 -> 66
      • (bin) -> replace the word before with its decimal version
        • note: the word will always be a binary number
        • ex: 10 (bin) -> 2; 101 -> 5
    • texte transformation
      • (up, <num>?) -> converts the word before with its Uppercase version
        • ex: "Ready, set, go (up) !" -> "Ready, set, GO !"
      • (low, <num>?) -> converts the word before with its Lowercase version
        • ex: Ex: "I should stop SHOUTING (low)" -> "I should stop shouting"
      • (cap, <num>?) -> converts the word before with its capitalized version
        • ex: "Welcome to the Brooklyn bridge (cap)" -> "Welcome to the Brooklyn Bridge" Note: For (low), (up), (cap) if a number appears next to it, like so: (low, ) it turns the previously specified number of words in lowercase, uppercase or capitalized accordingly. (Ex: "This is so exciting (up, 2)" -> "This is SO EXCITING")
    • punctuation
      • . , ! ? : ; no space(s) before, one space after
      • note: group of multiples punctuation exists ... or !? (or else)
      • ' always surround a word or a group of words
    • vowels
      • a -> an if next word begins with a vowel a,e,i,o,u ex: "There it was. A amazing rock!" -> "There it was. An amazing rock!

tests

it (cap) was the best of times, it was the worst of times (up) , it was the age of wisdom, it was the age of foolishness (cap, 6) , it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of darkness, it was the spring of hope, IT WAS THE (low, 3) winter of despair.
It was the best of times, it was the worst of TIMES, it was the age of wisdom, It Was The Age Of Foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of darkness, it was the spring of hope, it was the winter of despair.

Simply add 42 (hex) and 10 (bin) and you will see the result is 68.
Simply add 66 and 2 and you will see the result is 68.

There is no greater agony than bearing a untold story inside you.
There is no greater agony than bearing an untold story inside you.

Punctuation tests are ... kinda boring ,don't you think !?
Punctuation tests are... kinda boring, don't you think!?

audit (github)

If I make you BREAKFAST IN BED (low, 3) just say thank you instead of: how (cap) did you get in my house (up, 2) ?
If I make you breakfast in bed just say thank you instead of: How did you get in MY HOUSE?

I have to pack 101 (bin) outfits. Packed 1a (hex) just to be sure
I have to pack 5 outfits. Packed 26 just to be sure

Don not be sad ,because sad backwards is das . And das not good
Don not be sad, because sad backwards is das. And das not good

harold wilson (cap, 2) : ' I am a optimist ,but a optimist who carries a raincoat . '
Harold Wilson: 'I am an optimist, but an optimist who carries a raincoat.'

Note: โš ๏ธ a possible trick is to add multiple transformation to a word or group of words

source

go-reload's People

Watchers

Nicolas Genty avatar

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.