[Question]
  [
## Story
Have you seen [this](https://9gag.com/gag/aE2y7MO) post from [9gag](https://9gag.com/)?
Maybe you got the feeling to make your own sentences. But then you realize that you could just golf a script in half an hour, and you will never have to deal time with that.
## The submission
Your program will get an input string which it will return with added quotation marks as explained below.
Standard loopholes are forbidden. Output as a list of lines is allowed. Trailing spaces and empty lines that don't break the output are allowed.
## The rules of input
* The input only contains printable ASCII characters.
* The input may contain spaces. The words are determined with them.
* It's guaranteed that a space will never be followed by another space.
* The case of no input or empty string doesn't matter.
## The rules of output
If one word is given then the program has to return the string between quotation marks.
If the input string has 2 or more words, it first returns the initial input, but the first word is in quotation marks. Then on the next line, it returns the initial input, but with the second word in quotes. And so on for the remaining words.
In general, the program has to return as many lines as there are words in the input.
## Examples:
```
test -> "test"
This is codegolf -> "This" is codegolf
                    This "is" codegolf
                    This is "codegolf"
This is a significantly longer, but not the longest testcase -> "This" is a significantly longer, but not the longest testcase
                                                                This "is" a significantly longer, but not the longest testcase
                                                                This is "a" significantly longer, but not the longest testcase
                                                                This is a "significantly" longer, but not the longest testcase
                                                                This is a significantly "longer," but not the longest testcase
                                                                This is a significantly longer, "but" not the longest testcase
                                                                This is a significantly longer, but "not" the longest testcase
                                                                This is a significantly longer, but not "the" longest testcase
                                                                This is a significantly longer, but not the "longest" testcase
                                                                This is a significantly longer, but not the longest "testcase"
Here is an another one -> "Here" is an another one
                          Here "is" an another one
                          Here is "an" another one
                          Here is an "another" one
                          Here is an another "one"
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the least byte answer wins!
  
[Answer]
## vim, 38 bytes
```
:s/"/<C-d>/g
qqysW"Ypds"W@qq@qdk:%s/<C-d>/"/g
```
[Try it online!](https://tio.run/##K/v/36pYX0nfxlk3xU4/nauwsLI4XCmyIKVYKdyhsNChMCXbSrUYKq0EVPD/f0lGZrECECUqKJWkFpco/dctAwA)
Requires the [vim-surround plugin](https://github.com/tpope/vim-surround).
If the input does not contain `"` characters, this can be done in **19 bytes**:
```
qqysW"Ypds"W@qq@qdk
```
Here, we record a recursive macro (`qq ... @qq@q`) that surrounds a word with quotation marks (`ysW"`), duplicates the line (`Yp`), deletes the quotation marks (`ds"`), and moves to the next word (`W`) before calling itself recursively. After it terminates, there are two extraneous lines, which are deleted with `dk`.
The full solution simply wraps this with `:s/"/<C-d>/g` at the beginning, which replaces existing `"` characters with an unprintable character, and `:%s/<C-d>/"/g` at the end, which undoes the replacement.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~15~~ 14 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Ḳ⁾""j$€⁹¦K¥ⱮJ$
```
**[Try it online!](https://tio.run/##y0rNyan8///hjk2PGvcpKWWpPGpa86hx56Fl3oeWPtq4zkvl/@H2yP//QzIyixWAKDk/JTU9PycNAA "Jelly – Try It Online")**
### How?
```
Ḳ⁾""j$€⁹¦K¥ⱮJ$ - Link: list of characters, S
Ḳ              - split (S) at spaces -> A
             $ - last two links as a monad:
           Ɱ   -   map...
            J  -   ...across: range of length -> I = [1,2,...len(A)]
          ¥    -   ...doing: last two links as a dyad: i.e. f(A, i) for i in I
      € ¦      -     sparse application...
       ⁹       -     ...to indices: chain's right argument, i
     $         -     ...action: last two links as a monad:
 ⁾""           -       literal list of characters = ['"', '"']
    j          -       join (with A[i]) -> (e.g. with ['i','s']) ['"','i','s','"']
         K     -     join with spaces
```
[Answer]
## Haskell, 65 bytes
```
([]#).words
a#(b:c)=unwords(a++('"':b++"\""):c):(a++[b])#c
_#_=[]
```
Returns a list of lines.
[Try it online!](https://tio.run/##VYyxbsMwDER3fwUhD5HgNB9gwHuHdmo3RzBkhbKFKpQhySj681WZeCpwIB@Ph1tN/sIQqoMBrlWOulWX75huuTGtnHurhp2etzRdJ0/i1M9dJ65CKP71D3OctWptM7XTMOp6N5646m629wnksba9fJT0RnAByXkhtGJ0CsYGQBTMRZwf9Ln6DCwbb7jE4P67BrJfyDtvDZXwAyHSgukM816AYoGy4uFlZh7WZDwaXjHhs4FYkXMJIqHQ9de6YJZcX@y2/QE "Haskell – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 17 bytes
```
 
" $'¶$` "
^|$
"
```
[Try it online!](https://tio.run/##PYtBCkIxDET3OUUoFV14Dz2Aa/m15reBkkATF4Ln@gfwYrUoCMNjeMx0cpY0dofTMhACxv17iwsGuL4ihDGczOFS2XAm652KtvUvEhoX4ZVzEm9PbCqF@hFvD0dRR6/0czb7RE5GcKZO3/NcVOqoQh8 "Retina 0.8.2 – Try It Online") Link includes test suite. Explanation:
```
 
" $'¶$` "
```
Expand each space by duplicating the line and then inserting quotation marks.
```
^|$
"
```
Fix the first and last lines.
[Answer]
# JavaScript (ES6), ~~43 42 41~~ 38 bytes
*Saved 3 bytes thanks to @mazzy*
Uses the non-standard but widely supported [`RegExp.left​Context`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/leftContext) and [`RegExp.rightContext`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/rightContext). That's a lot of different quotes...
```
s=>s.replace(/(\S+) ?/g,`$\`"$1" $'
`)
```
[Try it online!](https://tio.run/##fYxBCsIwEEX3PcUQAiZYWzxA9RC67KIxTtJIyJRMFDx9DLhzIXw@n8fnPczLsM1hK4dEd6xuqjydeMi4RWNRjWq@7DWcR98vcl6EPAqQu27R1VJiijhE8sopcUUuQuvuF6@BocU2uafo/lwMcPApuGBNKvENkZLH3MPtWSBRgbLil3HbraxhbLr6AQ "JavaScript (Node.js) – Try It Online")
[Answer]
# Java, ~~235 183~~ 132 bytes
```
s->{String a[]=s.split(" "),r="",t;for(int l=a.length,i=0,j;i<l;i++,r+="\n")for(j=0;j<l;)r+=(t=i==j?"\"":"")+a[j++]+t+" ";return r;}
```
-52 bytes by abusing a variety of things (static access, list vs array, print instead of returning, etc. Thanks @ValueInk!)  
-51 bytes by beung lazy and letting @KevinCruijssen do the work for me 
  
[Try it online](https://tio.run/##NY4xa8MwEIV3/4rjJgk5JnNUtVu2TunmeFBtyZGqyEY6B4Lxb3dVSOHgHY/v3j2vH/rgh5@9Dzpn@NQurpWLZJLVvYHzeqHk4giWvZbM5VbNy3dwPWTSVOQxuQHu5fLFtB3oNGa@VmewoPZ8eP@P0W2ncpPn4IghIK@TQqxJ2imx8hWC0k0wcaRb7dSx9tK9BemEqJNQeI3I/0CvjtIXnxeTkXJK@Q@8Ip4QudCtF6ITJEq8TIaWFCHJbZfV5ZnJ3JtpoWYuZShEZhvL8OvmMpTpp8GMU7DIuay2bf8F)
[Answer]
First code golf attempt hopefully it's not terrible and hopefully it's not rule breaking
## Kotlin, ~~105~~ ~~112~~ ~~147~~ 117 bytes/chars
```
fun main(a:Array<String>){val q=a[0].split(" ")
q.forEach{println(q.fold(""){i,n->i+if(it==n)"\"$n\" " else n+" "})}}
```
[Try it online!](https://tio.run/##FYtBCsIwEEX3nmIILhLU4lpswYUn0J11MbZNOzhO2iQKUnr2GOEvHo/3ny4ySUr2LfBCEo2Hk/f4PV6iJ@krM3@QYSrxtr8XYWSKWoEyq6mwzp@xGeYxd5FF/w23Wikz01Z2FW3IaoplKUbVai11/kHHoQPZZFzMsqSUrgMFyGtc2/WOLTwoNgNgCD8 "Kotlin – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/) with `-an`, 53 bytes
The flags `-an` are read each line and split to `$F`.
```
$F.size.times{|i|a=$F.dup;a[i]=?"+a[i]+?";puts a*' '}
```
[Try it online!](https://tio.run/##PYvdCoJQEITvfYpFAiHLFxDxLnqA7qKLo666YLvi7rmwn1fvdCoIhpnhY2bxzRrC5lAo3bAwuqLeH/RwVUSdn0t3pktVp/kn8zotZ28KbptB9gzBUC05jaQQ1UqHg0z9HzhQGph6ah3btMIkPOCyg8YbsBjYiD@msUdrnWJyxAW/Z46SOFlAGF8yGwlr2Dt@Aw "Ruby – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 14 bytes
```
ð¡©ε®y…"ÿ"Nǝ}»
```
[Try it online!](https://tio.run/##yy9OTMpM/f//8IZDCw@tPLf10LrKRw3LlA7vV/I7Prf20O7//0syMosVgChRoSS1uAQA "05AB1E – Try It Online")
---
+1 byte (and it works for the edge case) thanks to Emigna.
-1 byte thanks to Kevin!
[Answer]
## JavaScript, ~~91~~ ~~97~~ ~~75~~ 78 bytes
```
f= 
t=>t.split` `.map((c,i,a)=>[...a.slice(0,i),`"${c}"`,...a.slice(i+1)].join` `)
// and test
console.log(f("Hello folks and world").join('\n'));
```
Outputs a list of lines as a JavaScript array. The last entry has a trailing space as allowed in the question. The test code writes each entry to the console on a separate line for demonstration purposes.
Thanks to Shaggy for 19 bytes off and no leading spaces - when the spread operator is used on an empty array to initialize an array literal, no slots are created in the array produced by the spread operator:
```
let empty = [];
let array = [...empty, value]
//  produces an array of length 1 containing value 
```
(The 91 byte version had a leading space on the first line, the 97 byte version took 6 bytes to remove it.)
[Answer]
# [Python 3](https://docs.python.org/3/), 79, 69, 65 bytes
```
w,i=input(),0
while~i:m=w.split();m[i]='"%s"'%m[i];print(*m);i+=1
```
[Try it online!](https://tio.run/##K6gsycjPM/7/v1wn0zYzr6C0RENTx4CrPCMzJ7Uu0yrXtlyvuCAnEyhqnRudGWurrqRarKSuCmJbFxRl5pVoaOVqWmdq2xr@/2@oYKRgrGCiYAoA "Python 3 – Try It Online")
Shaved 10 bytes thanks to xnor. And now this is 65 bytes as per Erik the Outgolfer solution. Program ends with IndexError but this is fine.
[Answer]
# Java 8, ~~72~~ ~~71~~ ~~67~~ 62 bytes
```
s->s.replaceAll("(?<=(^.*))(\\S+) ?(?=(.*$))","$1\"$2\" $3\n")
```
[Try it online.](https://tio.run/##dVBNT8MwDL3vV1hRD8k@KgE3xqi4wYFxGDcKUpZmbUbmVI07aUL77SVtgxASkxLLsd97efZeHuViX3x2ykrv4Vka/JoAGCTd7KTSsO6fABtqDJageEy8WIb6eRKCJ0lGwRoQVtD5xb1PG13bQH6wljOe3a34RzoVguf5ZiYg49mKp9NECDZnyVXOkuucQXKTIxPdsles260NilH46EwBh2As/v32DlKMrkh74qyPbPDzU3mtjIdwlCt06ezu/64Eb0o0O6Mkkj2BdVjqZg7blgAdAVV6rHkamEp6/VfpUTd6UArwSjfgMALO4f6uZphgYMTtGaxbijNsTp70IXUtpXVokkXOnvr@LbDZCFxeBL60NCIvYzBVfJSJzs7dNw)
**Explanation:**
```
s->                    // Method with String as both parameter and return-type
  s.replaceAll("...",  //  Replace all matches in this regex
               "...")  //  With this
                       //  And then return the result
```
*Regex explanation:*
```
(?<=(^.*))(\\S+) ?(?=(.*$))   # === MATCH ===
(?<=     )                    # A positive look-behind to:
     ^.*                      #  The optional leading portion of the string
    (   )                     #  (which is captured in capture group 1)
           \\S+               # Followed by one or more non-space characters,
                              # so the next word in line
          (    )              # (which is captured in capture group 2)
                 ?            # Followed by an optional space
                  (?=     )   # Followed by a positive look-ahead to:
                      .*$     #  The trailing optional portion of the string
                     (   )    #  (which is captured in capture group 3)
$1\"$2\" $3\n                 # === REPLACEMENT ===
$1                            # The match of capture group 1
                              # (the leading portion)
    $2                        # Followed by the match of capture group 2
                              # (the current word in the 'iteration'),
  \"  \"                      # surrounded by quotation marks
                              # Followed by a space character
         $3                   # Followed by the match of capture group 3
                              # (the trailing portion)
           \n                 # Followed by a trailing newline
```
[Answer]
# [Ruby](https://www.ruby-lang.org/en/), 98 chars.
First submission ever. This can definitely be shortened. I just wanted to get an answer in quickly. 
```
a=->s{s.split.each_index{|i|puts s.split.each_with_index.map{|a,j|i==j ? "\"#{a}\"":a}.join(" ")}}
```
[Try it online!](https://tio.run/##bY1BCsJQDET3niJ8NwraAwjVrQdwpyKxjTal/l9@UlTanr1G60ZwMwwzw7zYnJ/DgOlyLa0kUlesCWFWnNjn9Gg77upGBX6qO@u3T25Ytx0uyo7TtIQNuIObttgfnFthn5SB/cyBm/f9gHunJOqOE3NbigQsgIA@aEERgqexep9D3hgtQyW4h5gL/AvH@a6wm8@T8NXzxQZeqydUwV8pLuDcKBgCDDJmYt4kQzHg8AI)
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~43~~ 40 bytes
```
{m:ex/^(.*?<<)(\S+)(>>.*)$/>>.join('"')}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJZm@7861yq1Qj9OQ0/L3sZGUyMmWFtTw85OT0tTRR9IZeVn5mmoK6lr1v5P01AKycgsVgCi5PyU1PT8nDQlTaCS4sTK/wA "Perl 6 – Try It Online")
Matches all possible words, then joins each list by quotes. This could be one byte shorter if we could output lines in reverse order.
### Explanation:
```
{                                      }  # Anonymous code block
 m:ex/^                  $/               # Match all strings
       (.*?)         (.*)                 # Match before and after sections
            <<(\S+)>>                     # And the actual word (with no spaces)
                           >>.join('"')   # And join each line by "s
```
[Answer]
## [Reflections](https://gitlab.com/TheWastl/Reflections#reflections), 229 bytes
```
  _1 +\ /\/(3\  /(0\
/+_:   # \#_: v1=2#_ \
\     /_+/:3; / 1/\:1)
/v(3(2/ \3)(3 ;\#@ \ /
   /:#_(0\:_ / (0*  /0  \
 0 >~    <>~   <0 \  *#_/
 \       /     /\/ v/ 
   \=2#_1/\2#_>  (0~
                 \ ^\
\                   /
```
[Test it!](https://thewastl.gitlab.io/Reflections/reflections.html##ICBfMSArXCAvXC8oM1wgIC8oMFwKLytfOiAgICMgXCNfOiB2MT0yI18gXApcICAgICAvXysvOjM7IC8gMS9cOjEpCi92KDMoMi8gXDMpKDMgO1wjQCBcIC8KICAgLzojXygwXDpfIC8gKDAqICAvMCAgXAogMCA+fiAgICA8Pn4gICA8MCBcICAqI18vCiBcICAgICAgIC8gICAgIC9cLyB2LyAKICAgXD0yI18xL1wyI18+ICAoMH4KICAgICAgICAgICAgICAgICBcIF5cClwgICAgICAgICAgICAgICAgICAgL/8w/zIwMP8w/1RoaXMgaXMgYSBzaWduaWZpY2FudGx5IGxvbmdlciwgYnV0IG5vdCB0aGUgbG9uZ2VzdCB0ZXN0Y2FzZQ==)
I "quickly" "golfed" this in a "funny" "golfing" language.
Looking at all that whitespace, it could probably be shorter.
[Answer]
# [Haskell](https://www.haskell.org/), 64 bytes
```
map unwords.g.words
g(h:t)=(('"':h++"\""):t):map(h:)(g t)
g _=[]
```
[Try it online!](https://tio.run/##VU/LasQwELvnK4Qva5NtPiCQew/tqb1lw@J6/aKuHewJpT/fdLrppSBGQhKCCbq925R2N132D71iy5@l3trghzt3XoaR1CTlSZzG0PfiIoRiZ@QyR0p6kOo8rtO88EDMmMDR8xXyoHWjF6pPGQNk389CLIqlU5g7QJBtJM6/6jXEBoYpN@tLcv9djRZ9ji4anSl9IZXsbT3jbSPkQqBgD6@x5mN0s8fCo632vpAZhXsVJf9l/MuyfxuXtG/7g1nXHw "Haskell – Try It Online")
Outputs a list of strings. Based on [nimi's answer](https://codegolf.stackexchange.com/a/185426/20260).
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 10 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
▓¼MY@≈╢∞◙╗
```
[Run and debug it](https://staxlang.xyz/#p=b2ac4d5940f7b6ec0abb&i=this+is+codegolf&a=1)
Unpacked, ungolfed, and commented, it looks like this.
```
jY      split on spaces and store in y register
m       for each word, run the rest of the program and implicitly output
  '"|S  surround with double quotes
  yia&  start with register y, and replace the ith element, where i is the iteration index
  J     join with spaces
```
[Run this one](https://staxlang.xyz/#c=jY++++%09split+on+spaces+and+store+in+y+register%0Am+++++%09for+each+word,+run+the+rest+of+the+program+and+implicitly+output%0A++%27%22%7CS%09surround+with+double+quotes%0A++yia%26%09start+with+register+y,+and+replace+the+ith+element,+where+i+is+the+iteration+index%0A++J+++%09join+with+spaces&i=this+is+codegolf)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 136 133 bytes
As C's tokenizing functions would mess up the string on future reads, I instead calculate the number and offsets for each word and then finish when the total number of iterations of the outer loop matches the number of words.
```
i,j=1;f(s,c,t)char*s,*c,*t;{for(i=0;i++<j;puts(""))for(j=0,c=t=s;t;t=c+!!c)printf("%3$s%.*s%s ",(c=index(t,32))-t,t,"\""+!!(i-++j));}
```
[Try it online!](https://tio.run/##HY7BasNADETv@QplqUHalUucHDfbH2l7MGqcyFA3WEoohHz71i7M4c0MAyPtWaRW5bF0eUBjYSe59HM0jsLR82P4mVHLLmtKxzFfb24YAtEaj2XHUrxY9uxF0nYrdJ118gFDc3ix5jVaYxAYpej0dfpF58OeqHV2Dh8hLAvUNqWRKD/rMoTvXidcoZ/PwrBegRgXcyd4bAB0wLV56wj@6f7efVLePGv1ixos6sFP5n8 "C (gcc) – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~60~~ ~~40~~ 36 bytes
*-20 bytes inspired by [Arnauld](https://codegolf.stackexchange.com/a/185469/80745)*
```
$args-replace'(\S+) ?','$`"$1" $''
'
```
[Try it online!](https://tio.run/##rZTRTsMgFIbv@xQnJyhr7C58AKOX3uulibLurGtCoAKLmrlnr0DpZqPdLlpCSsv5@PKTFBr9QcZuScqWbeAO9i0TprJLQ40UJfHFy9NNDve84OwN2S0C4zzj7SHLHhYZ@FZ0Q2jckXW8OH1jmEAeJ/LsD77Wu5UkSIOLw2B5V8FxIhWO4CjRgx0wHul5W1vwvdRrqrTcDOKEIo5V40oMwGg1AH3xcgQBtq5UvalLoZz8AqlVRaaA1c6B0g7clro569/9oxSW/o871XTa2iymIBM4k0kADkQ4wTRMhEmEk019IvQinMUUEqEX4SymkAi9CGcxhUSYRDjZ1CfCXjR@cB7JUNQq37VfbECr4ZEICJ5noqX72c8z8TdWeInxFkwInmF6C3rkuMUcvuEK9vGLWWdqVRXA6LOh0tHa39bstasZsjvp/MS1v8QTGSvIFkvbyNolJMdlSe94dODv9dmh/QE "PowerShell – Try It Online")
The result has one extra space and one empty line in the tail.
---
# Powershell, no regexp, 60 bytes
```
($w=-split$args)|%{$p=++$c
"$($w|%{$q='"'*!--$p
"$q$_$q"})"}
```
[Try it online!](https://tio.run/##rZRNboMwFIT3nOJ15JTQwBGQuuwBuo8IcQiSZQN2lFYJZ6c2P0lRS7IAC2H8Zt6nsWRTqDOv9JEL0bADxXRp1uwcR7oQuWFJlengurqwIt5sWOqBWdGty9iH//YSRaywxZJtWYk6QN3Unve@9siOsJvc8A3Xxg/va7gC/LYQeH/se3XaCU79ZNpp1N4pmHb0ws046RiMnWE60ucx12SfVO15psRhFMeJmFLbTjjDpOoMg/g8QkI6z2R@yNNEGvFNQsmMVyHtToakMmSOvKtp@21faaL5/3Hnku5bW4TkYAkWIiWEEQgzSONE6EGYTRoSwYKwCMklggVhEZJLBAvCIiSXCD0Is0lDIgyg6YvzwSveYqV9lG2uSMnxlXAWPPa0lO6wP/a0x1jimcdS0FvwwDNQYC23LQZ0pRVd2hXTpsplFhLjXwVPDd/bvzjbdlrF9UkYW3i1P/fe2SroJUQpL3Frxe82r25@AA "PowerShell – Try It Online")
Less golfed:
```
$words=-split $args                     # split by whitespaces
$words|%{
    $position=++$counter
    $array=$words|%{
        $quotation='"'*!--$position     # empty string or quotation char
        "$quotation$_$quotation"
    }
    "$($array)"                         # equivalent to $array-join' '
}
```
[Answer]
# JavaScript, 62 bytes
Thanks @Shaggy for golfing off 10 bytes
```
f=
x=>x.split` `.map((c,i,a)=>(s=[...a],s[i]=`"${c}"`,s.join` `))
console.log(f("Hello folks and world").join('\n'));
```
### Explanation
* The function splits the string at each space (x.split` `)
* For each element in the resulting array perform the following function
* Create a shallow copy of the array (s=[...a])
* Replace the nth element in the array with itself surrounded with quotation marks (s[i]=`"${c}"`)
* return the shallow copy joined with spaces (s.join` `)
[Answer]
# [Java (JDK)](http://jdk.java.net/), 104 bytes
```
t->{var w=t.split(" ");int i=0;for(var s:w){w[i]='"'+s+'"';System.out.println(s.join(" ",w));w[i++]=s;}}
```
[Try it online!](https://tio.run/##XY/BboMwDIbvPIXFpWTQaOcyetlll526W9VDmgZqBgmKTVFV8ewsgNZJk5xY8W///lKrm9rWl@8J2855hjq8Zc/YyLK3mtFZ@ZJHkW4UEXwqtPCIALr@3KAGYsUh3RxeoA1acmCPtjqeQPmKxNwJ8O4s9a3xb6u4hxIKmHi7f9yUh6FgSV2DnMQQixwtAxaveel8Msu0G8RjOOKp2MSblNJw54c7sWml61l2wZEbm5CsXVgfLLJBiDwMpOmpoHwcp3yBeIKxIaYAsLIBxF9XJAih3cVUrinj7L@igLCyWKJWYdkdGmcr4zM49wzWMfDVrDXixV4rMn8uH8abxcWGcKHXg7MmXuRxhfv97Dy8WwnFE7CUSmvTcTLXxTowRvMZpx8 "Java (JDK) – Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~94~~ 76 bytes
-18 bytes thanks to Giuseppe
```
m=matrix(s<-scan(,a<-'"'),n<-length(s),n);diag(m)=paste0(a,s,a);write(m,1,n)
```
[Try it online!](https://tio.run/##DcpNCoAgEEDhq0QbRxih1tktusBgZoI/4Qh1@0l4mw9eE8l7pt7iB2wNOyqAZI2alcZiTfIl9Bt4QG9npABZ7w9x9wsQMpLe3ha7h4zrWOS4I08jV08farpEfg "R – Try It Online")
Thanks to digEmAll for setting up the TIO properly. It takes in e.g. `This is codegolf` and outputs correctly 
```
"This" is codegolf 
 This "is" codegolf 
 This is "codegolf" 
```
It uses a matrix format with the sentence repeated `n` times; then we only need to change the diagonal entries. Note that usually, in R code-golf, strings are read in with `scan(,"")`, but any string can be used instead of the empty string as the `what` (or `w`) parameter.
Explanation of old ungolfed version:
```
s <- scan(t=scan(,''),w=t)    # read in input and separate by spaces
n <- length(s)                # number of words
m = matrix(s, n, n)           # fill a matrix, one word per entry, each column corresponds to the whole sentence. The sentence is repeated n times.
diag(m) = paste0('"', s, '"') # replace diagonal entries with the corresponding word surrounded by quotes
cat(rbind(m,"\n"))        # add a \n at the end of each column, then print column-wise
```
[Answer]
This is my first code golf. hopefully its not shit. 
**EDIT: got it down to 54 bytes with a better regular expression.**
\*\*EDIT 2: per suggestions, fixed a bug and made it shorter \*\*
# [JavaScript (V8)](https://v8.dev/), 46 bytes
```
t=>t.split(' ').map(v=>t.replace(v,'"'+v+'"'))
```
[Try it online!](https://tio.run/##HYtBDsIgEADvvoJwYUmVXk1MPfcRXggFQ11ZApv1@Vi9zGEys3vxPbRc@SLXkZbBy51dr5gZjDLWvX0F@bkWK/oQQc5Gm0mmg9aOeVa@bIpj51Og0gmjQ3pCAr1GRFKJ8NX/zYcabtq6nXIB8yjHfhtf "JavaScript (V8) – Try It Online")
[Answer]
# [C# (Visual C# Interactive Compiler)](https://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc) with `/u:System.Text.RegularExpressions.Regex` flag, ~~59~~ 40 bytes
```
s=>Replace(s,"(\\S+) ?","$`\"$1\" $'\n")
```
~~Port of [my Java 8 answer](https://codegolf.stackexchange.com/a/185575/52210), so look there for an explanation.~~  
-19 bytes by porting [*@Arnauld*'s regex](https://codegolf.stackexchange.com/a/185469/52210), since the `$``  and `$'` are supported in C# .NET.
[Try it online.](https://tio.run/##dYzBSgNBDIbvPkUYFrqLa8Wr2npSeuipLXiZg@OYnQ2MmWWShe3Ld9y2N0UIyc/Hl9/LnRcqbyP7Z9FMHFq43jV0sCqyWu9wiM5jLa2prd3fNvBiWlN9WFM9WAPVwrJpytPNeybFLTHWXW0URU3T/KKHngTm8ekLQ4rd/4YDocDUkXes8QgxccDcwueowElBe7wymfO8vBP827bBjJe2@aXHDIkvUjmlQSmxlPvxcX8Uxe/lASdd7jCM0eXXacgocjbOCKcf)
[Answer]
# [Elm](https://elm-lang.org) Using recursion, ~~132,130,121,111,100~~ 99 bytes
Golfed down 9 bytes thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen) technique
and another 22 bytes were cracked by [ASCII-only](https://codegolf.stackexchange.com/users/39244/ascii-only). Turned to non-tail recursion during the golf.
```
f b a=case a of
 c::r->String.join" "(b++("\""++c++"\"")::r)::f(b++[c])r
 _->[]
u=f[]<<String.words
```
[Try it online](https://ellie-app.com/5xXSnKStRq3a1)
85 bytes after exposing `String` functions to the current scope
```
f b a=case a of
 c::r->join" "(b++("""++c++""")::r)::f(b++[c])r
 _->[]
u=f[]<<words
```
Ungolfed version (Using tail recursion)
```
push : List a -> a -> List a
push list el =
    list ++ [ el ]
zip : (List a -> a -> List a -> b) -> List a -> List a -> List b -> List b
zip transform before after mapped =
    case after of
        [] ->
            mapped
        current :: rest ->
            transform before current rest
                |> push mapped
                |> zip transform (push before current) rest
wrap : appendable -> appendable -> appendable
wrap v str =
    v ++ str ++ v
cb : List String -> String -> List String -> String
cb before current rest =
    before ++ wrap "\"" current :: rest
        |> String.join " "
result : List String
result =
    zip cb [] (String.words "This is code golf") []
```
[Try ungolfed](https://ellie-app.com/5xYCtbmYhspa1)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~14~~ 12 bytes
```
¸£¸hYQ²i1X)¸
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=uKO4aFlRsmkxWCm4&input=IlRoaXMgaXMgY29kZWdvbGYiCi1S)
2 bytes saved thanks to Oliver.
```
¸£¸hYQ²i1X)¸     :Implicit input of string
¸                :Split on spaces
 £               :Map each X at index Y
  ¸              :  Split input on spaces
   hY            :  Set the element at index Y to
     Q           :    Quotation mark
      ²          :    Repeat twice
       i1X       :    Insert X at 0-based index 1
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~70~~ 65 bytes
```
param($a)$a.Split()|%{$a-replace[regex]"( |^)$_( |$)"," ""$_"" "}
```
[Try it online!](https://tio.run/##ZY/BasMwDIbvfgoh3BJD2jfYPfcOdhht0DIlMXi2sV3akuTZM7Vhpwmh/0cfv0Ax3DjlkZ1bdQ9vMK2REv1Umoym4yk6Wyoz7yZNh8TRUcefiQe@n7GC@WJ0K6IN1giIukWRZV2UqhRIYeFcsN58w4nBZiAvHcrICYLnP/o@CnpSyHbwtrcd@eIe4IIfONXwdS0gKZDctsviZXSU/93owjcPwfWoDMywg@mF9/Kfbl/2I9nChybkopb1Fw "PowerShell – Try It Online")
Has test suite in trial. Has 1 leading space on first row, and 1 trailing space on last row. Attempting to refactor.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 19 bytes
```
Ｅ⪪θ ⪫Ｅ⪪θ ⎇⁼κμ⪫""λλ 
```
[Try it online!](https://tio.run/##bUu7CgIxEOz9iiVVAvELrG0EQfBKmzXEy@K6uUv2hPv6GDnsZB4Mw0xIWEJGbu1SSNSecbLXiUnt7MGAcR5OmeRfP8QiWFZ7nBfkap8eXr@1uXUYD@y@ctvDuUNrQ6IKnQiVRqEHBRTlFTjLGIuH@6IgWUFT3Lrac7eANe7a/s0f "Charcoal – Try It Online") Link is to verbose version of code. Note: Trailing space. Explanation:
```
  θ                     Input string
 ⪪                      Split on literal space
Ｅ                       Map over words
       θ                Input string
      ⪪                 Split on literal space
     Ｅ                  Map over words
            μ           Inner index
          ⁼             Equals
           κ            Outer index
         ⎇             If true then
               ""       Literal string `""`
              ⪫         Joined i.e. wrapping
                 λ      Current word
                  λ     Otherwise current word
    ⪫                  Joined with literal space
                        Implicitly print each result on its own line
```
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/Attache), 34 bytes
```
Join&sp=>{On&_&Repr=>Iota@_}@Split
```
[Try it online!](https://tio.run/##NY7BCsIwDIbve4owZJftCYTJwIt6UFFvY4zapVuhtKWNBxGfvUbdwk/4@ZI/RBAJOWFSsK7TwWlbRF9vXidb9MUFfag3e0ei6d/N1RtN6Yg4xHblvRy77By0pRtG2oqIsX0ZVfalUe/md8ioRlXQZsCVE2/l1ewnHYEl3YCjM2rhOwz45cKyHE0YwFlcprc5JSDq0WqlpbBknmCcHTFUcH8QcAo492eRPTfJv@VZ16UP "Attache – Try It Online") Anonymous function returning a list of lines.
## Explanation
```
Join&sp=>{On&_&Repr=>Iota@_}@Split
                             Split      Splits the input on whitespace
         {         =>Iota@_}            Over each number K, 0 to #words - 1
          On  &Repr                     Apply the Repr (quoting) function
            &_                          on the Kth element in the input
Join&sp=>                               then rejoin the words of each inner sentence
```
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 123 bytes
I wonder if can this be shortened with regular expressions.
```
s=>(r=s.Split(' ')).Select((a,i)=>(string.Join(" ",r.Take(i))+" \""+a+"\" "+string.Join(" ",r.Skip(i+1))).Trim());string[]r
```
[Try it online!](https://tio.run/##hY5BT4QwEIXv/oqXXrYNSOJ5hYtxE43xAsaDeCi1CyOlYFvU9c9js@zFeNhkMpm8efO@Uf5SeVp2s1XXPjiybYq7WzsP2snG6JNWFNg9Pd7ki88L7nKflZOhwDfYCJGV2mgVOJcpibheL7L7kSxnYKnLKtlrTkIkDDVjiUxYHRfJf2PZ08QpuRIxtXI0cCG2q@vl1S3bi2dHQf8F1Jalx984qzryiCXhqbW0JyVtMAeY0bbapWjmADsGhE6vmo9zbEp6zSLylP9AVnNxDibRQOENGnu06EB4Rw@DARYjJnzAwSNgxie@8I0Dfo6M5Rc "C# (Visual C# Interactive Compiler) – Try It Online")
]