Remove ambiguous plural(s)! Programming is very rigid. You can't tell a program to "output the banana count", you have to tell it to print(bananas).

But when you do that, you end up with a problem: you don't know how many bananas you have beforehand, so you don't know whether to use a plural.

Sometimes, programmers go the lazy way. Instead of checking, they just print there are X banana(s).

But that's ugly, so we need a program to fix this.

The method(s)

To remove the ambiguous plurals in a string, follow the following steps:


Split the string on spaces into a list of words.
For every word that ends with (s), do the following:


If the preceding word is a, an, 1 or one, remove the (s) at the end of the word.
Otherwise, if the word is the first word in the string or the preceding word is not a, an, 1 or one, replace the (s) at the end of the word with s.

Join the list of words back together into a string, preserving the original whitespace.


Example(s)

Let's take a string there's a banana(s) and three apple(s).

First, we split the string into a list of words: ["there's", "a", "banana(s)", "and", "three", "apple(s)"]

For the second step, we take the two words ending with (s): banana(s) and apple(s).

The word before banana(s) is a, so we remove the (s), making it banana. 
The word before apple(s) is three, so we change the (s) to s, thus it becomes apples.

We now have ["there's", "a", "banana", "and", "three", "apples"]. Joining the list back together, we get there's a banana and three apples. This is our end result.

The challenge(s)

Create a program or function that takes an ambiguous string in any reasonable format and returns the un-ambiguated version of that string.

You may assume the string contains no newlines, tabs or carriage returns.

I forgot to specify whether to split on groups of spaces or spaces (i.e. whether okay then with two spaces should be ["okay", "then"] or ["okay", "", "then"]) when posting the challenge, so you may assume either form of splitting.

Test case(s)

Input                                         -&gt; Output
there are two banana(s) and one leprechaun(s) -&gt; there are two bananas and one leprechaun
there's a banana(s) and three apple(s)        -&gt; there's a banana and three apples
apple(s)                                      -&gt; apples
one apple(s)                                  -&gt; one apple
1 banana(s)                                   -&gt; 1 banana
banana                                        -&gt; banana
preserve    original      whitespace(s)       -&gt; preserve    original      whitespaces
11 banana(s)                                  -&gt; 11 bananas
an apple(s)                                   -&gt; an apple
this is a te(s)t                              -&gt; this is a te(s)t
I am a (s)tranger(s)                          -&gt; I am a (s)tranger


Scoring

As this is code-golf, the submission with the least bytes wins!
Mathematica, 151 148 bytes

StringReplace[j=" ";k=Except@j;j&lt;&gt;j&lt;&gt;#&lt;&gt;j,j~~a:k...~~s:j..~~w:k..~~"(s)"~~j:&gt;{j,a,s,w,If[FreeQ[a,"a"|"an"|"1"|"one"],"s",""]}&lt;&gt;j]~StringTake~{3,-2}&amp;


Explanation

j=" ";k=Except@j


Set j to a whitespace character(s). Set k to the pattern "not j" (= non-whitespace character).

j&lt;&gt;j&lt;&gt;#&lt;&gt;j


Prepend two whitespace(s) and append one whitespace(s) to the input.

j~~a:k...~~s:j..~~w:k..~~"(s)"~~j


For a substring(s) matching the pattern:


One whitespace(s), followed by
a length-zero or longer substring consisting of only non-whitespace character(s) (quantifier) (call this a), followed by
a length-one or longer substring consisting of only whitespace character(s) (call this s), followed by
a length-one or longer substring consisting of only non-whitespace character(s) (word) (call this w), followed by
the string "(s)", followed by
a whitespace(s)



If[FreeQ[a,"a"|"an"|"1"|"one"],"s",""]


If a is not one of the singular word(s), evaluate to "s", otherwise "".

StringReplace[..., ... :&gt;{j,a,s,w,If[FreeQ[a,"a"|"an"|"1"|"one"],"s",""]}&lt;&gt;j]


Replace the matching pattern with j, a, s, w, If[FreeQ[a,"a"|"an"|"1"|"one"],"s",""], and j joined together.

... ~StringTake~{3,-2}


Take from position 3 to position -2 (1-indexed; negative indices count from the end). This is because we added three space(s) in the beginning.